@lukoweb/apitogo 0.1.2 → 0.1.3
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/cli.js +151 -51
- package/package.json +2 -1
package/dist/cli/cli.js
CHANGED
|
@@ -131,7 +131,7 @@ import { stat } from "node:fs/promises";
|
|
|
131
131
|
var fileExists;
|
|
132
132
|
var init_file_exists = __esm({
|
|
133
133
|
"src/config/file-exists.ts"() {
|
|
134
|
-
fileExists = (
|
|
134
|
+
fileExists = (path30) => stat(path30).then(() => true).catch(() => false);
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
|
|
@@ -4003,6 +4003,7 @@ var package_default = {
|
|
|
4003
4003
|
"strip-ansi": "7.2.0",
|
|
4004
4004
|
"tailwind-merge": "3.5.0",
|
|
4005
4005
|
tailwindcss: "4.2.1",
|
|
4006
|
+
tar: "7.5.10",
|
|
4006
4007
|
"tw-animate-css": "1.4.0",
|
|
4007
4008
|
unified: "11.0.5",
|
|
4008
4009
|
"unist-util-visit": "5.1.0",
|
|
@@ -4406,14 +4407,14 @@ var flattenAllOf = (schema2) => {
|
|
|
4406
4407
|
};
|
|
4407
4408
|
|
|
4408
4409
|
// src/lib/util/traverse.ts
|
|
4409
|
-
var traverse = (specification, transform,
|
|
4410
|
-
const transformed = transform(specification,
|
|
4410
|
+
var traverse = (specification, transform, path30 = []) => {
|
|
4411
|
+
const transformed = transform(specification, path30);
|
|
4411
4412
|
if (typeof transformed !== "object" || transformed === null) {
|
|
4412
4413
|
return transformed;
|
|
4413
4414
|
}
|
|
4414
4415
|
const result = Array.isArray(transformed) ? [] : {};
|
|
4415
4416
|
for (const [key, value] of Object.entries(transformed)) {
|
|
4416
|
-
const currentPath = [...
|
|
4417
|
+
const currentPath = [...path30, key];
|
|
4417
4418
|
if (Array.isArray(value)) {
|
|
4418
4419
|
result[key] = value.map(
|
|
4419
4420
|
(item, index) => typeof item === "object" && item != null ? traverse(item, transform, [...currentPath, index.toString()]) : item
|
|
@@ -4441,9 +4442,9 @@ var resolveLocalRef = (schema2, ref) => {
|
|
|
4441
4442
|
if (schemaCache?.has(ref)) {
|
|
4442
4443
|
return schemaCache.get(ref);
|
|
4443
4444
|
}
|
|
4444
|
-
const
|
|
4445
|
+
const path30 = ref.split("/").slice(1);
|
|
4445
4446
|
let current = schema2;
|
|
4446
|
-
for (const segment of
|
|
4447
|
+
for (const segment of path30) {
|
|
4447
4448
|
if (!current || typeof current !== "object") {
|
|
4448
4449
|
current = null;
|
|
4449
4450
|
}
|
|
@@ -4462,7 +4463,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4462
4463
|
}
|
|
4463
4464
|
const cloned = structuredClone(schema2);
|
|
4464
4465
|
const visited = /* @__PURE__ */ new Set();
|
|
4465
|
-
const resolve = async (current,
|
|
4466
|
+
const resolve = async (current, path30) => {
|
|
4466
4467
|
if (isIndexableObject(current)) {
|
|
4467
4468
|
if (visited.has(current)) {
|
|
4468
4469
|
return CIRCULAR_REF;
|
|
@@ -4470,7 +4471,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4470
4471
|
visited.add(current);
|
|
4471
4472
|
if (Array.isArray(current)) {
|
|
4472
4473
|
for (let index = 0; index < current.length; index++) {
|
|
4473
|
-
current[index] = await resolve(current[index], `${
|
|
4474
|
+
current[index] = await resolve(current[index], `${path30}/${index}`);
|
|
4474
4475
|
}
|
|
4475
4476
|
} else {
|
|
4476
4477
|
if ("$ref" in current && typeof current.$ref === "string") {
|
|
@@ -4481,13 +4482,13 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4481
4482
|
for (const resolver of resolvers) {
|
|
4482
4483
|
const resolved = await resolver($ref);
|
|
4483
4484
|
if (resolved) {
|
|
4484
|
-
result2 = await resolve(resolved,
|
|
4485
|
+
result2 = await resolve(resolved, path30);
|
|
4485
4486
|
break;
|
|
4486
4487
|
}
|
|
4487
4488
|
}
|
|
4488
4489
|
if (result2 === void 0) {
|
|
4489
4490
|
const resolved = await resolveLocalRef(cloned, $ref);
|
|
4490
|
-
result2 = await resolve(resolved,
|
|
4491
|
+
result2 = await resolve(resolved, path30);
|
|
4491
4492
|
}
|
|
4492
4493
|
if (hasSiblings) {
|
|
4493
4494
|
if (result2 === CIRCULAR_REF) {
|
|
@@ -4500,7 +4501,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4500
4501
|
return result2;
|
|
4501
4502
|
}
|
|
4502
4503
|
for (const key in current) {
|
|
4503
|
-
current[key] = await resolve(current[key], `${
|
|
4504
|
+
current[key] = await resolve(current[key], `${path30}/${key}`);
|
|
4504
4505
|
}
|
|
4505
4506
|
}
|
|
4506
4507
|
visited.delete(current);
|
|
@@ -4539,9 +4540,9 @@ var upgradeSchema = (schema2) => {
|
|
|
4539
4540
|
}
|
|
4540
4541
|
return sub;
|
|
4541
4542
|
});
|
|
4542
|
-
schema2 = traverse(schema2, (sub,
|
|
4543
|
+
schema2 = traverse(schema2, (sub, path30) => {
|
|
4543
4544
|
if (sub.example !== void 0) {
|
|
4544
|
-
if (isSchemaPath(
|
|
4545
|
+
if (isSchemaPath(path30 ?? [])) {
|
|
4545
4546
|
sub.examples = [sub.example];
|
|
4546
4547
|
} else {
|
|
4547
4548
|
sub.examples = {
|
|
@@ -4554,11 +4555,11 @@ var upgradeSchema = (schema2) => {
|
|
|
4554
4555
|
}
|
|
4555
4556
|
return sub;
|
|
4556
4557
|
});
|
|
4557
|
-
schema2 = traverse(schema2, (schema3,
|
|
4558
|
+
schema2 = traverse(schema2, (schema3, path30) => {
|
|
4558
4559
|
if (schema3.type === "object" && schema3.properties !== void 0) {
|
|
4559
|
-
const parentPath =
|
|
4560
|
+
const parentPath = path30?.slice(0, -1);
|
|
4560
4561
|
const isMultipart = parentPath?.some((segment, index) => {
|
|
4561
|
-
return segment === "content" &&
|
|
4562
|
+
return segment === "content" && path30?.[index + 1] === "multipart/form-data";
|
|
4562
4563
|
});
|
|
4563
4564
|
if (isMultipart) {
|
|
4564
4565
|
const entries = Object.entries(schema3.properties);
|
|
@@ -4572,8 +4573,8 @@ var upgradeSchema = (schema2) => {
|
|
|
4572
4573
|
}
|
|
4573
4574
|
return schema3;
|
|
4574
4575
|
});
|
|
4575
|
-
schema2 = traverse(schema2, (schema3,
|
|
4576
|
-
if (
|
|
4576
|
+
schema2 = traverse(schema2, (schema3, path30) => {
|
|
4577
|
+
if (path30?.includes("content") && path30.includes("application/octet-stream")) {
|
|
4577
4578
|
return {};
|
|
4578
4579
|
}
|
|
4579
4580
|
if (schema3.type === "string" && schema3.format === "binary") {
|
|
@@ -4599,11 +4600,11 @@ var upgradeSchema = (schema2) => {
|
|
|
4599
4600
|
}
|
|
4600
4601
|
return sub;
|
|
4601
4602
|
});
|
|
4602
|
-
schema2 = traverse(schema2, (schema3,
|
|
4603
|
+
schema2 = traverse(schema2, (schema3, path30) => {
|
|
4603
4604
|
if (schema3.type === "string" && schema3.format === "byte") {
|
|
4604
|
-
const parentPath =
|
|
4605
|
+
const parentPath = path30?.slice(0, -1);
|
|
4605
4606
|
const contentMediaType = parentPath?.find(
|
|
4606
|
-
(_, index) =>
|
|
4607
|
+
(_, index) => path30?.[index - 1] === "content"
|
|
4607
4608
|
);
|
|
4608
4609
|
return {
|
|
4609
4610
|
type: "string",
|
|
@@ -4615,7 +4616,7 @@ var upgradeSchema = (schema2) => {
|
|
|
4615
4616
|
});
|
|
4616
4617
|
return schema2;
|
|
4617
4618
|
};
|
|
4618
|
-
function isSchemaPath(
|
|
4619
|
+
function isSchemaPath(path30) {
|
|
4619
4620
|
const schemaLocations = [
|
|
4620
4621
|
["components", "schemas"],
|
|
4621
4622
|
"properties",
|
|
@@ -4628,10 +4629,10 @@ function isSchemaPath(path29) {
|
|
|
4628
4629
|
];
|
|
4629
4630
|
return schemaLocations.some((location) => {
|
|
4630
4631
|
if (Array.isArray(location)) {
|
|
4631
|
-
return location.every((segment, index) =>
|
|
4632
|
+
return location.every((segment, index) => path30[index] === segment);
|
|
4632
4633
|
}
|
|
4633
|
-
return
|
|
4634
|
-
}) ||
|
|
4634
|
+
return path30.includes(location);
|
|
4635
|
+
}) || path30.includes("schema") || path30.some((segment) => segment.endsWith("Schema"));
|
|
4635
4636
|
}
|
|
4636
4637
|
|
|
4637
4638
|
// src/lib/oas/parser/index.ts
|
|
@@ -4713,13 +4714,13 @@ var OPENAPI_PROPS = /* @__PURE__ */ new Set([
|
|
|
4713
4714
|
"anyOf",
|
|
4714
4715
|
"oneOf"
|
|
4715
4716
|
]);
|
|
4716
|
-
var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(),
|
|
4717
|
+
var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(), path30 = [], currentRefPaths = /* @__PURE__ */ new Set()) => {
|
|
4717
4718
|
if (obj === null || typeof obj !== "object") return obj;
|
|
4718
4719
|
const refPath = obj.__$ref;
|
|
4719
4720
|
const isCircular = currentPath.has(obj) || typeof refPath === "string" && currentRefPaths.has(refPath);
|
|
4720
4721
|
if (isCircular) {
|
|
4721
4722
|
if (typeof refPath === "string") return SCHEMA_REF_PREFIX + refPath;
|
|
4722
|
-
const circularProp =
|
|
4723
|
+
const circularProp = path30.find((p) => !OPENAPI_PROPS.has(p)) || path30[0];
|
|
4723
4724
|
return [CIRCULAR_REF, circularProp].filter(Boolean).join(":");
|
|
4724
4725
|
}
|
|
4725
4726
|
if (refs.has(obj)) return refs.get(obj);
|
|
@@ -4729,7 +4730,7 @@ var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs
|
|
|
4729
4730
|
value,
|
|
4730
4731
|
currentPath,
|
|
4731
4732
|
refs,
|
|
4732
|
-
[...
|
|
4733
|
+
[...path30, key],
|
|
4733
4734
|
currentRefPaths
|
|
4734
4735
|
);
|
|
4735
4736
|
const result = Array.isArray(obj) ? obj.map((item, i) => recurse(item, i.toString())) : Object.fromEntries(
|
|
@@ -4764,7 +4765,7 @@ var resolveExtensions = (obj) => Object.fromEntries(
|
|
|
4764
4765
|
var getAllTags = (schema2) => {
|
|
4765
4766
|
const rootTags = schema2.tags ?? [];
|
|
4766
4767
|
const operations = Object.values(schema2.paths ?? {}).flatMap(
|
|
4767
|
-
(
|
|
4768
|
+
(path30) => HttpMethods.map((k) => path30?.[k]).filter((op) => op != null)
|
|
4768
4769
|
);
|
|
4769
4770
|
const operationTags = new Set(operations.flatMap((op) => op.tags ?? []));
|
|
4770
4771
|
const hasUntaggedOperations = operations.some(
|
|
@@ -4819,7 +4820,7 @@ var getAllSlugs = (ops, schemaTags = []) => {
|
|
|
4819
4820
|
var getOperationSlugKey = (op) => [op.path, op.method, op.operationId, op.summary].filter(Boolean).join("-");
|
|
4820
4821
|
var getAllOperations = (paths) => {
|
|
4821
4822
|
const operations = Object.entries(paths ?? {}).flatMap(
|
|
4822
|
-
([
|
|
4823
|
+
([path30, value]) => HttpMethods.flatMap((method) => {
|
|
4823
4824
|
if (!value?.[method]) return [];
|
|
4824
4825
|
const operation = value[method];
|
|
4825
4826
|
const pathParameters = value.parameters ?? [];
|
|
@@ -4839,7 +4840,7 @@ var getAllOperations = (paths) => {
|
|
|
4839
4840
|
return {
|
|
4840
4841
|
...operation,
|
|
4841
4842
|
method,
|
|
4842
|
-
path:
|
|
4843
|
+
path: path30,
|
|
4843
4844
|
parameters,
|
|
4844
4845
|
servers,
|
|
4845
4846
|
tags: operation.tags ?? []
|
|
@@ -5197,8 +5198,8 @@ var Schema = builder.objectRef("Schema").implement({
|
|
|
5197
5198
|
}),
|
|
5198
5199
|
paths: t.field({
|
|
5199
5200
|
type: [PathItem],
|
|
5200
|
-
resolve: (root) => Object.entries(root.paths ?? {}).map(([
|
|
5201
|
-
path:
|
|
5201
|
+
resolve: (root) => Object.entries(root.paths ?? {}).map(([path30, value]) => ({
|
|
5202
|
+
path: path30,
|
|
5202
5203
|
// biome-ignore lint/style/noNonNullAssertion: value is guaranteed to be defined
|
|
5203
5204
|
methods: Object.keys(value)
|
|
5204
5205
|
}))
|
|
@@ -5345,7 +5346,7 @@ init_joinUrl();
|
|
|
5345
5346
|
|
|
5346
5347
|
// src/vite/api/schema-codegen.ts
|
|
5347
5348
|
var unescapeJsonPointer = (uri) => decodeURIComponent(uri.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
5348
|
-
var getSegmentsFromPath = (
|
|
5349
|
+
var getSegmentsFromPath = (path30) => path30.split("/").slice(1).map(unescapeJsonPointer);
|
|
5349
5350
|
var createLocalRefMap = (obj) => {
|
|
5350
5351
|
const refMap = /* @__PURE__ */ new Map();
|
|
5351
5352
|
const siblingsMap = /* @__PURE__ */ new Map();
|
|
@@ -5376,16 +5377,16 @@ var replaceMarkers = (code, mergedRefs) => code.replace(/"__refMap:(.*?)"/g, '__
|
|
|
5376
5377
|
/"__refMap\+Siblings:(.*?)"/g,
|
|
5377
5378
|
(_, key) => mergedRefs.get(key) ?? `__refMap["${key}"]`
|
|
5378
5379
|
);
|
|
5379
|
-
var lookup = (schema2,
|
|
5380
|
-
const parts = getSegmentsFromPath(
|
|
5380
|
+
var lookup = (schema2, path30, filePath) => {
|
|
5381
|
+
const parts = getSegmentsFromPath(path30);
|
|
5381
5382
|
let val = schema2;
|
|
5382
5383
|
for (const part of parts) {
|
|
5383
5384
|
while (val.$ref?.startsWith("#/")) {
|
|
5384
|
-
val = val.$ref ===
|
|
5385
|
+
val = val.$ref === path30 ? val : lookup(schema2, val.$ref, filePath);
|
|
5385
5386
|
}
|
|
5386
5387
|
if (val[part] === void 0) {
|
|
5387
5388
|
throw new Error(
|
|
5388
|
-
`Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${
|
|
5389
|
+
`Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${path30}`
|
|
5389
5390
|
);
|
|
5390
5391
|
}
|
|
5391
5392
|
val = val[part];
|
|
@@ -5630,8 +5631,8 @@ var SchemaManager = class {
|
|
|
5630
5631
|
}
|
|
5631
5632
|
}
|
|
5632
5633
|
};
|
|
5633
|
-
getLatestSchema = (
|
|
5634
|
-
getSchemasForPath = (
|
|
5634
|
+
getLatestSchema = (path30) => this.processedSchemas[path30]?.at(0);
|
|
5635
|
+
getSchemasForPath = (path30) => this.processedSchemas[path30];
|
|
5635
5636
|
getSchemaImports = () => Object.values(this.processedSchemas).flat().filter((s) => s.importKey);
|
|
5636
5637
|
getUrlToFilePathMap = () => {
|
|
5637
5638
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -7720,14 +7721,14 @@ async function generateSitemap({
|
|
|
7720
7721
|
|
|
7721
7722
|
// src/vite/prerender/utils.ts
|
|
7722
7723
|
init_joinUrl();
|
|
7723
|
-
var resolveRoutePath = (
|
|
7724
|
-
const segments =
|
|
7724
|
+
var resolveRoutePath = (path30) => {
|
|
7725
|
+
const segments = path30.split("/");
|
|
7725
7726
|
if (segments.some((s) => s.startsWith(":") && !s.endsWith("?"))) {
|
|
7726
7727
|
return void 0;
|
|
7727
7728
|
}
|
|
7728
7729
|
return segments.filter((s) => !s.startsWith(":")).join("/") || void 0;
|
|
7729
7730
|
};
|
|
7730
|
-
var isSkipped = (
|
|
7731
|
+
var isSkipped = (path30) => path30.includes("*") || /^\d+$/.test(path30);
|
|
7731
7732
|
var resolveRoutes = (routes, parentPath = "") => routes.flatMap((route) => {
|
|
7732
7733
|
if (route.path && isSkipped(route.path)) return [];
|
|
7733
7734
|
const routePath = route.path ? resolveRoutePath(route.path) : void 0;
|
|
@@ -8093,6 +8094,22 @@ function printDiagnosticsToConsole(message) {
|
|
|
8093
8094
|
function printWarningToConsole(message) {
|
|
8094
8095
|
console.error(message);
|
|
8095
8096
|
}
|
|
8097
|
+
async function printCriticalFailureToConsoleAndExit(message) {
|
|
8098
|
+
console.error(colors8.bold(colors8.red(message)));
|
|
8099
|
+
await Sentry.close(MAX_WAIT_PENDING_TIME_MS).then(() => {
|
|
8100
|
+
process.exit(1);
|
|
8101
|
+
});
|
|
8102
|
+
}
|
|
8103
|
+
function printResultToConsole(message) {
|
|
8104
|
+
console.log(colors8.bold(colors8.green(message)));
|
|
8105
|
+
}
|
|
8106
|
+
function textOrJson(text) {
|
|
8107
|
+
try {
|
|
8108
|
+
return JSON.parse(text);
|
|
8109
|
+
} catch {
|
|
8110
|
+
return text;
|
|
8111
|
+
}
|
|
8112
|
+
}
|
|
8096
8113
|
|
|
8097
8114
|
// src/cli/build/handler.ts
|
|
8098
8115
|
init_package_json();
|
|
@@ -8690,6 +8707,89 @@ var dev_default = {
|
|
|
8690
8707
|
}
|
|
8691
8708
|
};
|
|
8692
8709
|
|
|
8710
|
+
// src/cli/deploy/handler.ts
|
|
8711
|
+
import { access, readFile as readFile4 } from "node:fs/promises";
|
|
8712
|
+
import path28 from "node:path";
|
|
8713
|
+
import { create as createTar } from "tar";
|
|
8714
|
+
var DEPLOY_ENDPOINT = "http://localhost:3000/deploy";
|
|
8715
|
+
var ARCHIVE_NAME = "dist.tgz";
|
|
8716
|
+
var createDeploymentArchive = async (dir) => {
|
|
8717
|
+
const distDir = path28.join(dir, "dist");
|
|
8718
|
+
await access(distDir);
|
|
8719
|
+
const archivePath = path28.join(dir, ARCHIVE_NAME);
|
|
8720
|
+
await createTar(
|
|
8721
|
+
{
|
|
8722
|
+
cwd: dir,
|
|
8723
|
+
file: archivePath,
|
|
8724
|
+
gzip: true,
|
|
8725
|
+
portable: true
|
|
8726
|
+
},
|
|
8727
|
+
["dist"]
|
|
8728
|
+
);
|
|
8729
|
+
return archivePath;
|
|
8730
|
+
};
|
|
8731
|
+
async function deploy(argv) {
|
|
8732
|
+
await build({ ...argv, preview: void 0 });
|
|
8733
|
+
const dir = path28.resolve(process.cwd(), argv.dir);
|
|
8734
|
+
try {
|
|
8735
|
+
printDiagnosticsToConsole("Creating deployment archive...");
|
|
8736
|
+
const archivePath = await createDeploymentArchive(dir);
|
|
8737
|
+
printDiagnosticsToConsole(`Uploading ${path28.basename(archivePath)}...`);
|
|
8738
|
+
const archiveBuffer = await readFile4(archivePath);
|
|
8739
|
+
const formData = new FormData();
|
|
8740
|
+
formData.append(
|
|
8741
|
+
"file",
|
|
8742
|
+
new Blob([archiveBuffer], { type: "application/gzip" }),
|
|
8743
|
+
path28.basename(archivePath)
|
|
8744
|
+
);
|
|
8745
|
+
const response = await fetch(DEPLOY_ENDPOINT, {
|
|
8746
|
+
method: "POST",
|
|
8747
|
+
body: formData
|
|
8748
|
+
});
|
|
8749
|
+
const responseText = await response.text();
|
|
8750
|
+
if (!response.ok) {
|
|
8751
|
+
throw new Error(
|
|
8752
|
+
`Deploy failed with ${response.status}: ${JSON.stringify(textOrJson(responseText))}`
|
|
8753
|
+
);
|
|
8754
|
+
}
|
|
8755
|
+
printResultToConsole(`Deployment uploaded to ${DEPLOY_ENDPOINT}`);
|
|
8756
|
+
if (responseText.trim()) {
|
|
8757
|
+
printDiagnosticsToConsole(JSON.stringify(textOrJson(responseText), null, 2));
|
|
8758
|
+
}
|
|
8759
|
+
} catch (error) {
|
|
8760
|
+
await printCriticalFailureToConsoleAndExit(
|
|
8761
|
+
error instanceof Error ? error.message : String(error)
|
|
8762
|
+
);
|
|
8763
|
+
}
|
|
8764
|
+
}
|
|
8765
|
+
|
|
8766
|
+
// src/cli/cmds/deploy.ts
|
|
8767
|
+
var deploy_default = {
|
|
8768
|
+
desc: "Build, archive, and deploy",
|
|
8769
|
+
command: "deploy",
|
|
8770
|
+
builder: (yargs2) => yargs2.option("dir", {
|
|
8771
|
+
type: "string",
|
|
8772
|
+
describe: "The directory containing your project",
|
|
8773
|
+
default: ".",
|
|
8774
|
+
normalize: true,
|
|
8775
|
+
hidden: true
|
|
8776
|
+
}).option("experimental-ssr", {
|
|
8777
|
+
type: "boolean",
|
|
8778
|
+
describe: "Build for server-side rendering (experimental)",
|
|
8779
|
+
default: false
|
|
8780
|
+
}).option("adapter", {
|
|
8781
|
+
type: "string",
|
|
8782
|
+
describe: "SSR adapter (node, cloudflare, vercel)",
|
|
8783
|
+
choices: ["node", "cloudflare", "vercel"],
|
|
8784
|
+
default: "node"
|
|
8785
|
+
}),
|
|
8786
|
+
handler: async (argv) => {
|
|
8787
|
+
process.env.NODE_ENV = "production";
|
|
8788
|
+
await captureEvent({ argv, event: "apitogo deploy" });
|
|
8789
|
+
await deploy(argv);
|
|
8790
|
+
}
|
|
8791
|
+
};
|
|
8792
|
+
|
|
8693
8793
|
// src/cli/cmds/preview.ts
|
|
8694
8794
|
var previewCommand = {
|
|
8695
8795
|
desc: "Preview production build",
|
|
@@ -8714,7 +8814,7 @@ var preview_default = previewCommand;
|
|
|
8714
8814
|
|
|
8715
8815
|
// src/cli/common/outdated.ts
|
|
8716
8816
|
import { existsSync as existsSync2, mkdirSync } from "node:fs";
|
|
8717
|
-
import { readFile as
|
|
8817
|
+
import { readFile as readFile5, writeFile as writeFile6 } from "node:fs/promises";
|
|
8718
8818
|
import { join } from "node:path";
|
|
8719
8819
|
import colors10 from "picocolors";
|
|
8720
8820
|
import { gt } from "semver";
|
|
@@ -8764,12 +8864,12 @@ function box(message, {
|
|
|
8764
8864
|
|
|
8765
8865
|
// src/cli/common/xdg/lib.ts
|
|
8766
8866
|
import { homedir } from "node:os";
|
|
8767
|
-
import
|
|
8867
|
+
import path29 from "node:path";
|
|
8768
8868
|
function defineDirectoryWithFallback(xdgName, fallback) {
|
|
8769
8869
|
if (process.env[xdgName]) {
|
|
8770
8870
|
return process.env[xdgName];
|
|
8771
8871
|
} else {
|
|
8772
|
-
return
|
|
8872
|
+
return path29.join(homedir(), fallback);
|
|
8773
8873
|
}
|
|
8774
8874
|
}
|
|
8775
8875
|
var XDG_CONFIG_HOME = defineDirectoryWithFallback(
|
|
@@ -8784,15 +8884,15 @@ var XDG_STATE_HOME = defineDirectoryWithFallback(
|
|
|
8784
8884
|
"XDG_DATA_HOME",
|
|
8785
8885
|
".local/state"
|
|
8786
8886
|
);
|
|
8787
|
-
var ZUDOKU_XDG_CONFIG_HOME =
|
|
8887
|
+
var ZUDOKU_XDG_CONFIG_HOME = path29.join(
|
|
8788
8888
|
XDG_CONFIG_HOME,
|
|
8789
8889
|
CLI_XDG_FOLDER_NAME
|
|
8790
8890
|
);
|
|
8791
|
-
var ZUDOKU_XDG_DATA_HOME =
|
|
8891
|
+
var ZUDOKU_XDG_DATA_HOME = path29.join(
|
|
8792
8892
|
XDG_DATA_HOME,
|
|
8793
8893
|
CLI_XDG_FOLDER_NAME
|
|
8794
8894
|
);
|
|
8795
|
-
var ZUDOKU_XDG_STATE_HOME =
|
|
8895
|
+
var ZUDOKU_XDG_STATE_HOME = path29.join(
|
|
8796
8896
|
XDG_STATE_HOME,
|
|
8797
8897
|
CLI_XDG_FOLDER_NAME
|
|
8798
8898
|
);
|
|
@@ -8841,7 +8941,7 @@ async function getVersionCheckInfo() {
|
|
|
8841
8941
|
let versionCheckInfo;
|
|
8842
8942
|
if (existsSync2(versionCheckPath)) {
|
|
8843
8943
|
try {
|
|
8844
|
-
versionCheckInfo = await
|
|
8944
|
+
versionCheckInfo = await readFile5(versionCheckPath, "utf-8").then(
|
|
8845
8945
|
JSON.parse
|
|
8846
8946
|
);
|
|
8847
8947
|
} catch {
|
|
@@ -8946,7 +9046,7 @@ var cli = yargs(hideBin(process.argv)).option("zuplo", {
|
|
|
8946
9046
|
process.env.ZUPLO = "1";
|
|
8947
9047
|
printDiagnosticsToConsole("Running in Zuplo mode");
|
|
8948
9048
|
}
|
|
8949
|
-
}).middleware(warnPackageVersionMismatch).command(build_default).command(dev_default).command(preview_default).demandCommand().strictCommands().version(packageJson?.version).fail(false).help();
|
|
9049
|
+
}).middleware(warnPackageVersionMismatch).command(build_default).command(dev_default).command(deploy_default).command(preview_default).demandCommand().strictCommands().version(packageJson?.version).fail(false).help();
|
|
8950
9050
|
try {
|
|
8951
9051
|
void warnIfOutdatedVersion(packageJson?.version);
|
|
8952
9052
|
await cli.argv;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lukoweb/apitogo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"**/*.css",
|
|
@@ -254,6 +254,7 @@
|
|
|
254
254
|
"strip-ansi": "7.2.0",
|
|
255
255
|
"tailwind-merge": "3.5.0",
|
|
256
256
|
"tailwindcss": "4.2.1",
|
|
257
|
+
"tar": "7.5.10",
|
|
257
258
|
"tw-animate-css": "1.4.0",
|
|
258
259
|
"unified": "11.0.5",
|
|
259
260
|
"unist-util-visit": "5.1.0",
|