Skip to content

Commit 3a4c77e

Browse files
authored
Merge pull request #14 from WTW-IM/fix-package-json
Correcting package.json exports
2 parents a49c3b8 + e9ddd26 commit 3a4c77e

19 files changed

+19335
-19589
lines changed

.eslintrc.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,7 @@ module.exports = {
2929
},
3030
},
3131
extends: baseExtends,
32-
ignorePatterns: [
33-
"dist/**/*",
34-
"jest.config*",
35-
"useScriptLoader/index.d.ts",
36-
"scriptloader-support/index.d.ts",
37-
],
32+
ignorePatterns: ["dist/**/*", "module/**/*", "jest.config*"],
3833
env: { es6: true },
3934
parserOptions: { ecmaVersion: 2021, sourceType: "module" },
4035
overrides: [

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
node_modules
22
dist
3+
module
34
npm-debug.log
45
.DS_Store
56
release/github-prerelease

.npmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

jest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default {
1212
// The glob patterns Jest uses to detect test files
1313
testRegex: ["/test/.*\\.(test|spec)\\.[jt]sx?"],
1414

15+
testEnvironment: "jsdom",
1516
// This configuration shows the Jest to the options so one can be passed to the testEnvironment
1617
testEnvironmentOptions: {
1718
resources: "usable",

module-tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"module": "es6",
5+
"target": "es6",
6+
"outDir": "./module"
7+
}
8+
}

package-lock.json

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

package.json

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,29 @@
22
"name": "scriptloader-component",
33
"version": "1.5.4",
44
"description": "A React Component for reacting to scripts loading.",
5-
"main": "dist/index.js",
6-
"module": "dist/index.js",
5+
"main": "module/index.js",
6+
"exports": {
7+
".": {
8+
"require": "dist/index.js",
9+
"default": "module/index.js"
10+
},
11+
"./*": {
12+
"require": "dist/*.js",
13+
"default": "module/*.js"
14+
}
15+
},
716
"files": [
817
"dist",
18+
"module",
919
"src",
1020
"scriptloader-support",
1121
"useScriptLoader"
1222
],
1323
"scripts": {
1424
"test": "eslint --quiet . && tsc --noEmit --project ./tsconfig.json && jest",
15-
"build": "npm run build:base && npm run build:useScriptLoader && npm run build:scriptloader-support",
16-
"build:base": "tsc --project ./tsconfig.json",
17-
"build:useScriptLoader": "tsc --project ./useScriptLoader/tsconfig.json",
18-
"build:scriptloader-support": "tsc --project ./scriptloader-support/tsconfig.json",
25+
"build": "npm run build:dist && npm run build:module",
26+
"build:dist": "tsc --project ./tsconfig.json",
27+
"build:module": "tsc --project ./module-tsconfig.json",
1928
"prepack": "npm run build"
2029
},
2130
"repository": {
@@ -53,25 +62,25 @@
5362
"react": ">=16"
5463
},
5564
"devDependencies": {
56-
"@babel/core": "^7.12.9",
57-
"@babel/preset-env": "^7.12.7",
58-
"@babel/preset-react": "^7.12.7",
59-
"@babel/preset-typescript": "^7.12.7",
65+
"@babel/core": "^7.20.5",
66+
"@babel/preset-env": "^7.20.2",
67+
"@babel/preset-react": "^7.18.6",
68+
"@babel/preset-typescript": "^7.18.6",
6069
"@commitlint/cli": "^11.0.0",
6170
"@commitlint/config-conventional": "^11.0.0",
62-
"@semantic-release/changelog": "^5.0.1",
63-
"@semantic-release/commit-analyzer": "^8.0.1",
64-
"@semantic-release/git": "^9.0.0",
65-
"@semantic-release/github": "^7.2.0",
66-
"@semantic-release/npm": "^7.0.8",
67-
"@semantic-release/release-notes-generator": "^9.0.1",
68-
"@testing-library/jest-dom": "^5.11.6",
71+
"@semantic-release/changelog": "^6.0.2",
72+
"@semantic-release/commit-analyzer": "^9.0.2",
73+
"@semantic-release/git": "^10.0.1",
74+
"@semantic-release/github": "^8.0.7",
75+
"@semantic-release/npm": "^9.0.1",
76+
"@semantic-release/release-notes-generator": "^10.0.3",
77+
"@testing-library/jest-dom": "^5.16.5",
6978
"@testing-library/react": "^13.4.0",
7079
"@types/node": "^14.14.9",
7180
"@types/react": "^18.0.18",
72-
"@typescript-eslint/eslint-plugin": "^4.8.2",
73-
"@typescript-eslint/parser": "^4.8.2",
74-
"babel-jest": "^26.6.3",
81+
"@typescript-eslint/eslint-plugin": "^5.45.0",
82+
"@typescript-eslint/parser": "^5.45.0",
83+
"babel-jest": "^29.3.1",
7584
"commitlint-config-eslint": "^1.0.0",
7685
"conventional-changelog-eslint": "^3.0.9",
7786
"debug": "^4.3.1",
@@ -83,18 +92,18 @@
8392
"fs-extra": "^9.0.1",
8493
"husky": "^4.3.0",
8594
"issue-parser": "^6.0.0",
86-
"jest": "^26.6.3",
87-
"jest-environment-jsdom": "^26.6.2",
95+
"jest": "^29.3.1",
96+
"jest-environment-jsdom": "^29.3.1",
8897
"lint-staged": "^10.5.2",
8998
"lodash": "^4.17.20",
90-
"msw": "^0.22.3",
99+
"msw": "^0.49.1",
91100
"octokit": "^1.0.0-hello-world",
92101
"p-filter": "^2.1.0",
93102
"prettier": "^2.2.0",
94103
"react": "^18.2.0",
95104
"react-dom": "^18.2.0",
96-
"semantic-release": "^17.3.0",
97-
"ts-node": "^9.0.0",
105+
"semantic-release": "^19.0.5",
106+
"ts-node": "^10.9.1",
98107
"typescript": "^4.1.3"
99108
}
100109
}

scriptloader-support/index.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

scriptloader-support/index.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

scriptloader-support/tsconfig.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)