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

Use Rollup for tests and examples #348

Merged
merged 16 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
13 changes: 5 additions & 8 deletions examples/example-accordionpanel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.8.2",
"private": true,
"scripts": {
"build": "tsc && webpack",
"build": "tsc && rollup -c",
"clean": "rimraf build"
},
"dependencies": {
Expand All @@ -12,13 +12,10 @@
"@lumino/widgets": "^1.33.0"
},
"devDependencies": {
"css-loader": "^3.4.0",
"file-loader": "^5.0.2",
"@rollup/plugin-node-resolve": "^13.3.0",
"rimraf": "^3.0.2",
"source-map-loader": "0.2.4",
"style-loader": "^1.0.2",
"typescript": "~4.7.3",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
"rollup": "^2.77.3",
"rollup-plugin-styles": "^4.0.0",
"typescript": "~4.7.3"
}
}
12 changes: 12 additions & 0 deletions examples/example-accordionpanel/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import nodeResolve from '@rollup/plugin-node-resolve';
fcollonval marked this conversation as resolved.
Show resolved Hide resolved
import styles from 'rollup-plugin-styles';

export default {
input: './build/index.js',
output: {
file: './build/bundle.example.js',
format: 'iife',
sourcemap: true
},
plugins: [styles(), nodeResolve()]
};
4 changes: 2 additions & 2 deletions examples/example-accordionpanel/style/index.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*
/*
Copyright (c) Jupyter Development Team.
Distributed under the terms of the Modified BSD License.
*/
@import '~@lumino/default-theme/style/index.css';
@import '@lumino/default-theme/style/index.css';
gabalafou marked this conversation as resolved.
Show resolved Hide resolved
@import './content.css';

body {
Expand Down
2 changes: 1 addition & 1 deletion examples/example-accordionpanel/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"noUnusedLocals": true,
"strictNullChecks": true,
"sourceMap": true,
"module": "commonjs",
"module": "ES6",
"moduleResolution": "node",
"target": "ES6",
"outDir": "./build",
Expand Down
19 changes: 0 additions & 19 deletions examples/example-accordionpanel/webpack.config.js

This file was deleted.

9 changes: 4 additions & 5 deletions packages/algorithm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
"api": "api-extractor run --local --verbose",
"build": "npm run build:src && rollup -c",
"build:src": "tsc --build",
"build:test": "tsc --build tests && cd tests && webpack",
"build:test": "npm run clean:test && tsc --build tests && cd tests && rollup -c",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should clean be part of the build step? If you don't run clean and delete the tests/tsconfig.tsbuildinfo file then the build step will do nothing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't sure if I should add clean:test here, but without it the build:test script/command is not idempotent because it creates a tsconfig.tsbuildinfo file, which I found prevents a second run of the build:test command from picking up intervening changes in the test code.

"clean": "rimraf ./lib && rimraf *.tsbuildinfo && rimraf ./types && rimraf ./dist",
"clean:test": "rimraf tests/build",
"clean:test": "rimraf tests/lib && rimraf tests/tsconfig.tsbuildinfo",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Must delete the .tsbuildinfo file or else the build command will do nothing.

gabalafou marked this conversation as resolved.
Show resolved Hide resolved
"docs": "typedoc --options ../../typedoc.js src",
"minimize": "terser dist/index.js -c -m --source-map \"content='dist/index.js.map',url='index.min.js.map'\" -o dist/index.min.js",
"test": "npm run test:firefox-headless",
gabalafou marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -41,6 +41,7 @@
},
"devDependencies": {
"@microsoft/api-extractor": "^7.6.0",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^13.3.0",
"@types/mocha": "^2.2.39",
"chai": "^4.3.4",
Expand All @@ -59,9 +60,7 @@
"terser": "^5.7.1",
"tslib": "^2.4.0",
"typedoc": "~0.23.9",
"typescript": "~4.7.3",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
gabalafou marked this conversation as resolved.
Show resolved Hide resolved
"typescript": "~4.7.3"
},
"publishConfig": {
"access": "public"
Expand Down
10 changes: 10 additions & 0 deletions packages/algorithm/tests/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import nodeResolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';

export default {
input: './lib/index.spec.js',
output: {
file: './lib/bundle.test.js'
},
plugins: [commonjs(), nodeResolve()]
gabalafou marked this conversation as resolved.
Show resolved Hide resolved
};
10 changes: 0 additions & 10 deletions packages/algorithm/tests/webpack.config.js

This file was deleted.

4 changes: 2 additions & 2 deletions packages/default-theme/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
|
| The full license is in the file LICENSE, distributed with this software.
|----------------------------------------------------------------------------*/
@import '~@lumino/dragdrop/style/index.css';
@import '~@lumino/widgets/style/index.css';
@import '@lumino/dragdrop/style/index.css';
@import '@lumino/widgets/style/index.css';
@import './accordionpanel.css';
@import './commandpalette.css';
@import './datagrid.css';
Expand Down
Loading