Skip to content

Commit

Permalink
chore: unbundled esm (#8613)
Browse files Browse the repository at this point in the history
- 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 <322311+benmccann@users.noreply.github.com>
Co-authored-by: gtmnayan <50981692+gtm-nayan@users.noreply.github.com>
  • Loading branch information
3 people committed May 24, 2023
1 parent d658e70 commit a40af4d
Show file tree
Hide file tree
Showing 29 changed files with 2,887 additions and 818 deletions.
20 changes: 10 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
node_modules
*.map
/src/compiler/compile/internal_exports.js
/src/shared/version.js
/compiler.d.ts
/compiler.*js
/index.*js
/ssr.*js
/action
/internal
/store
/easing
/motion
/transition
/animate
/compiler.cjs
/index.d.ts
/action.d.ts
/internal.d.ts
/store.d.ts
/easing.d.ts
/motion.d.ts
/transition.d.ts
/animate.d.ts
/scratch/
/test/*/samples/_
/test/runtime/shards
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
/site
!/src
src/compiler/compile/internal_exports.js
src/shared/version.js
!/test
/test/**/*.svelte
/test/**/_expected*
/test/**/_actual*
/test/**/expected*
/test/**/_output
/types
!rollup.config.js
!vitest.config.js
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* **breaking** Bundlers must specify the `browser` condition when building a frontend bundle for the browser ([#8516](https://github.com/sveltejs/svelte/pull/8516))
* **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))
* **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))
* **breaking** Remove `svelte/register` hook, CJS runtime version and CJS compiler output ([#8613](https://github.com/sveltejs/svelte/pull/8613))
* **breaking** Stricter types for `createEventDispatcher` (see PR for migration instructions) ([#7224](https://github.com/sveltejs/svelte/pull/7224))
* **breaking** Stricter types for `Action` and `ActionReturn` (see PR for migration instructions) ([#7224](https://github.com/sveltejs/svelte/pull/7224))
* **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))
Expand Down
4 changes: 0 additions & 4 deletions check_publish_env.js

This file was deleted.

File renamed without changes.
3 changes: 0 additions & 3 deletions elements/package.json

This file was deleted.

File renamed without changes.
94 changes: 39 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,67 @@
"version": "4.0.0-next.0",
"description": "Cybernetically enhanced web apps",
"type": "module",
"module": "index.mjs",
"main": "index",
"module": "src/runtime/index.js",
"main": "src/runtime/index.js",
"files": [
"src",
"types",
"compiler.*",
"register.js",
"index.*",
"ssr.*",
"internal",
"store",
"animate",
"transition",
"easing",
"motion",
"action",
"elements",
"index.d.ts",
"internal.d.ts",
"store.d.ts",
"animate.d.ts",
"transition.d.ts",
"easing.d.ts",
"motion.d.ts",
"action.d.ts",
"elements.d.ts",
"README.md"
],
"exports": {
"./package.json": "./package.json",
".": {
"types": "./types/runtime/index.d.ts",
"browser": {
"import": "./index.mjs",
"require": "./index.js"
"import": "./src/runtime/index.js"
},
"import": "./ssr.mjs",
"require": "./ssr.js"
"import": "./src/runtime/ssr.js"
},
"./compiler": {
"types": "./types/compiler/index.d.ts",
"import": "./compiler.mjs",
"require": "./compiler.js"
"import": "./src/compiler/index.js",
"require": "./compiler.cjs"
},
"./action": {
"types": "./types/runtime/action/index.d.ts"
},
"./animate": {
"types": "./types/runtime/animate/index.d.ts",
"import": "./animate/index.mjs",
"require": "./animate/index.js"
"import": "./src/runtime/animate/index.js"
},
"./easing": {
"types": "./types/runtime/easing/index.d.ts",
"import": "./easing/index.mjs",
"require": "./easing/index.js"
"import": "./src/runtime/easing/index.js"
},
"./internal": {
"types": "./types/runtime/internal/index.d.ts",
"import": "./internal/index.mjs",
"require": "./internal/index.js"
"import": "./src/runtime/internal/index.js"
},
"./motion": {
"types": "./types/runtime/motion/index.d.ts",
"import": "./motion/index.mjs",
"require": "./motion/index.js"
},
"./register": {
"require": "./register.js"
"import": "./src/runtime/motion/index.js"
},
"./store": {
"types": "./types/runtime/store/index.d.ts",
"import": "./store/index.mjs",
"require": "./store/index.js"
"import": "./src/runtime/store/index.js"
},
"./transition": {
"types": "./types/runtime/transition/index.d.ts",
"import": "./transition/index.mjs",
"require": "./transition/index.js"
"import": "./src/runtime/transition/index.js"
},
"./elements": {
"types": "./elements/index.d.ts"
"types": "./elements.d.ts"
}
},
"engines": {
Expand All @@ -88,9 +77,9 @@
"build": "rollup -c && npm run tsd",
"prepare": "npm run build",
"dev": "rollup -cw",
"posttest": "agadoo internal/index.mjs",
"prepublishOnly": "node check_publish_env.js && npm run lint && npm run build && npm test",
"tsd": "node ./generate-types.mjs",
"posttest": "agadoo src/internal/index.js",
"prepublishOnly": "npm run lint && npm run build && npm test",
"tsd": "node ./generate-types.js",
"lint": "eslint \"{src,test}/**/*.{ts,js}\" --cache"
},
"repository": {
Expand All @@ -109,50 +98,45 @@
"url": "https://github.com/sveltejs/svelte/issues"
},
"homepage": "https://svelte.dev",
"devDependencies": {
"dependencies": {
"@ampproject/remapping": "^2.2.1",
"@jridgewell/sourcemap-codec": "^1.4.15",
"acorn": "^8.8.2",
"aria-query": "^5.1.3",
"axobject-query": "^3.1.1",
"code-red": "^1.0.0",
"css-tree": "^2.3.1",
"estree-walker": "^3.0.3",
"is-reference": "^3.0.1",
"locate-character": "^2.0.5",
"magic-string": "^0.30.0",
"periscopic": "^3.1.0"
},
"devDependencies": {
"@playwright/test": "^1.33.0",
"@rollup/plugin-commonjs": "^24.1.0",
"@rollup/plugin-json": "^6.0.0",
"@rollup/plugin-node-resolve": "^15.0.2",
"@rollup/plugin-replace": "^5.0.2",
"@rollup/plugin-sucrase": "^5.0.1",
"@rollup/plugin-typescript": "^11.1.0",
"@rollup/plugin-virtual": "^3.0.1",
"@sveltejs/eslint-config": "^6.0.1",
"@types/aria-query": "^5.0.1",
"@types/estree": "^1.0.0",
"@types/mocha": "^10.0.1",
"@types/node": "^14.14.31",
"@typescript-eslint/eslint-plugin": "^5.58.0",
"acorn": "^8.8.2",
"agadoo": "^3.0.0",
"aria-query": "^5.1.3",
"axobject-query": "^3.1.1",
"code-red": "^1.0.0",
"css-tree": "^2.3.1",
"esbuild": "^0.17.19",
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-svelte": "^2.28.0",
"eslint-plugin-unicorn": "^47.0.0",
"estree-walker": "^3.0.3",
"happy-dom": "^9.18.3",
"is-reference": "^3.0.1",
"jsdom": "^21.1.1",
"kleur": "^4.1.5",
"locate-character": "^2.0.5",
"magic-string": "^0.30.0",
"periscopic": "^3.1.0",
"prettier": "^2.8.8",
"prettier-plugin-svelte": "^2.10.0",
"rollup": "^3.20.2",
"rollup-plugin-dts": "^5.3.0",
"source-map": "^0.7.4",
"tiny-glob": "^0.2.9",
"tslib": "^2.5.0",
"typescript": "^5.0.4",
"util": "^0.12.5",
"vitest": "^0.31.1"
Expand Down

0 comments on commit a40af4d

Please sign in to comment.