nuxt-openapi-hyperfetch 0.3.5-beta → 0.3.7-beta
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/dist/index.js +7 -8
- package/dist/module/index.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +7 -7
- package/src/module/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import * as p from '@clack/prompts';
|
|
4
|
+
import { existsSync } from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
4
6
|
import { generateOpenApiFiles, generateHeyApiFiles, checkJavaInstalled } from './generate.js';
|
|
5
7
|
import { generateUseFetchComposables } from './generators/use-fetch/generator.js';
|
|
6
8
|
import { generateUseAsyncDataComposables } from './generators/use-async-data/generator.js';
|
|
@@ -197,13 +199,10 @@ program
|
|
|
197
199
|
}
|
|
198
200
|
// Generate headless connectors if requested (requires useAsyncData)
|
|
199
201
|
if (generateConnectorsFlag) {
|
|
200
|
-
// Check zod is available in the user's project
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
await import(zodId);
|
|
205
|
-
}
|
|
206
|
-
catch {
|
|
202
|
+
// Check zod is available in the user's project by probing their node_modules,
|
|
203
|
+
// not via import() which resolves from the CLI's own context (npx sandbox).
|
|
204
|
+
const zodPath = path.resolve(process.cwd(), 'node_modules', 'zod');
|
|
205
|
+
if (!existsSync(zodPath)) {
|
|
207
206
|
p.log.warn('Skipping connectors: "zod" is not installed in this project.\n' +
|
|
208
207
|
' Run: npm install zod');
|
|
209
208
|
generateConnectorsFlag = false;
|
|
@@ -217,7 +216,7 @@ program
|
|
|
217
216
|
await generateConnectors({
|
|
218
217
|
inputSpec: inputPath,
|
|
219
218
|
outputDir: `${composablesOutputDir}/connectors`,
|
|
220
|
-
composablesRelDir: '../use-async-data',
|
|
219
|
+
composablesRelDir: '../use-async-data/composables',
|
|
221
220
|
runtimeRelDir: '../../runtime',
|
|
222
221
|
});
|
|
223
222
|
spinner.stop('✓ Generated headless UI connectors');
|
package/dist/module/index.js
CHANGED
|
@@ -73,7 +73,7 @@ export default defineNuxtModule({
|
|
|
73
73
|
await generateConnectors({
|
|
74
74
|
inputSpec: resolvedInput,
|
|
75
75
|
outputDir: connectorsOutputDir,
|
|
76
|
-
composablesRelDir: '../use-async-data',
|
|
76
|
+
composablesRelDir: '../use-async-data/composables',
|
|
77
77
|
runtimeRelDir: '../../runtime',
|
|
78
78
|
}, logger);
|
|
79
79
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
3
|
import * as p from '@clack/prompts';
|
|
4
|
+
import { existsSync } from 'fs';
|
|
5
|
+
import * as path from 'path';
|
|
4
6
|
import { generateOpenApiFiles, generateHeyApiFiles, checkJavaInstalled } from './generate.js';
|
|
5
7
|
import { generateUseFetchComposables } from './generators/use-fetch/generator.js';
|
|
6
8
|
import { generateUseAsyncDataComposables } from './generators/use-async-data/generator.js';
|
|
@@ -254,12 +256,10 @@ program
|
|
|
254
256
|
|
|
255
257
|
// Generate headless connectors if requested (requires useAsyncData)
|
|
256
258
|
if (generateConnectorsFlag) {
|
|
257
|
-
// Check zod is available in the user's project
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
await import(zodId);
|
|
262
|
-
} catch {
|
|
259
|
+
// Check zod is available in the user's project by probing their node_modules,
|
|
260
|
+
// not via import() which resolves from the CLI's own context (npx sandbox).
|
|
261
|
+
const zodPath = path.resolve(process.cwd(), 'node_modules', 'zod');
|
|
262
|
+
if (!existsSync(zodPath)) {
|
|
263
263
|
p.log.warn(
|
|
264
264
|
'Skipping connectors: "zod" is not installed in this project.\n' +
|
|
265
265
|
' Run: npm install zod'
|
|
@@ -276,7 +276,7 @@ program
|
|
|
276
276
|
await generateConnectors({
|
|
277
277
|
inputSpec: inputPath,
|
|
278
278
|
outputDir: `${composablesOutputDir}/connectors`,
|
|
279
|
-
composablesRelDir: '../use-async-data',
|
|
279
|
+
composablesRelDir: '../use-async-data/composables',
|
|
280
280
|
runtimeRelDir: '../../runtime',
|
|
281
281
|
});
|
|
282
282
|
spinner.stop('✓ Generated headless UI connectors');
|
package/src/module/index.ts
CHANGED
|
@@ -112,7 +112,7 @@ export default defineNuxtModule<ModuleOptions>({
|
|
|
112
112
|
{
|
|
113
113
|
inputSpec: resolvedInput,
|
|
114
114
|
outputDir: connectorsOutputDir,
|
|
115
|
-
composablesRelDir: '../use-async-data',
|
|
115
|
+
composablesRelDir: '../use-async-data/composables',
|
|
116
116
|
runtimeRelDir: '../../runtime',
|
|
117
117
|
},
|
|
118
118
|
logger
|