@rsvelte/cli 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Yuichiro Yamashita
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,63 @@
1
- # Temporary Holding Version
1
+ # rsvelte
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ rsvelte lints, formats and type checks Svelte 5 and TypeScript files with native programs
4
+ built from Rust. This release is experimental.
5
+
6
+ ## Install
7
+
8
+ ```sh
9
+ npm install --save-dev @rsvelte/cli
10
+ ```
11
+
12
+ ## Use
13
+
14
+ ```sh
15
+ npx @rsvelte/cli lint [<path>...]
16
+ npx @rsvelte/cli format [<path>...] [--check]
17
+ npx @rsvelte/cli typecheck
18
+ ```
19
+
20
+ `npx` runs the project's copy, or downloads one when the project has none. In `package.json`
21
+ scripts, the command is `rsvelte`:
22
+
23
+ ```json
24
+ {
25
+ "scripts": {
26
+ "lint": "rsvelte lint",
27
+ "format": "rsvelte format",
28
+ "typecheck": "rsvelte typecheck"
29
+ }
30
+ }
31
+ ```
32
+
33
+ Without a path, `lint` and `format` read every file below the current directory, except
34
+ `node_modules`. `format` writes the files it changes. With `--check`, it lists them and
35
+ writes nothing.
36
+
37
+ `typecheck` checks the project of `tsconfig.json` in the current directory and reports the
38
+ type errors that svelte-check reports. It runs a TypeScript 7 type checker from the project's
39
+ `node_modules`. Install one of these:
40
+
41
+ - [tsrs](https://www.npmjs.com/package/tsrs) (recommended): `npm install --save-dev tsrs`
42
+ - TypeScript 7.1 or newer (`typescript`, or `@typescript/native-preview`)
43
+
44
+ Each command exits with 1 when it finds an error, and with 2 when it cannot run.
45
+
46
+ ## Configure
47
+
48
+ rsvelte reads `rsvelte.config.json` (or `.js`, `.ts` and the other module extensions) from
49
+ the current directory or the nearest parent directory that has one. Each plugin reads its
50
+ options from `plugins`:
51
+
52
+ ```json
53
+ {
54
+ "plugins": {
55
+ "svelte.lint": { "rules": { "no-unused-vars": "warn" } },
56
+ "typescript.check": { "tsconfig": "tsconfig.app.json" }
57
+ }
58
+ }
59
+ ```
60
+
61
+ ## License
62
+
63
+ MIT
package/bin/rsvelte.js ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ // Starts the rsvelte program that npm installed for this machine, with the same arguments, and
3
+ // exits as it does. The package of each platform is in platforms.json beside this directory.
4
+ import { spawnSync } from 'node:child_process';
5
+ import { readFileSync } from 'node:fs';
6
+ import { createRequire } from 'node:module';
7
+
8
+ const require = createRequire(import.meta.url);
9
+ const platforms = JSON.parse(readFileSync(new URL('../platforms.json', import.meta.url), 'utf8'));
10
+ const platform = `${process.platform}-${process.arch}`;
11
+ const name = platforms[platform];
12
+ if (!name) {
13
+ console.error(`rsvelte: there is no build for ${platform}`);
14
+ process.exit(1);
15
+ }
16
+ let program;
17
+ try {
18
+ program = require.resolve(`${name}/rsvelte${process.platform === 'win32' ? '.exe' : ''}`);
19
+ } catch {
20
+ console.error(
21
+ `rsvelte: ${name} is not installed; install @rsvelte/cli again, with optional dependencies`,
22
+ );
23
+ process.exit(1);
24
+ }
25
+ const run = spawnSync(program, process.argv.slice(2), { stdio: 'inherit' });
26
+ if (run.error) {
27
+ console.error(`rsvelte: ${program}: ${run.error.message}`);
28
+ process.exit(1);
29
+ }
30
+ if (run.signal) process.kill(process.pid, run.signal);
31
+ process.exit(run.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
- "name": "@rsvelte/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
2
+ "name": "@rsvelte/cli",
3
+ "version": "0.1.0",
4
+ "description": "Lint, format and type check Svelte and TypeScript, fast",
5
+ "keywords": [
6
+ "svelte",
7
+ "lint",
8
+ "format",
9
+ "typecheck",
10
+ "typescript"
11
+ ],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/baseballyama/rsvelte.git"
16
+ },
17
+ "type": "module",
18
+ "bin": {
19
+ "rsvelte": "bin/rsvelte.js"
20
+ },
21
+ "files": [
22
+ "bin",
23
+ "platforms.json"
24
+ ],
25
+ "engines": {
26
+ "node": ">=18"
27
+ },
28
+ "optionalDependencies": {
29
+ "@rsvelte/cli-darwin-arm64": "0.1.0",
30
+ "@rsvelte/cli-darwin-x64": "0.1.0",
31
+ "@rsvelte/cli-linux-arm64-gnu": "0.1.0",
32
+ "@rsvelte/cli-linux-x64-gnu": "0.1.0",
33
+ "@rsvelte/cli-win32-x64-msvc": "0.1.0"
34
+ },
35
+ "peerDependencies": {
36
+ "tsrs": ">=7.1.0-beta.tsrs2 <7.2.0"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "tsrs": {
40
+ "optional": true
41
+ }
42
+ }
43
+ }
package/platforms.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "darwin-arm64": "@rsvelte/cli-darwin-arm64",
3
+ "darwin-x64": "@rsvelte/cli-darwin-x64",
4
+ "linux-arm64": "@rsvelte/cli-linux-arm64-gnu",
5
+ "linux-x64": "@rsvelte/cli-linux-x64-gnu",
6
+ "win32-x64": "@rsvelte/cli-win32-x64-msvc"
7
+ }