@krate/core 0.5.0-alpha.3 → 0.5.0-alpha.4

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/README.md CHANGED
@@ -21,6 +21,14 @@ krate dev # dev server with hot reload
21
21
  krate serve # build, then serve for preview
22
22
  krate types # generate route/content TypeScript declarations
23
23
  krate check # run quality gates (a11y/SEO/perf)
24
+ krate fix # apply safe source fixes
25
+ krate migrate # plan or apply a framework migration
26
+ krate inspect # print the compiled site model
27
+ krate deploy # build and write host adapter files
28
+ krate clean # remove build output and caches
29
+ krate doctor # print a diagnostic summary
30
+ krate config # print the resolved configuration
31
+ krate go:init # set up Go module helpers
24
32
  krate plugin add <package>
25
33
  krate mcp # MCP server for editors/agents
26
34
  krate version
package/bin/krate CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/bin/krate
3
- size: 39817481 bytes
4
- sha256: 5964db33a2ac7d4a1ce6f238465b2c850f12f787445930f38768f879ef0f59f7
3
+ size: 40521993 bytes
4
+ sha256: f2aae62228abdbe3eada4aa0605dac41f6df4eb71320b0b5c199e1016fcaf054
@@ -1 +1 @@
1
- {"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":"AAcA,wBAAgB,aAAa,IAAI,MAAM,CAiBtC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAetE"}
1
+ {"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../src/binary.ts"],"names":[],"mappings":"AAcA,wBAAgB,aAAa,IAAI,MAAM,CAqBtC;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBtE"}
package/dist/binary.js CHANGED
@@ -10,6 +10,10 @@ function binaryName() {
10
10
  return process.platform === 'win32' ? 'krate.exe' : 'krate';
11
11
  }
12
12
  export function resolveBinary() {
13
+ // Explicit override for tests and custom deployments.
14
+ const override = process.env.KRATE_BINARY;
15
+ if (override && existsSync(override))
16
+ return override;
13
17
  const pkgName = `@krate/core-${process.platform}-${process.arch}`;
14
18
  try {
15
19
  const pkgPath = dirname(require.resolve(`${pkgName}/package.json`));
@@ -38,8 +42,11 @@ export function execBinary(args, cwd) {
38
42
  proc.on('close', (code) => {
39
43
  if (code === 0)
40
44
  resolve();
41
- else
42
- reject(new Error(`krate exited with code ${code}`));
45
+ else {
46
+ const err = new Error(`krate exited with code ${code}`);
47
+ err.exitCode = code ?? 1;
48
+ reject(err);
49
+ }
43
50
  });
44
51
  proc.on('error', (err) => {
45
52
  reject(new Error(`Failed to run krate binary: ${err.message}`));
package/dist/cli.js CHANGED
@@ -11,16 +11,16 @@ const version = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), '
11
11
  function scaffold(args) {
12
12
  return new Promise((resolve, reject) => {
13
13
  const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
14
- const npxArgs = ['--yes', 'create-krate-app@latest'];
15
- const dir = args[1];
16
- if (dir)
17
- npxArgs.push(dir);
14
+ const npxArgs = ['--yes', 'create-krate-app@latest', ...args.slice(1)];
18
15
  const proc = spawn(npxCmd, npxArgs, { stdio: 'inherit' });
19
16
  proc.on('close', (code) => {
20
17
  if (code === 0)
21
18
  resolve();
22
- else
23
- reject(new Error(`create-krate-app exited with code ${code}`));
19
+ else {
20
+ const err = new Error(`create-krate-app exited with code ${code}`);
21
+ err.exitCode = code ?? 1;
22
+ reject(err);
23
+ }
24
24
  });
25
25
  proc.on('error', (err) => {
26
26
  reject(new Error(`Failed to run create-krate-app: ${err.message}`));
@@ -38,6 +38,14 @@ async function main() {
38
38
  console.log(' serve Build and serve for preview');
39
39
  console.log(' types Generate route/content TypeScript declarations');
40
40
  console.log(' check Run compiler-enforced quality gates (a11y/SEO/perf)');
41
+ console.log(' fix Apply safe source fixes');
42
+ console.log(' migrate Plan or apply a framework migration');
43
+ console.log(' inspect Print the compiled site model');
44
+ console.log(' deploy Build and write host adapter files');
45
+ console.log(' clean Remove build output and caches');
46
+ console.log(' doctor Print a diagnostic summary');
47
+ console.log(' config Print the resolved configuration');
48
+ console.log(' go:init Set up Go module helpers');
41
49
  console.log(' plugin Manage plugins (e.g. `krate plugin add <pkg>`)');
42
50
  console.log(' init Scaffold a new project (alias: create)');
43
51
  console.log(' version Show version');
@@ -57,7 +65,7 @@ async function main() {
57
65
  }
58
66
  catch (err) {
59
67
  console.error(err.message);
60
- process.exit(1);
68
+ process.exit(err.exitCode || 1);
61
69
  }
62
70
  break;
63
71
  case 'version':
@@ -66,9 +74,15 @@ async function main() {
66
74
  case '--help':
67
75
  case '-h':
68
76
  case 'help':
69
- console.log('Usage: krate <command> [options]');
70
- console.log('');
71
- console.log('Commands: build, dev, serve, types, check, plugin, init, mcp, version');
77
+ // Forward help so command-specific help and the canonical command list
78
+ // come from the native binary instead of drifting here.
79
+ try {
80
+ await execBinary(args);
81
+ }
82
+ catch (err) {
83
+ console.error(err.message);
84
+ process.exit(err.exitCode || 1);
85
+ }
72
86
  break;
73
87
  default:
74
88
  try {
@@ -76,7 +90,7 @@ async function main() {
76
90
  }
77
91
  catch (err) {
78
92
  console.error(err.message);
79
- process.exit(1);
93
+ process.exit(err.exitCode || 1);
80
94
  }
81
95
  }
82
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krate/core",
3
- "version": "0.5.0-alpha.3",
3
+ "version": "0.5.0-alpha.4",
4
4
  "description": "The Krate CLI — a Go-native static site generator with signal-based reactivity.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -37,20 +37,20 @@
37
37
  "install.js"
38
38
  ],
39
39
  "dependencies": {
40
- "@krate/plugin": "0.5.0-alpha.3"
40
+ "@krate/plugin": "0.5.0-alpha.4"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^20.19.43",
44
44
  "typescript": "^5.5.0"
45
45
  },
46
46
  "optionalDependencies": {
47
- "@krate/core-darwin-arm64": "0.5.0-alpha.3",
48
- "@krate/core-darwin-x64": "0.5.0-alpha.3",
49
- "@krate/core-linux-arm64": "0.5.0-alpha.3",
50
- "@krate/core-linux-x64": "0.5.0-alpha.3",
51
- "@krate/core-linux-x64-musl": "0.5.0-alpha.3",
52
- "@krate/core-win32-arm64": "0.5.0-alpha.3",
53
- "@krate/core-win32-x64": "0.5.0-alpha.3"
47
+ "@krate/core-darwin-arm64": "0.5.0-alpha.4",
48
+ "@krate/core-darwin-x64": "0.5.0-alpha.4",
49
+ "@krate/core-linux-arm64": "0.5.0-alpha.4",
50
+ "@krate/core-linux-x64": "0.5.0-alpha.4",
51
+ "@krate/core-linux-x64-musl": "0.5.0-alpha.4",
52
+ "@krate/core-win32-arm64": "0.5.0-alpha.4",
53
+ "@krate/core-win32-x64": "0.5.0-alpha.4"
54
54
  },
55
55
  "scripts": {
56
56
  "build": "tsc",