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

feat: improve exports for ESM and add shorthand export for the full.pretty build #176

Merged
merged 2 commits into from
Oct 13, 2023
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
4 changes: 2 additions & 2 deletions .github/workflows/lactame.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
Expand All @@ -17,7 +17,7 @@ jobs:
run: ./scripts/get-gwt.sh
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Build project
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ name: Node.js CI

on:
push:
branches: main
branches:
- main
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 20.x
- name: Install dependencies
run: npm ci
- name: Run ESLint
Expand All @@ -21,10 +22,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x, 20.x]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
token: ${{ secrets.BOT_TOKEN }}
release-type: node
package-name: 'openchemlib'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
# These if statements ensure that a publication only occurs when a new release is created
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-java@v3
Expand All @@ -28,7 +28,7 @@ jobs:
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: 20.x
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- run: npm ci
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build documentation
uses: zakodium/typedoc-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion core.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('./dist/openchemlib-core');
module.exports = require('./dist/openchemlib-core.js');
2 changes: 1 addition & 1 deletion full.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('./dist/openchemlib-full');
module.exports = require('./dist/openchemlib-full.js');
3 changes: 3 additions & 0 deletions full.pretty.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';

module.exports = require('./dist/openchemlib-full.pretty.js');
2 changes: 1 addition & 1 deletion minimal.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use strict';

module.exports = require('./dist/openchemlib-minimal');
module.exports = require('./dist/openchemlib-minimal.js');
20 changes: 19 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@
"test-only": "jest"
},
"main": "./core.js",
"exports": {
".": "./core.js",
"./minimal": "./minimal.js",
"./minimal.js": "./minimal.js",
"./core": "./core.js",
"./core.js": "./core.js",
"./full": "./full.js",
"./full.js": "./full.js",
"./full.pretty": {
"types": "./full.d.ts",
"default": "./full.pretty.js"
},
"./full.pretty.js": {
"types": "./full.d.ts",
"default": "./full.pretty.js"
}
},
"files": [
"dist",
"types.d.ts",
Expand All @@ -36,7 +53,8 @@
"core.js",
"core.d.ts",
"full.js",
"full.d.ts"
"full.d.ts",
"full.pretty.js"
],
"repository": {
"type": "git",
Expand Down
Loading