mirror of https://github.com/sveltejs/svelte
parent
4cde4eaada
commit
bd51e6f3ea
@ -1,145 +1,31 @@
|
|||||||
{
|
{
|
||||||
"name": "svelte",
|
"name": "svelte-monorepo",
|
||||||
"version": "4.0.0-next.0",
|
"version": "0.0.1",
|
||||||
"description": "Cybernetically enhanced web apps",
|
"description": "monorepo for svelte and friends",
|
||||||
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"module": "src/runtime/index.js",
|
|
||||||
"main": "src/runtime/index.js",
|
|
||||||
"files": [
|
|
||||||
"src",
|
|
||||||
"types",
|
|
||||||
"compiler.*",
|
|
||||||
"register.js",
|
|
||||||
"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": "./src/runtime/index.js"
|
|
||||||
},
|
|
||||||
"import": "./src/runtime/ssr.js"
|
|
||||||
},
|
|
||||||
"./compiler": {
|
|
||||||
"types": "./types/compiler/index.d.ts",
|
|
||||||
"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": "./src/runtime/animate/index.js"
|
|
||||||
},
|
|
||||||
"./easing": {
|
|
||||||
"types": "./types/runtime/easing/index.d.ts",
|
|
||||||
"import": "./src/runtime/easing/index.js"
|
|
||||||
},
|
|
||||||
"./internal": {
|
|
||||||
"types": "./types/runtime/internal/index.d.ts",
|
|
||||||
"import": "./src/runtime/internal/index.js"
|
|
||||||
},
|
|
||||||
"./motion": {
|
|
||||||
"types": "./types/runtime/motion/index.d.ts",
|
|
||||||
"import": "./src/runtime/motion/index.js"
|
|
||||||
},
|
|
||||||
"./store": {
|
|
||||||
"types": "./types/runtime/store/index.d.ts",
|
|
||||||
"import": "./src/runtime/store/index.js"
|
|
||||||
},
|
|
||||||
"./transition": {
|
|
||||||
"types": "./types/runtime/transition/index.d.ts",
|
|
||||||
"import": "./src/runtime/transition/index.js"
|
|
||||||
},
|
|
||||||
"./elements": {
|
|
||||||
"types": "./elements.d.ts"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=16"
|
|
||||||
},
|
|
||||||
"types": "types/runtime/index.d.ts",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"format:fix": "prettier . --cache --plugin-search-dir=. --write",
|
"test": "pnpm test -r --filter=./packages/*",
|
||||||
"format:check": "prettier . --cache --plugin-search-dir=. --check",
|
"build": "pnpm -r build",
|
||||||
"test": "vitest run && echo \"manually check that there are no type errors in test/types by opening the files in there\"",
|
"check": "pnpm -r check",
|
||||||
"build": "rollup -c && npm run tsd",
|
"lint": "pnpm -r lint",
|
||||||
"prepare": "npm run build",
|
"format": "pnpm -r format"
|
||||||
"dev": "rollup -cw",
|
|
||||||
"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": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sveltejs/svelte.git"
|
"url": "git+https://github.com/sveltejs/svelte.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
|
||||||
"UI",
|
|
||||||
"framework",
|
|
||||||
"templates",
|
|
||||||
"templating"
|
|
||||||
],
|
|
||||||
"author": "Rich Harris",
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/sveltejs/svelte/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://svelte.dev",
|
|
||||||
"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": {
|
"devDependencies": {
|
||||||
"@playwright/test": "^1.33.0",
|
"@changesets/cli": "^2.26.0",
|
||||||
"@rollup/plugin-commonjs": "^24.1.0",
|
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
|
||||||
"@rollup/plugin-json": "^6.0.0",
|
|
||||||
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
||||||
"@rollup/plugin-replace": "^5.0.2",
|
|
||||||
"@sveltejs/eslint-config": "^6.0.1",
|
|
||||||
"@types/aria-query": "^5.0.1",
|
|
||||||
"@types/estree": "^1.0.0",
|
|
||||||
"@types/node": "^14.14.31",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
||||||
"agadoo": "^3.0.0",
|
|
||||||
"esbuild": "^0.17.19",
|
|
||||||
"eslint": "^8.40.0",
|
"eslint": "^8.40.0",
|
||||||
"eslint-plugin-import": "^2.27.5",
|
"eslint-plugin-import": "^2.27.5",
|
||||||
"eslint-plugin-svelte": "^2.28.0",
|
"eslint-plugin-svelte": "^2.28.0",
|
||||||
"eslint-plugin-unicorn": "^47.0.0",
|
"eslint-plugin-unicorn": "^47.0.0",
|
||||||
"happy-dom": "^9.18.3",
|
"playwright": "^1.34.3",
|
||||||
"jsdom": "^21.1.1",
|
|
||||||
"kleur": "^4.1.5",
|
|
||||||
"prettier": "^2.8.8",
|
"prettier": "^2.8.8",
|
||||||
"prettier-plugin-svelte": "^2.10.0",
|
"prettier-plugin-svelte": "^2.10.0"
|
||||||
"rollup": "^3.20.2",
|
|
||||||
"source-map": "^0.7.4",
|
|
||||||
"tiny-glob": "^0.2.9",
|
|
||||||
"typescript": "^5.0.4",
|
|
||||||
"util": "^0.12.5",
|
|
||||||
"vitest": "^0.31.1"
|
|
||||||
},
|
},
|
||||||
"packageManager": "pnpm@8.4.0"
|
"packageManager": "pnpm@8.4.0"
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
*.map
|
||||||
|
/src/compiler/compile/internal_exports.js
|
||||||
|
/src/shared/version.js
|
||||||
|
/compiler.d.ts
|
||||||
|
/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
|
||||||
|
_actual*.*
|
||||||
|
_output
|
||||||
|
/types
|
@ -0,0 +1,38 @@
|
|||||||
|
[](https://svelte.dev)
|
||||||
|
|
||||||
|
|
||||||
|
[](https://www.npmjs.com/package/svelte) [](LICENSE.md) [](https://svelte.dev/chat)
|
||||||
|
|
||||||
|
|
||||||
|
## What is Svelte?
|
||||||
|
|
||||||
|
Svelte is a new way to build web applications. It's a compiler that takes your declarative components and converts them into efficient JavaScript that surgically updates the DOM.
|
||||||
|
|
||||||
|
Learn more at the [Svelte website](https://svelte.dev), or stop by the [Discord chatroom](https://svelte.dev/chat).
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
You can play around with Svelte in the [tutorial](https://learn.svelte.dev/), [examples](https://svelte.dev/examples), and [REPL](https://svelte.dev/repl).
|
||||||
|
|
||||||
|
When you're ready to build a full-fledge application, we recommend using [SvelteKit](https://kit.svelte.dev):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm create svelte@latest my-app
|
||||||
|
cd my-app
|
||||||
|
npm install
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
See [the SvelteKit documentation](https://kit.svelte.dev/docs) to learn more.
|
||||||
|
|
||||||
|
## Changelog
|
||||||
|
|
||||||
|
[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/master/packages/kit/CHANGELOG.md).
|
||||||
|
|
||||||
|
## Supporting Svelte
|
||||||
|
|
||||||
|
Svelte is an MIT-licensed open source project with its ongoing development made possible entirely by fantastic volunteers. If you'd like to support their efforts, please consider:
|
||||||
|
|
||||||
|
- [Becoming a backer on Open Collective](https://opencollective.com/svelte).
|
||||||
|
|
||||||
|
Funds donated via Open Collective will be used for compensating expenses related to Svelte's development.
|
@ -0,0 +1,139 @@
|
|||||||
|
{
|
||||||
|
"name": "svelte",
|
||||||
|
"version": "4.0.0-next.0",
|
||||||
|
"description": "Cybernetically enhanced web apps",
|
||||||
|
"type": "module",
|
||||||
|
"module": "src/runtime/index.js",
|
||||||
|
"main": "src/runtime/index.js",
|
||||||
|
"files": [
|
||||||
|
"src",
|
||||||
|
"types",
|
||||||
|
"compiler.*",
|
||||||
|
"register.js",
|
||||||
|
"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": "./src/runtime/index.js"
|
||||||
|
},
|
||||||
|
"import": "./src/runtime/ssr.js"
|
||||||
|
},
|
||||||
|
"./compiler": {
|
||||||
|
"types": "./types/compiler/index.d.ts",
|
||||||
|
"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": "./src/runtime/animate/index.js"
|
||||||
|
},
|
||||||
|
"./easing": {
|
||||||
|
"types": "./types/runtime/easing/index.d.ts",
|
||||||
|
"import": "./src/runtime/easing/index.js"
|
||||||
|
},
|
||||||
|
"./internal": {
|
||||||
|
"types": "./types/runtime/internal/index.d.ts",
|
||||||
|
"import": "./src/runtime/internal/index.js"
|
||||||
|
},
|
||||||
|
"./motion": {
|
||||||
|
"types": "./types/runtime/motion/index.d.ts",
|
||||||
|
"import": "./src/runtime/motion/index.js"
|
||||||
|
},
|
||||||
|
"./store": {
|
||||||
|
"types": "./types/runtime/store/index.d.ts",
|
||||||
|
"import": "./src/runtime/store/index.js"
|
||||||
|
},
|
||||||
|
"./transition": {
|
||||||
|
"types": "./types/runtime/transition/index.d.ts",
|
||||||
|
"import": "./src/runtime/transition/index.js"
|
||||||
|
},
|
||||||
|
"./elements": {
|
||||||
|
"types": "./elements.d.ts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16"
|
||||||
|
},
|
||||||
|
"types": "types/runtime/index.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
"format": "prettier . --cache --plugin-search-dir=. --write",
|
||||||
|
"check": "prettier . --cache --plugin-search-dir=. --check",
|
||||||
|
"test": "vitest run && echo \"manually check that there are no type errors in test/types by opening the files in there\"",
|
||||||
|
"build": "rollup -c && npm run tsd",
|
||||||
|
"prepare": "npm run build",
|
||||||
|
"dev": "rollup -cw",
|
||||||
|
"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": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/sveltejs/svelte.git",
|
||||||
|
"directory":"packages/svelte"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"UI",
|
||||||
|
"framework",
|
||||||
|
"templates",
|
||||||
|
"templating"
|
||||||
|
],
|
||||||
|
"author": "Rich Harris",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/sveltejs/svelte/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://svelte.dev",
|
||||||
|
"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.34.3",
|
||||||
|
"@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",
|
||||||
|
"@sveltejs/eslint-config": "^6.0.1",
|
||||||
|
"@types/aria-query": "^5.0.1",
|
||||||
|
"@types/estree": "^1.0.1",
|
||||||
|
"@types/node": "^14.14.31",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
||||||
|
"agadoo": "^3.0.0",
|
||||||
|
"esbuild": "^0.17.19",
|
||||||
|
"happy-dom": "^9.18.3",
|
||||||
|
"jsdom": "^21.1.1",
|
||||||
|
"kleur": "^4.1.5",
|
||||||
|
"rollup": "^3.20.2",
|
||||||
|
"source-map": "^0.7.4",
|
||||||
|
"tiny-glob": "^0.2.9",
|
||||||
|
"typescript": "^5.0.4",
|
||||||
|
"util": "^0.12.5",
|
||||||
|
"vitest": "^0.31.1"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
// Compile all Svelte files in a directory to JS and CSS files
|
||||||
|
// Usage: node scripts/compile-test.js <directory>
|
||||||
|
|
||||||
|
import { mkdirSync, readFileSync, writeFileSync } from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
import glob from 'tiny-glob/sync.js';
|
||||||
|
import { compile } from '../src/compiler/index.js';
|
||||||
|
|
||||||
|
const cwd = path.resolve(process.argv[2]);
|
||||||
|
|
||||||
|
const options = [
|
||||||
|
['normal', {}],
|
||||||
|
['hydrate', { hydratable: true }],
|
||||||
|
['ssr', { generate: 'ssr' }]
|
||||||
|
];
|
||||||
|
for (const file of glob('**/*.svelte', { cwd })) {
|
||||||
|
const contents = readFileSync(`${cwd}/${file}`, 'utf-8').replace(/\r/g, '');
|
||||||
|
let w;
|
||||||
|
for (const [name, opts] of options) {
|
||||||
|
const dir = `${cwd}/_output/${name}`;
|
||||||
|
|
||||||
|
const { js, css, warnings } = compile(contents, {
|
||||||
|
...opts,
|
||||||
|
filename: file
|
||||||
|
});
|
||||||
|
|
||||||
|
if (warnings.length) {
|
||||||
|
w = warnings;
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdirSync(dir, { recursive: true });
|
||||||
|
js.code && writeFileSync(`${dir}/${file.replace(/\.svelte$/, '.js')}`, js.code);
|
||||||
|
css.code && writeFileSync(`${dir}/${file.replace(/\.svelte$/, '.css')}`, css.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (w) {
|
||||||
|
console.log(`Warnings for ${file}:`);
|
||||||
|
console.log(w);
|
||||||
|
}
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue