Skip to content

Commit

Permalink
feat: provide datasets in json, csv, xlsx
Browse files Browse the repository at this point in the history
  • Loading branch information
sneko committed Mar 25, 2024
1 parent 9f6d586 commit 3ae9020
Show file tree
Hide file tree
Showing 13 changed files with 1,258 additions and 86 deletions.
8 changes: 8 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ module.exports = {
config.resolve.alias = {};
}

// [IMPORTANT] We wanted to use the node version for `main` and the browser for `docs` but we had issues using just an alias with default name as origin
// so we changed to a `xxx-proxy` but then the `TypeScript is unable to find the module with right `paths` settings in `tsconfig.json`
// so definitely giving up the optimization and using the ESM browser also for the node version
// // Needed to make the CSV node library working in the browser
// // We tried to do `csv-parse --> csv-parse/browser/esm` but it does not work, maybe because it's the same prefix... so we use a suffix `-proxy`
// config.resolve.alias['csv-parse-proxy'] = 'csv-parse/browser/esm';
// config.resolve.alias['csv-stringify-proxy'] = 'csv-stringify/browser/esm';

config.resolve.plugins = [
new TsconfigPathsPlugin({
configFile: path.resolve(__dirname, '../tsconfig.json'),
Expand Down
4 changes: 4 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ const moduleExports = async () => {
source: '/sitemap/:reference.xml',
destination: '/api/sitemap/:reference',
},
{
source: '/dataset/initiatives.:filetype',
destination: '/api/dataset/initiatives?filetype=:filetype',
},
];
},
images: {
Expand Down
Loading

0 comments on commit 3ae9020

Please sign in to comment.