Skip to content

Commit a40af4d

Browse files
dummdidummbenmccanngtm-nayan
authored
chore: unbundled esm (#8613)
- remove esm bundle step - introduce generated version.js because we can no longer use replace because we don't bundle esm - remove register hook, cjs compiler output and cjs runtime - keep umd compiler version for prettier/eslint/browser but without sourcemaps - move devdependencies to dependencies where necessary - various cleanup --------- Co-authored-by: Ben McCann <[email protected]> Co-authored-by: gtmnayan <[email protected]>
1 parent d658e70 commit a40af4d

29 files changed

+2887
-818
lines changed

.gitignore

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
node_modules
55
*.map
66
/src/compiler/compile/internal_exports.js
7+
/src/shared/version.js
78
/compiler.d.ts
8-
/compiler.*js
9-
/index.*js
10-
/ssr.*js
11-
/action
12-
/internal
13-
/store
14-
/easing
15-
/motion
16-
/transition
17-
/animate
9+
/compiler.cjs
10+
/index.d.ts
11+
/action.d.ts
12+
/internal.d.ts
13+
/store.d.ts
14+
/easing.d.ts
15+
/motion.d.ts
16+
/transition.d.ts
17+
/animate.d.ts
1818
/scratch/
1919
/test/*/samples/_
2020
/test/runtime/shards

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
/site
66
!/src
77
src/compiler/compile/internal_exports.js
8+
src/shared/version.js
89
!/test
910
/test/**/*.svelte
1011
/test/**/_expected*
1112
/test/**/_actual*
1213
/test/**/expected*
1314
/test/**/_output
1415
/types
16+
!rollup.config.js
1517
!vitest.config.js

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* **breaking** Bundlers must specify the `browser` condition when building a frontend bundle for the browser ([#8516](https://github.com/sveltejs/svelte/pull/8516))
88
* **breaking** Minimum supported vite-plugin-svelte version is now 2.1.1. SvelteKit users can upgrade to 1.15.9 or newer to ensure a compatible version ([#8516](https://github.com/sveltejs/svelte/pull/8516))
99
* **breaking** Minimum supported TypeScript version is now TypeScript 5 (it will likely work with lower versions, but we make no guarantees about that) ([#8488](https://github.com/sveltejs/svelte/pull/8488))
10+
* **breaking** Remove `svelte/register` hook, CJS runtime version and CJS compiler output ([#8613](https://github.com/sveltejs/svelte/pull/8613))
1011
* **breaking** Stricter types for `createEventDispatcher` (see PR for migration instructions) ([#7224](https://github.com/sveltejs/svelte/pull/7224))
1112
* **breaking** Stricter types for `Action` and `ActionReturn` (see PR for migration instructions) ([#7224](https://github.com/sveltejs/svelte/pull/7224))
1213
* **breaking** Stricter types for `onMount` - now throws a type error when returning a function asynchronously to catch potential mistakes around callback functions (see PR for migration instructions) ([#8136](https://github.com/sveltejs/svelte/pull/8136))

check_publish_env.js

Lines changed: 0 additions & 4 deletions
This file was deleted.
File renamed without changes.

elements/package.json

Lines changed: 0 additions & 3 deletions
This file was deleted.
File renamed without changes.

package.json

Lines changed: 39 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -3,78 +3,67 @@
33
"version": "4.0.0-next.0",
44
"description": "Cybernetically enhanced web apps",
55
"type": "module",
6-
"module": "index.mjs",
7-
"main": "index",
6+
"module": "src/runtime/index.js",
7+
"main": "src/runtime/index.js",
88
"files": [
9+
"src",
910
"types",
1011
"compiler.*",
1112
"register.js",
12-
"index.*",
13-
"ssr.*",
14-
"internal",
15-
"store",
16-
"animate",
17-
"transition",
18-
"easing",
19-
"motion",
20-
"action",
21-
"elements",
13+
"index.d.ts",
14+
"internal.d.ts",
15+
"store.d.ts",
16+
"animate.d.ts",
17+
"transition.d.ts",
18+
"easing.d.ts",
19+
"motion.d.ts",
20+
"action.d.ts",
21+
"elements.d.ts",
2222
"README.md"
2323
],
2424
"exports": {
2525
"./package.json": "./package.json",
2626
".": {
2727
"types": "./types/runtime/index.d.ts",
2828
"browser": {
29-
"import": "./index.mjs",
30-
"require": "./index.js"
29+
"import": "./src/runtime/index.js"
3130
},
32-
"import": "./ssr.mjs",
33-
"require": "./ssr.js"
31+
"import": "./src/runtime/ssr.js"
3432
},
3533
"./compiler": {
3634
"types": "./types/compiler/index.d.ts",
37-
"import": "./compiler.mjs",
38-
"require": "./compiler.js"
35+
"import": "./src/compiler/index.js",
36+
"require": "./compiler.cjs"
3937
},
4038
"./action": {
4139
"types": "./types/runtime/action/index.d.ts"
4240
},
4341
"./animate": {
4442
"types": "./types/runtime/animate/index.d.ts",
45-
"import": "./animate/index.mjs",
46-
"require": "./animate/index.js"
43+
"import": "./src/runtime/animate/index.js"
4744
},
4845
"./easing": {
4946
"types": "./types/runtime/easing/index.d.ts",
50-
"import": "./easing/index.mjs",
51-
"require": "./easing/index.js"
47+
"import": "./src/runtime/easing/index.js"
5248
},
5349
"./internal": {
5450
"types": "./types/runtime/internal/index.d.ts",
55-
"import": "./internal/index.mjs",
56-
"require": "./internal/index.js"
51+
"import": "./src/runtime/internal/index.js"
5752
},
5853
"./motion": {
5954
"types": "./types/runtime/motion/index.d.ts",
60-
"import": "./motion/index.mjs",
61-
"require": "./motion/index.js"
62-
},
63-
"./register": {
64-
"require": "./register.js"
55+
"import": "./src/runtime/motion/index.js"
6556
},
6657
"./store": {
6758
"types": "./types/runtime/store/index.d.ts",
68-
"import": "./store/index.mjs",
69-
"require": "./store/index.js"
59+
"import": "./src/runtime/store/index.js"
7060
},
7161
"./transition": {
7262
"types": "./types/runtime/transition/index.d.ts",
73-
"import": "./transition/index.mjs",
74-
"require": "./transition/index.js"
63+
"import": "./src/runtime/transition/index.js"
7564
},
7665
"./elements": {
77-
"types": "./elements/index.d.ts"
66+
"types": "./elements.d.ts"
7867
}
7968
},
8069
"engines": {
@@ -88,9 +77,9 @@
8877
"build": "rollup -c && npm run tsd",
8978
"prepare": "npm run build",
9079
"dev": "rollup -cw",
91-
"posttest": "agadoo internal/index.mjs",
92-
"prepublishOnly": "node check_publish_env.js && npm run lint && npm run build && npm test",
93-
"tsd": "node ./generate-types.mjs",
80+
"posttest": "agadoo src/internal/index.js",
81+
"prepublishOnly": "npm run lint && npm run build && npm test",
82+
"tsd": "node ./generate-types.js",
9483
"lint": "eslint \"{src,test}/**/*.{ts,js}\" --cache"
9584
},
9685
"repository": {
@@ -109,50 +98,45 @@
10998
"url": "https://github.com/sveltejs/svelte/issues"
11099
},
111100
"homepage": "https://svelte.dev",
112-
"devDependencies": {
101+
"dependencies": {
113102
"@ampproject/remapping": "^2.2.1",
114103
"@jridgewell/sourcemap-codec": "^1.4.15",
104+
"acorn": "^8.8.2",
105+
"aria-query": "^5.1.3",
106+
"axobject-query": "^3.1.1",
107+
"code-red": "^1.0.0",
108+
"css-tree": "^2.3.1",
109+
"estree-walker": "^3.0.3",
110+
"is-reference": "^3.0.1",
111+
"locate-character": "^2.0.5",
112+
"magic-string": "^0.30.0",
113+
"periscopic": "^3.1.0"
114+
},
115+
"devDependencies": {
115116
"@playwright/test": "^1.33.0",
116117
"@rollup/plugin-commonjs": "^24.1.0",
117118
"@rollup/plugin-json": "^6.0.0",
118119
"@rollup/plugin-node-resolve": "^15.0.2",
119120
"@rollup/plugin-replace": "^5.0.2",
120-
"@rollup/plugin-sucrase": "^5.0.1",
121-
"@rollup/plugin-typescript": "^11.1.0",
122-
"@rollup/plugin-virtual": "^3.0.1",
123121
"@sveltejs/eslint-config": "^6.0.1",
124122
"@types/aria-query": "^5.0.1",
125123
"@types/estree": "^1.0.0",
126-
"@types/mocha": "^10.0.1",
127124
"@types/node": "^14.14.31",
128125
"@typescript-eslint/eslint-plugin": "^5.58.0",
129-
"acorn": "^8.8.2",
130126
"agadoo": "^3.0.0",
131-
"aria-query": "^5.1.3",
132-
"axobject-query": "^3.1.1",
133-
"code-red": "^1.0.0",
134-
"css-tree": "^2.3.1",
135127
"esbuild": "^0.17.19",
136128
"eslint": "^8.40.0",
137-
"eslint-config-prettier": "^8.8.0",
138129
"eslint-plugin-import": "^2.27.5",
139130
"eslint-plugin-svelte": "^2.28.0",
140131
"eslint-plugin-unicorn": "^47.0.0",
141-
"estree-walker": "^3.0.3",
142132
"happy-dom": "^9.18.3",
143-
"is-reference": "^3.0.1",
144133
"jsdom": "^21.1.1",
145134
"kleur": "^4.1.5",
146-
"locate-character": "^2.0.5",
147-
"magic-string": "^0.30.0",
148-
"periscopic": "^3.1.0",
149135
"prettier": "^2.8.8",
150136
"prettier-plugin-svelte": "^2.10.0",
151137
"rollup": "^3.20.2",
152-
"rollup-plugin-dts": "^5.3.0",
153138
"source-map": "^0.7.4",
154139
"tiny-glob": "^0.2.9",
155-
"tslib": "^2.5.0",
156140
"typescript": "^5.0.4",
157141
"util": "^0.12.5",
158142
"vitest": "^0.31.1"

0 commit comments

Comments
 (0)