Skip to content

Commit

Permalink
Node 20 and no_dist (#107)
Browse files Browse the repository at this point in the history
Closes *list issues numbers here*

### Developer Checklist (Definition of Done)

**Issue**

- [ ] All acceptance criteria from the issue are met
- [ ] Tested in latest Chrome/Firefox

**UI/UX/Vis**

- [ ] Requires UI/UX/Vis review
  - [ ] Reviewer(s) are notified (_tag assignees_)
  - [ ] Review has occurred (_link to notes_)
  - [ ] Feedback is included in this PR
  - [ ] Reviewer(s) approve of concept and design

**Code**

- [ ] Branch is up-to-date with the branch to be merged with, i.e.,
develop
- [ ] Code is cleaned up and formatted
- [ ] Unit tests are written (frontend/backend if applicable)
- [ ] Integration tests are written (if applicable)

**PR**

- [ ] Descriptive title for this pull request is provided (will be used
for release notes later)
- [ ] Reviewer and assignees are defined
- [ ] Add type label (e.g., *bug*, *feature*) to this pull request
- [ ] Add release label (e.g., `release: minor`) to this PR following
[semver](https://semver.org/)
- [ ] The PR is connected to the corresponding issue (via `Closes #...`)
- [ ] [Summary of changes](#summary-of-changes) is written


### Summary of changes

- 

### Screenshots


### Additional notes for the reviewer(s)

-  
Thanks for creating this pull request 🤗
  • Loading branch information
puehringer authored Nov 9, 2023
2 parents 6c58f26 + 7d298d8 commit 9b4d00a
Show file tree
Hide file tree
Showing 3 changed files with 201 additions and 64 deletions.
253 changes: 194 additions & 59 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,86 +16,227 @@
"type": "git",
"url": "[email protected]:datavisyn/visyn_core.git"
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"main": "src/index.ts",
"types": "src/index.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
"types": [
"./dist/index.d.ts",
"./src/index.ts"
],
"import": [
"./dist/index.js",
"./src/index.ts"
],
"default": [
"./dist/index.js",
"./src/index.ts"
]
},
"./app": {
"types": "./dist/app/index.d.ts",
"import": "./dist/app/index.js",
"default": "./dist/app/index.js"
"types": [
"./dist/app/index.d.ts",
"./src/app/index.ts"
],
"import": [
"./dist/app/index.js",
"./src/app/index.ts"
],
"default": [
"./dist/app/index.js",
"./src/app/index.ts"
]
},
"./base": {
"types": "./dist/base/index.d.ts",
"import": "./dist/base/index.js",
"default": "./dist/base/index.js"
"types": [
"./dist/base/index.d.ts",
"./src/base/index.ts"
],
"import": [
"./dist/base/index.js",
"./src/base/index.ts"
],
"default": [
"./dist/base/index.js",
"./src/base/index.ts"
]
},
"./components": {
"types": "./dist/components/index.d.ts",
"import": "./dist/components/index.js",
"default": "./dist/components/index.js"
"types": [
"./dist/components/index.d.ts",
"./src/components/index.ts"
],
"import": [
"./dist/components/index.js",
"./src/components/index.ts"
],
"default": [
"./dist/components/index.js",
"./src/components/index.ts"
]
},
"./hooks": {
"types": "./dist/hooks/index.d.ts",
"import": "./dist/hooks/index.js",
"default": "./dist/hooks/index.js"
"types": [
"./dist/hooks/index.d.ts",
"./src/hooks/index.ts"
],
"import": [
"./dist/hooks/index.js",
"./src/hooks/index.ts"
],
"default": [
"./dist/hooks/index.js",
"./src/hooks/index.ts"
]
},
"./i18n": {
"types": "./dist/i18n/index.d.ts",
"import": "./dist/i18n/index.js",
"default": "./dist/i18n/index.js"
"types": [
"./dist/i18n/index.d.ts",
"./src/i18n/index.ts"
],
"import": [
"./dist/i18n/index.js",
"./src/i18n/index.ts"
],
"default": [
"./dist/i18n/index.js",
"./src/i18n/index.ts"
]
},
"./idtype": {
"types": "./dist/idtype/index.d.ts",
"import": "./dist/idtype/index.js",
"default": "./dist/idtype/index.js"
"types": [
"./dist/idtype/index.d.ts",
"./src/idtype/index.ts"
],
"import": [
"./dist/idtype/index.js",
"./src/idtype/index.ts"
],
"default": [
"./dist/idtype/index.js",
"./src/idtype/index.ts"
]
},
"./plotly/full": {
"types": "./dist/plotly/full/index.d.ts",
"import": "./dist/plotly/full/index.js",
"default": "./dist/plotly/full/index.js"
"types": [
"./dist/plotly/full/index.d.ts",
"./src/plotly/full/index.ts"
],
"import": [
"./dist/plotly/full/index.js",
"./src/plotly/full/index.ts"
],
"default": [
"./dist/plotly/full/index.js",
"./src/plotly/full/index.ts"
]
},
"./plotly": {
"types": "./dist/plotly/index.d.ts",
"import": "./dist/plotly/index.js",
"default": "./dist/plotly/index.js"
"types": [
"./dist/plotly/index.d.ts",
"./src/plotly/index.tsx"
],
"import": [
"./dist/plotly/index.js",
"./src/plotly/index.tsx"
],
"default": [
"./dist/plotly/index.js",
"./src/plotly/index.tsx"
]
},
"./plugin": {
"types": "./dist/plugin/index.d.ts",
"import": "./dist/plugin/index.js",
"default": "./dist/plugin/index.js"
"types": [
"./dist/plugin/index.d.ts",
"./src/plugin/index.ts"
],
"import": [
"./dist/plugin/index.js",
"./src/plugin/index.ts"
],
"default": [
"./dist/plugin/index.js",
"./src/plugin/index.ts"
]
},
"./ranking": {
"types": "./dist/ranking/index.d.ts",
"import": "./dist/ranking/index.js",
"default": "./dist/ranking/index.js"
"types": [
"./dist/ranking/index.d.ts",
"./src/ranking/index.ts"
],
"import": [
"./dist/ranking/index.js",
"./src/ranking/index.ts"
],
"default": [
"./dist/ranking/index.js",
"./src/ranking/index.ts"
]
},
"./security": {
"types": "./dist/security/index.d.ts",
"import": "./dist/security/index.js",
"default": "./dist/security/index.js"
"types": [
"./dist/security/index.d.ts",
"./src/security/index.ts"
],
"import": [
"./dist/security/index.js",
"./src/security/index.ts"
],
"default": [
"./dist/security/index.js",
"./src/security/index.ts"
]
},
"./utils": {
"types": "./dist/utils/index.d.ts",
"import": "./dist/utils/index.js",
"default": "./dist/utils/index.js"
"types": [
"./dist/utils/index.d.ts",
"./src/utils/index.ts"
],
"import": [
"./dist/utils/index.js",
"./src/utils/index.ts"
],
"default": [
"./dist/utils/index.js",
"./src/utils/index.ts"
]
},
"./views": {
"types": "./dist/views/index.d.ts",
"import": "./dist/views/index.js",
"default": "./dist/views/index.js"
"types": [
"./dist/views/index.d.ts",
"./src/views/index.ts"
],
"import": [
"./dist/views/index.js",
"./src/views/index.ts"
],
"default": [
"./dist/views/index.js",
"./src/views/index.ts"
]
},
"./vis": {
"types": "./dist/vis/index.d.ts",
"import": "./dist/vis/index.js",
"default": "./dist/vis/index.js"
"types": [
"./dist/vis/index.d.ts",
"./src/vis/index.ts"
],
"import": [
"./dist/vis/index.js",
"./src/vis/index.ts"
],
"default": [
"./dist/vis/index.js",
"./src/vis/index.ts"
]
},
"./dist/scss/main.scss": "./dist/scss/main.scss",
"./phovea_registry": "./dist/phovea_registry.js",
"./phovea_registry": [
"./dist/phovea_registry.js",
"./src/phovea_registry.ts"
],
"./dist/scss/*": [
"./dist/scss/*",
"./src/scss/*"
],
"./package.json": "./package.json"
},
"files": [
Expand All @@ -121,7 +262,6 @@
"docs": "visyn_scripts docs",
"lint:fix": "visyn_scripts lint --fix",
"lint": "visyn_scripts lint",
"prepack": "yarn run build",
"predist": "yarn run lint && yarn run test && yarn run build",
"start:fast": "visyn_scripts start --env workspace_mode=single fast=true",
"start": "visyn_scripts start --env workspace_mode=single",
Expand All @@ -133,19 +273,20 @@
"chromatic": "npx chromatic --build-script-name storybook:build"
},
"dependencies": {
"@emotion/react": "^11.0.0",
"@fortawesome/fontawesome-free": "^6.1.1",
"@fortawesome/fontawesome-svg-core": "^6.1.2",
"@fortawesome/free-regular-svg-icons": "^6.1.2",
"@fortawesome/free-solid-svg-icons": "^6.1.2",
"@fortawesome/react-fontawesome": "^0.2.0",
"@mantine/core": "~6.0.19",
"@mantine/dates": "~6.0.19",
"@mantine/dropzone": "~6.0.19",
"@mantine/form": "~6.0.19",
"@mantine/hooks": "~6.0.19",
"@mantine/modals": "~6.0.19",
"@mantine/notifications": "~6.0.19",
"@mantine/styles": "~6.0.19",
"@mantine/tiptap": "~6.0.19",
"@types/d3-hexbin": "^0.2.3",
"@types/d3v7": "npm:@types/d3@^7.4.0",
"@types/plotly.js-dist-min": "^2.3.0",
Expand All @@ -161,8 +302,8 @@
"lineupjs": "4.9.0",
"lodash": "~4.17.20",
"plotly.js-dist-min": "~2.12.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"react-highlight-words": "^0.17.0",
"react-plotly.js": "^2.5.1",
"react-spring": "^9.7.1",
Expand Down Expand Up @@ -190,12 +331,6 @@
"storybook": "^7.0.12",
"storybook-addon-swc": "^1.1.9"
},
"resolutions": {
"@types/react": "~18.2.0",
"@types/react-dom": "~18.2.0",
"react": "~18.2.0",
"react-dom": "~18.2.0"
},
"visyn": {
"entries": {
"app": {
Expand Down
File renamed without changes.
12 changes: 7 additions & 5 deletions tests/exports.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { readdirSync, readFileSync } from 'fs';
import packageJson from '../package.json';

const NOT_EXPORTED_PACKAGES = ['assets', 'demo', 'locales', 'scss', 'stories'];
const ADDITIONAL_EXPORTS = ['.', './plotly/full', './dist/scss/main.scss', './phovea_registry', './package.json'];
const ADDITIONAL_EXPORTS = ['.', './plotly/full', './dist/scss/*', './phovea_registry', './package.json'];

describe('package.json exports', () => {
expect(packageJson.exports).toBeDefined();
Expand All @@ -32,14 +32,16 @@ describe('package.json exports', () => {
const exported = packageJson.exports[`./${p}`];
expect(exported).toBeDefined();
expect(Object.keys(exported)).toStrictEqual(['types', 'import', 'default']);
expect(exported.types).toBe(`./dist/${p}/index.d.ts`);
expect(exported.import).toBe(`./dist/${p}/index.js`);
expect(exported.default).toBe(`./dist/${p}/index.js`);
// Some packages are exported as .tsx
const extension = exported?.types[1]?.includes('.tsx') ? 'tsx' : 'ts';
expect(exported.types).toEqual([`./dist/${p}/index.d.ts`, `./src/${p}/index.${extension}`]);
expect(exported.import).toEqual([`./dist/${p}/index.js`, `./src/${p}/index.${extension}`]);
expect(exported.default).toEqual([`./dist/${p}/index.js`, `./src/${p}/index.${extension}`]);
expect(rootIndexTs).toBeFalsy();
});

it('exports the package.json and phovea_registry', () => {
expect(packageJson.exports['./phovea_registry']).toBe('./dist/phovea_registry.js');
expect(packageJson.exports['./phovea_registry']).toEqual(['./dist/phovea_registry.js', './src/phovea_registry.ts']);
expect(packageJson.exports['./package.json']).toBe('./package.json');
});
});

0 comments on commit 9b4d00a

Please sign in to comment.