Skip to content

Commit 7eaca96

Browse files
committed
chore: build some more libs with rollup and include OCL resources in build
1 parent 22ad30b commit 7eaca96

File tree

6 files changed

+245
-44
lines changed

6 files changed

+245
-44
lines changed

.ncurc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
reject:
2-
# Now ESM, which is not supported by browserify.
2+
# Now ESM with multiple exports, but we rely on the default export.
33
- delay
44
# Now ESM and depends on top-level await.
55
- tempfile

gruntfile.js

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -106,28 +106,6 @@ module.exports = function (grunt) {
106106
grunt.initConfig({
107107
pkg: grunt.file.readJSON('package.json'),
108108
browserify: {
109-
countries: {
110-
files: {
111-
'src/browserified/country-data/index.js': [
112-
'./node_modules/country-data/index.js',
113-
],
114-
},
115-
options: {
116-
browserifyOptions: {
117-
standalone: 'CountryData',
118-
},
119-
},
120-
},
121-
delay: {
122-
files: {
123-
'src/browserified/delay/index.js': ['./node_modules/delay/index.js'],
124-
},
125-
options: {
126-
browserifyOptions: {
127-
standalone: 'Delay',
128-
},
129-
},
130-
},
131109
mimeTypes: {
132110
files: {
133111
'src/browserified/mime-types/index.js': [
@@ -198,18 +176,6 @@ module.exports = function (grunt) {
198176
},
199177
},
200178
},
201-
SmartArrayFilter: {
202-
files: {
203-
'src/browserified/SmartArrayFilter/index.js': [
204-
'./node_modules/smart-array-filter/lib/index.js',
205-
],
206-
},
207-
options: {
208-
browserifyOptions: {
209-
standalone: 'SAF',
210-
},
211-
},
212-
},
213179
},
214180
babel: {
215181
transpile: {

package-lock.json

Lines changed: 203 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
"scripts": {
1111
"build": "grunt build",
1212
"build-debug": "node --inspect --debug-brk ./node_modules/grunt-cli/bin/grunt build",
13+
"copy-resources": "node -e \"fs.copyFileSync('node_modules/openchemlib/dist/resources.json', 'src/browserified/openchemlib/resources.json')\"",
1314
"eslint": "eslint src --cache",
1415
"eslint-fix": "npm run eslint -- --fix",
1516
"install-components": "bower install",
1617
"install-browserified": "grunt browserify",
1718
"install-rollup": "rollup --config rollup.config.mjs",
18-
"postinstall": "npm run install-components && npm run install-browserified && npm run install-rollup",
19+
"postinstall": "npm run install-components && npm run install-browserified && npm run install-rollup && npm run copy-resources",
1920
"prerelease": "grunt bump:prerelease",
2021
"prettier": "prettier --check src",
2122
"prettier-write": "prettier --write src",
@@ -41,6 +42,9 @@
4142
},
4243
"devDependencies": {
4344
"@babel/types": "^7.27.0",
45+
"@rollup/plugin-commonjs": "^28.0.3",
46+
"@rollup/plugin-json": "^6.1.0",
47+
"@rollup/plugin-node-resolve": "^16.0.1",
4448
"add-stream": "^1.0.0",
4549
"bower": "^1.8.14",
4650
"conventional-changelog": "^6.0.0",
@@ -73,7 +77,7 @@
7377
"bio-parsers": "4.2.4",
7478
"country-data": "0.0.31",
7579
"d3-hierarchy": "^1.1.9",
76-
"delay": "^4.0.0",
80+
"delay": "^5.0.0",
7781
"eslint-plugin-import": "^2.31.0",
7882
"katex": "^0.10.0",
7983
"mathjs": "^5.10.3",

0 commit comments

Comments
 (0)