wp-typia 0.22.5 → 0.22.7

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
@@ -28,6 +28,13 @@ Extend an existing workspace with:
28
28
  `wp-typia create <project-dir>` when `<project-dir>` is the only positional
29
29
  argument.
30
30
 
31
+ Configuration files:
32
+
33
+ - `wp-typia` loads `~/.config/wp-typia/config.json`, `.wp-typiarc`, `.wp-typiarc.json`, then `package.json#wp-typia`; later sources override earlier sources
34
+ - `--config <path>` is an explicit override loaded after the default sources, relative to the current working directory unless absolute
35
+ - config files use a strict schema: unknown keys are errors rather than warnings or stripped values, so typos fail near the source config file
36
+ - object values are deep-merged, while arrays such as `mcp.schemaSources` replace earlier arrays instead of concatenating
37
+
31
38
  Compatibility notes:
32
39
 
33
40
  - `@wp-typia/project-tools` is the canonical programmatic project orchestration package
package/bin/wp-typia.js CHANGED
@@ -35,6 +35,24 @@ const buildScriptEntrypoint = path.join(
35
35
  'build-bunli-runtime.ts',
36
36
  );
37
37
  const sourceCliEntrypoint = path.join(packageRoot, 'src', 'cli.ts');
38
+ const sourceCheckoutRoot = path.resolve(packageRoot, '..', '..');
39
+ const sourceProjectToolsPackageRoot = path.resolve(
40
+ packageRoot,
41
+ '..',
42
+ 'wp-typia-project-tools',
43
+ );
44
+ const sourceProjectToolsPackageManifest = path.join(
45
+ sourceProjectToolsPackageRoot,
46
+ 'package.json',
47
+ );
48
+ const sourceProjectToolsRuntimeProbe = path.join(
49
+ sourceProjectToolsPackageRoot,
50
+ 'dist',
51
+ 'runtime',
52
+ 'cli-diagnostics.js',
53
+ );
54
+ const sourceProjectToolsBuildCommand =
55
+ 'bun run --filter @wp-typia/project-tools build';
38
56
  const standaloneGuidance =
39
57
  'Prefer not to install Bun? Use the standalone wp-typia binary from the GitHub release assets.';
40
58
 
@@ -67,7 +85,72 @@ function canAutobuildSourceCheckout() {
67
85
  );
68
86
  }
69
87
 
88
+ function hasMissingSourceProjectToolsRuntime() {
89
+ return (
90
+ canAutobuildSourceCheckout() &&
91
+ fs.existsSync(path.join(sourceCheckoutRoot, 'package.json')) &&
92
+ fs.existsSync(sourceProjectToolsPackageManifest) &&
93
+ !fs.existsSync(sourceProjectToolsRuntimeProbe)
94
+ );
95
+ }
96
+
97
+ function ensureSourceProjectToolsRuntime() {
98
+ if (!hasMissingSourceProjectToolsRuntime()) {
99
+ return true;
100
+ }
101
+
102
+ const relativeProbe = path.relative(
103
+ sourceCheckoutRoot,
104
+ sourceProjectToolsRuntimeProbe,
105
+ );
106
+
107
+ console.error(
108
+ `wp-typia source checkout is missing @wp-typia/project-tools build artifacts (${relativeProbe}).`,
109
+ );
110
+
111
+ if (!isWorkingBunBinary()) {
112
+ console.error(
113
+ `Error: wp-typia cannot rebuild @wp-typia/project-tools because no working Bun binary was found. Run \`${sourceProjectToolsBuildCommand}\` from the repository root after installing Bun, then rerun wp-typia.`,
114
+ );
115
+ process.exit(1);
116
+ }
117
+
118
+ console.error(
119
+ `Running \`${sourceProjectToolsBuildCommand}\` from ${sourceCheckoutRoot} before rebuilding the CLI runtime...`,
120
+ );
121
+
122
+ const buildResult = spawnSync(
123
+ bunBinary,
124
+ ['run', '--filter', '@wp-typia/project-tools', 'build'],
125
+ {
126
+ cwd: sourceCheckoutRoot,
127
+ env: process.env,
128
+ stdio: 'inherit',
129
+ },
130
+ );
131
+
132
+ if (buildResult.status !== 0) {
133
+ console.error(
134
+ `Error: @wp-typia/project-tools build failed. Run \`${sourceProjectToolsBuildCommand}\` from the repository root, then rerun wp-typia.`,
135
+ );
136
+ process.exit(buildResult.status ?? 1);
137
+ }
138
+
139
+ if (fs.existsSync(sourceProjectToolsRuntimeProbe)) {
140
+ return true;
141
+ }
142
+
143
+ console.error(
144
+ `Error: @wp-typia/project-tools build completed but ${relativeProbe} is still missing. Run \`${sourceProjectToolsBuildCommand}\` from the repository root, then rerun wp-typia.`,
145
+ );
146
+ return false;
147
+ }
148
+
70
149
  function ensureBuiltRuntime() {
150
+ if (!ensureSourceProjectToolsRuntime()) {
151
+ return false;
152
+ }
153
+
71
154
  if (fs.existsSync(cliEntrypoint) && fs.existsSync(nodeCliEntrypoint)) {
72
155
  return true;
73
156
  }