next-openapi-gen 1.0.1 → 1.0.2
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/cli.js +20 -24
- package/dist/index.js +20 -24
- package/dist/next/index.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -36,7 +36,7 @@ function normalizeRapidocTemplate(template) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
// ../openapi-init/dist/init/ui-template.js
|
|
39
|
-
var packageRootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "
|
|
39
|
+
var packageRootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
40
40
|
var uiTemplatesDir = path.join(packageRootDir, "templates", "init", "ui");
|
|
41
41
|
function resolveUiTemplatePath(framework, templateFile) {
|
|
42
42
|
return path.join(uiTemplatesDir, getUiFrameworkDirectory(framework), templateFile);
|
|
@@ -352,32 +352,28 @@ async function hasDependency(packageName) {
|
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
354
|
async function getPackageManager() {
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
return packageManager;
|
|
364
|
-
}
|
|
365
|
-
} catch {
|
|
355
|
+
const cwd = process.cwd();
|
|
356
|
+
const packageJsonPath = path3.join(cwd, "package.json");
|
|
357
|
+
if (fs3.existsSync(packageJsonPath)) {
|
|
358
|
+
try {
|
|
359
|
+
const packageJson = JSON.parse(fs3.readFileSync(packageJsonPath, "utf8"));
|
|
360
|
+
const packageManager = packageJson.packageManager?.split("@")[0];
|
|
361
|
+
if (packageManager === "pnpm" || packageManager === "yarn" || packageManager === "npm") {
|
|
362
|
+
return packageManager;
|
|
366
363
|
}
|
|
364
|
+
} catch {
|
|
367
365
|
}
|
|
368
|
-
if (fs3.existsSync(path3.join(currentDir, "yarn.lock"))) {
|
|
369
|
-
return "yarn";
|
|
370
|
-
}
|
|
371
|
-
if (fs3.existsSync(path3.join(currentDir, "pnpm-lock.yaml"))) {
|
|
372
|
-
return "pnpm";
|
|
373
|
-
}
|
|
374
|
-
const parentDir = path3.dirname(currentDir);
|
|
375
|
-
if (parentDir === currentDir) {
|
|
376
|
-
break;
|
|
377
|
-
}
|
|
378
|
-
currentDir = parentDir;
|
|
379
366
|
}
|
|
380
|
-
|
|
367
|
+
if (fs3.existsSync(path3.join(cwd, "yarn.lock"))) {
|
|
368
|
+
return "yarn";
|
|
369
|
+
}
|
|
370
|
+
if (fs3.existsSync(path3.join(cwd, "pnpm-lock.yaml"))) {
|
|
371
|
+
return "pnpm";
|
|
372
|
+
}
|
|
373
|
+
if (fs3.existsSync(path3.join(cwd, "package-lock.json"))) {
|
|
374
|
+
return "npm";
|
|
375
|
+
}
|
|
376
|
+
return "npm";
|
|
381
377
|
}
|
|
382
378
|
|
|
383
379
|
// ../openapi-init/dist/init/install-dependencies.js
|
package/dist/index.js
CHANGED
|
@@ -6992,7 +6992,7 @@ function normalizeRapidocTemplate(template) {
|
|
|
6992
6992
|
}
|
|
6993
6993
|
|
|
6994
6994
|
// ../openapi-init/dist/init/ui-template.js
|
|
6995
|
-
var packageRootDir = path16.resolve(path16.dirname(fileURLToPath(import.meta.url)), "
|
|
6995
|
+
var packageRootDir = path16.resolve(path16.dirname(fileURLToPath(import.meta.url)), "..");
|
|
6996
6996
|
var uiTemplatesDir = path16.join(packageRootDir, "templates", "init", "ui");
|
|
6997
6997
|
function resolveUiTemplatePath(framework, templateFile) {
|
|
6998
6998
|
return path16.join(uiTemplatesDir, getUiFrameworkDirectory(framework), templateFile);
|
|
@@ -8411,32 +8411,28 @@ async function hasDependency(packageName) {
|
|
|
8411
8411
|
}
|
|
8412
8412
|
}
|
|
8413
8413
|
async function getPackageManager() {
|
|
8414
|
-
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
return packageManager;
|
|
8423
|
-
}
|
|
8424
|
-
} catch {
|
|
8414
|
+
const cwd = process.cwd();
|
|
8415
|
+
const packageJsonPath = path21.join(cwd, "package.json");
|
|
8416
|
+
if (fs17.existsSync(packageJsonPath)) {
|
|
8417
|
+
try {
|
|
8418
|
+
const packageJson = JSON.parse(fs17.readFileSync(packageJsonPath, "utf8"));
|
|
8419
|
+
const packageManager = packageJson.packageManager?.split("@")[0];
|
|
8420
|
+
if (packageManager === "pnpm" || packageManager === "yarn" || packageManager === "npm") {
|
|
8421
|
+
return packageManager;
|
|
8425
8422
|
}
|
|
8423
|
+
} catch {
|
|
8426
8424
|
}
|
|
8427
|
-
if (fs17.existsSync(path21.join(currentDir, "yarn.lock"))) {
|
|
8428
|
-
return "yarn";
|
|
8429
|
-
}
|
|
8430
|
-
if (fs17.existsSync(path21.join(currentDir, "pnpm-lock.yaml"))) {
|
|
8431
|
-
return "pnpm";
|
|
8432
|
-
}
|
|
8433
|
-
const parentDir = path21.dirname(currentDir);
|
|
8434
|
-
if (parentDir === currentDir) {
|
|
8435
|
-
break;
|
|
8436
|
-
}
|
|
8437
|
-
currentDir = parentDir;
|
|
8438
8425
|
}
|
|
8439
|
-
|
|
8426
|
+
if (fs17.existsSync(path21.join(cwd, "yarn.lock"))) {
|
|
8427
|
+
return "yarn";
|
|
8428
|
+
}
|
|
8429
|
+
if (fs17.existsSync(path21.join(cwd, "pnpm-lock.yaml"))) {
|
|
8430
|
+
return "pnpm";
|
|
8431
|
+
}
|
|
8432
|
+
if (fs17.existsSync(path21.join(cwd, "package-lock.json"))) {
|
|
8433
|
+
return "npm";
|
|
8434
|
+
}
|
|
8435
|
+
return "npm";
|
|
8440
8436
|
}
|
|
8441
8437
|
|
|
8442
8438
|
// ../openapi-init/dist/init/install-dependencies.js
|
package/dist/next/index.js
CHANGED
|
@@ -40,7 +40,7 @@ function normalizeRapidocTemplate(template) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// ../openapi-init/dist/init/ui-template.js
|
|
43
|
-
var packageRootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "
|
|
43
|
+
var packageRootDir = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
44
44
|
var uiTemplatesDir = path.join(packageRootDir, "templates", "init", "ui");
|
|
45
45
|
function resolveUiTemplatePath(framework, templateFile) {
|
|
46
46
|
return path.join(uiTemplatesDir, getUiFrameworkDirectory(framework), templateFile);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-openapi-gen",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Automatically generate OpenAPI 3.0, 3.1, and 3.2 documentation from Next.js projects, with support for Zod schemas, TypeScript types, and reusable OpenAPI fragments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|