Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ts-interface checking, add stats HTML, modern target #70

Merged
merged 1 commit into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,5 @@ typings/

dist/
typedocs/
.DS_store
stats*.html
205 changes: 176 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,15 @@
"rollup": "^1.32.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.24.3",
"rollup-plugin-visualizer": "^4.2.0",
"serve-static": "^1.14.1",
"ts-interface-builder": "^0.2.1",
"ts-jest": "^23.10.5",
"ts-node": "^7.0.1",
"typedoc": "^0.15.8",
"typescript": "^3.8.3"
},
"dependencies": {
"numcodecs": "^0.1.0",
"p-queue": "6.2.0",
"ts-interface-checker": "^0.1.10"
"p-queue": "6.2.0"
}
}
24 changes: 15 additions & 9 deletions rollup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,32 @@ import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import typescript from 'rollup-plugin-typescript2';
import { terser } from 'rollup-plugin-terser';
import visualizer from 'rollup-plugin-visualizer';

const commonPlugins = () => [typescript({ useTsconfigDeclarationDir: true, objectHashIgnoreUnknownHack: true, }), commonjs(), resolve()];


export default [
{
input: { zarr: 'src/zarr.ts', core: 'src/zarr-core.ts' },
output: {
output: [{
dir: 'dist/',
format: 'es',
entryFileNames: '[name].mjs',
sourcemap: true,
},
{
dir: 'dist/',
format: 'es',
entryFileNames: '[name].min.mjs',
sourcemap: true,
plugins: [terser()]
},
],
watch: {
include: 'src/**',
},
plugins: [typescript({ useTsconfigDeclarationDir: true }), commonjs(), resolve()],
plugins: [...commonPlugins(), visualizer({filename: "stats.html"}), visualizer({filename: "stats.min.html", sourcemap: true})],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can plugins === commonPlugins() here and output[0].plugins === [ visualizer({filename: "stats.html"}) ] and output[1].plugins === [ terser(), visualizer({filename: "stats.min.html", sourcemap: true }) ]

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The visualizer plugin didn't want to be an output plugin so I had to use this workaround

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, not a big deal :)

},
{
input: 'src/zarr.ts',
Expand All @@ -31,13 +43,7 @@ export default [
},
],
plugins: [
typescript({
useTsconfigDeclarationDir: true,
// https://github.com/ezolenko/rollup-plugin-typescript2/issues/105
objectHashIgnoreUnknownHack: true,
}),
commonjs(),
resolve(),
...commonPlugins()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need to spread, just plugins === commonPlugins(), unless you think leaving room for future node-specific plugins is useful.

],
},
];
56 changes: 0 additions & 56 deletions src/types-ti.ts

This file was deleted.

Loading