create-nextly-app 0.0.2-alpha.28 → 0.0.2-alpha.29
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/{chunk-XMNVVIVZ.mjs → chunk-C5CWOU22.mjs} +439 -203
- package/dist/chunk-C5CWOU22.mjs.map +1 -0
- package/dist/cli.cjs +450 -214
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +2 -2
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +309 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -4
- package/templates/plugin/README.md +44 -0
- package/templates/plugin/dev/.env.example +8 -0
- package/templates/plugin/dev/instrumentation.ts +10 -0
- package/templates/plugin/dev/next.config.ts +30 -0
- package/templates/plugin/dev/nextly.config.ts +17 -0
- package/templates/plugin/dev/src/app/admin/[[...params]]/page.tsx +9 -0
- package/templates/plugin/dev/src/app/admin/api/[[...params]]/route.ts +19 -0
- package/templates/plugin/dev/src/app/layout.tsx +13 -0
- package/templates/plugin/dev/tsconfig.json +22 -0
- package/templates/plugin/eslint.config.mjs +8 -0
- package/templates/plugin/src/admin/SettingsPage.tsx +13 -0
- package/templates/plugin/src/admin/index.ts +21 -0
- package/templates/plugin/src/collections/example.ts +13 -0
- package/templates/plugin/src/index.ts +6 -0
- package/templates/plugin/src/plugin.test.ts +29 -0
- package/templates/plugin/src/plugin.ts +48 -0
- package/templates/plugin/src/types.ts +17 -0
- package/templates/plugin/template.json +14 -0
- package/templates/plugin/tsconfig.json +18 -0
- package/templates/plugin/tsup.config.ts +22 -0
- package/templates/plugin/vitest.config.ts +8 -0
- package/dist/chunk-XMNVVIVZ.mjs.map +0 -1
package/dist/cli.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var module$1 = require('module');
|
|
5
|
-
var
|
|
5
|
+
var path15 = require('path');
|
|
6
6
|
var fs = require('fs');
|
|
7
7
|
var k = require('readline');
|
|
8
8
|
var async_hooks = require('async_hooks');
|
|
@@ -45,7 +45,7 @@ function _interopNamespace(e) {
|
|
|
45
45
|
return Object.freeze(n);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var path15__default = /*#__PURE__*/_interopDefault(path15);
|
|
49
49
|
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
50
50
|
var k__namespace = /*#__PURE__*/_interopNamespace(k);
|
|
51
51
|
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
@@ -6259,7 +6259,7 @@ var require_package = __commonJS({
|
|
|
6259
6259
|
"package.json"(exports$1, module) {
|
|
6260
6260
|
module.exports = {
|
|
6261
6261
|
name: "create-nextly-app",
|
|
6262
|
-
version: "0.0.2-alpha.
|
|
6262
|
+
version: "0.0.2-alpha.29",
|
|
6263
6263
|
description: "CLI to scaffold Nextly in your Next.js project",
|
|
6264
6264
|
license: "MIT",
|
|
6265
6265
|
type: "module",
|
|
@@ -13764,7 +13764,7 @@ var require_dist = __commonJS2({
|
|
|
13764
13764
|
}
|
|
13765
13765
|
});
|
|
13766
13766
|
var require_constants = __commonJS2({
|
|
13767
|
-
"../../node_modules/.pnpm/semver@7.
|
|
13767
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/constants.js"(exports$1, module) {
|
|
13768
13768
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
13769
13769
|
var MAX_LENGTH = 256;
|
|
13770
13770
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
@@ -13793,14 +13793,14 @@ var require_constants = __commonJS2({
|
|
|
13793
13793
|
}
|
|
13794
13794
|
});
|
|
13795
13795
|
var require_debug = __commonJS2({
|
|
13796
|
-
"../../node_modules/.pnpm/semver@7.
|
|
13796
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/debug.js"(exports$1, module) {
|
|
13797
13797
|
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
13798
13798
|
};
|
|
13799
13799
|
module.exports = debug;
|
|
13800
13800
|
}
|
|
13801
13801
|
});
|
|
13802
13802
|
var require_re = __commonJS2({
|
|
13803
|
-
"../../node_modules/.pnpm/semver@7.
|
|
13803
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/re.js"(exports$1, module) {
|
|
13804
13804
|
var {
|
|
13805
13805
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
13806
13806
|
MAX_SAFE_BUILD_LENGTH,
|
|
@@ -13885,7 +13885,7 @@ var require_re = __commonJS2({
|
|
|
13885
13885
|
}
|
|
13886
13886
|
});
|
|
13887
13887
|
var require_parse_options = __commonJS2({
|
|
13888
|
-
"../../node_modules/.pnpm/semver@7.
|
|
13888
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/parse-options.js"(exports$1, module) {
|
|
13889
13889
|
var looseOption = Object.freeze({ loose: true });
|
|
13890
13890
|
var emptyOpts = Object.freeze({});
|
|
13891
13891
|
var parseOptions = (options) => {
|
|
@@ -13901,9 +13901,12 @@ var require_parse_options = __commonJS2({
|
|
|
13901
13901
|
}
|
|
13902
13902
|
});
|
|
13903
13903
|
var require_identifiers = __commonJS2({
|
|
13904
|
-
"../../node_modules/.pnpm/semver@7.
|
|
13904
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/identifiers.js"(exports$1, module) {
|
|
13905
13905
|
var numeric = /^[0-9]+$/;
|
|
13906
13906
|
var compareIdentifiers = (a2, b2) => {
|
|
13907
|
+
if (typeof a2 === "number" && typeof b2 === "number") {
|
|
13908
|
+
return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;
|
|
13909
|
+
}
|
|
13907
13910
|
const anum = numeric.test(a2);
|
|
13908
13911
|
const bnum = numeric.test(b2);
|
|
13909
13912
|
if (anum && bnum) {
|
|
@@ -13920,7 +13923,7 @@ var require_identifiers = __commonJS2({
|
|
|
13920
13923
|
}
|
|
13921
13924
|
});
|
|
13922
13925
|
var require_semver = __commonJS2({
|
|
13923
|
-
"../../node_modules/.pnpm/semver@7.
|
|
13926
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/semver.js"(exports$1, module) {
|
|
13924
13927
|
var debug = require_debug();
|
|
13925
13928
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
13926
13929
|
var { safeRe: re3, t: t2 } = require_re();
|
|
@@ -14007,7 +14010,25 @@ var require_semver = __commonJS2({
|
|
|
14007
14010
|
if (!(other instanceof _SemVer)) {
|
|
14008
14011
|
other = new _SemVer(other, this.options);
|
|
14009
14012
|
}
|
|
14010
|
-
|
|
14013
|
+
if (this.major < other.major) {
|
|
14014
|
+
return -1;
|
|
14015
|
+
}
|
|
14016
|
+
if (this.major > other.major) {
|
|
14017
|
+
return 1;
|
|
14018
|
+
}
|
|
14019
|
+
if (this.minor < other.minor) {
|
|
14020
|
+
return -1;
|
|
14021
|
+
}
|
|
14022
|
+
if (this.minor > other.minor) {
|
|
14023
|
+
return 1;
|
|
14024
|
+
}
|
|
14025
|
+
if (this.patch < other.patch) {
|
|
14026
|
+
return -1;
|
|
14027
|
+
}
|
|
14028
|
+
if (this.patch > other.patch) {
|
|
14029
|
+
return 1;
|
|
14030
|
+
}
|
|
14031
|
+
return 0;
|
|
14011
14032
|
}
|
|
14012
14033
|
comparePre(other) {
|
|
14013
14034
|
if (!(other instanceof _SemVer)) {
|
|
@@ -14178,7 +14199,7 @@ var require_semver = __commonJS2({
|
|
|
14178
14199
|
}
|
|
14179
14200
|
});
|
|
14180
14201
|
var require_parse = __commonJS2({
|
|
14181
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14202
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/parse.js"(exports$1, module) {
|
|
14182
14203
|
var SemVer = require_semver();
|
|
14183
14204
|
var parse = (version2, options, throwErrors = false) => {
|
|
14184
14205
|
if (version2 instanceof SemVer) {
|
|
@@ -14197,7 +14218,7 @@ var require_parse = __commonJS2({
|
|
|
14197
14218
|
}
|
|
14198
14219
|
});
|
|
14199
14220
|
var require_valid = __commonJS2({
|
|
14200
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14221
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/valid.js"(exports$1, module) {
|
|
14201
14222
|
var parse = require_parse();
|
|
14202
14223
|
var valid = (version2, options) => {
|
|
14203
14224
|
const v2 = parse(version2, options);
|
|
@@ -14207,7 +14228,7 @@ var require_valid = __commonJS2({
|
|
|
14207
14228
|
}
|
|
14208
14229
|
});
|
|
14209
14230
|
var require_clean = __commonJS2({
|
|
14210
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14231
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/clean.js"(exports$1, module) {
|
|
14211
14232
|
var parse = require_parse();
|
|
14212
14233
|
var clean = (version2, options) => {
|
|
14213
14234
|
const s3 = parse(version2.trim().replace(/^[=v]+/, ""), options);
|
|
@@ -14217,7 +14238,7 @@ var require_clean = __commonJS2({
|
|
|
14217
14238
|
}
|
|
14218
14239
|
});
|
|
14219
14240
|
var require_inc = __commonJS2({
|
|
14220
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14241
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/inc.js"(exports$1, module) {
|
|
14221
14242
|
var SemVer = require_semver();
|
|
14222
14243
|
var inc = (version2, release, options, identifier, identifierBase) => {
|
|
14223
14244
|
if (typeof options === "string") {
|
|
@@ -14238,7 +14259,7 @@ var require_inc = __commonJS2({
|
|
|
14238
14259
|
}
|
|
14239
14260
|
});
|
|
14240
14261
|
var require_diff = __commonJS2({
|
|
14241
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14262
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/diff.js"(exports$1, module) {
|
|
14242
14263
|
var parse = require_parse();
|
|
14243
14264
|
var diff = (version1, version2) => {
|
|
14244
14265
|
const v1 = parse(version1, null, true);
|
|
@@ -14279,28 +14300,28 @@ var require_diff = __commonJS2({
|
|
|
14279
14300
|
}
|
|
14280
14301
|
});
|
|
14281
14302
|
var require_major = __commonJS2({
|
|
14282
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14303
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/major.js"(exports$1, module) {
|
|
14283
14304
|
var SemVer = require_semver();
|
|
14284
14305
|
var major = (a2, loose) => new SemVer(a2, loose).major;
|
|
14285
14306
|
module.exports = major;
|
|
14286
14307
|
}
|
|
14287
14308
|
});
|
|
14288
14309
|
var require_minor = __commonJS2({
|
|
14289
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14310
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/minor.js"(exports$1, module) {
|
|
14290
14311
|
var SemVer = require_semver();
|
|
14291
14312
|
var minor = (a2, loose) => new SemVer(a2, loose).minor;
|
|
14292
14313
|
module.exports = minor;
|
|
14293
14314
|
}
|
|
14294
14315
|
});
|
|
14295
14316
|
var require_patch = __commonJS2({
|
|
14296
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14317
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/patch.js"(exports$1, module) {
|
|
14297
14318
|
var SemVer = require_semver();
|
|
14298
14319
|
var patch = (a2, loose) => new SemVer(a2, loose).patch;
|
|
14299
14320
|
module.exports = patch;
|
|
14300
14321
|
}
|
|
14301
14322
|
});
|
|
14302
14323
|
var require_prerelease = __commonJS2({
|
|
14303
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14324
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/prerelease.js"(exports$1, module) {
|
|
14304
14325
|
var parse = require_parse();
|
|
14305
14326
|
var prerelease = (version2, options) => {
|
|
14306
14327
|
const parsed = parse(version2, options);
|
|
@@ -14310,28 +14331,28 @@ var require_prerelease = __commonJS2({
|
|
|
14310
14331
|
}
|
|
14311
14332
|
});
|
|
14312
14333
|
var require_compare = __commonJS2({
|
|
14313
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14334
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare.js"(exports$1, module) {
|
|
14314
14335
|
var SemVer = require_semver();
|
|
14315
14336
|
var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose));
|
|
14316
14337
|
module.exports = compare;
|
|
14317
14338
|
}
|
|
14318
14339
|
});
|
|
14319
14340
|
var require_rcompare = __commonJS2({
|
|
14320
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14341
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rcompare.js"(exports$1, module) {
|
|
14321
14342
|
var compare = require_compare();
|
|
14322
14343
|
var rcompare = (a2, b2, loose) => compare(b2, a2, loose);
|
|
14323
14344
|
module.exports = rcompare;
|
|
14324
14345
|
}
|
|
14325
14346
|
});
|
|
14326
14347
|
var require_compare_loose = __commonJS2({
|
|
14327
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14348
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-loose.js"(exports$1, module) {
|
|
14328
14349
|
var compare = require_compare();
|
|
14329
14350
|
var compareLoose = (a2, b2) => compare(a2, b2, true);
|
|
14330
14351
|
module.exports = compareLoose;
|
|
14331
14352
|
}
|
|
14332
14353
|
});
|
|
14333
14354
|
var require_compare_build = __commonJS2({
|
|
14334
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14355
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-build.js"(exports$1, module) {
|
|
14335
14356
|
var SemVer = require_semver();
|
|
14336
14357
|
var compareBuild = (a2, b2, loose) => {
|
|
14337
14358
|
const versionA = new SemVer(a2, loose);
|
|
@@ -14342,63 +14363,63 @@ var require_compare_build = __commonJS2({
|
|
|
14342
14363
|
}
|
|
14343
14364
|
});
|
|
14344
14365
|
var require_sort = __commonJS2({
|
|
14345
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14366
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/sort.js"(exports$1, module) {
|
|
14346
14367
|
var compareBuild = require_compare_build();
|
|
14347
14368
|
var sort = (list, loose) => list.sort((a2, b2) => compareBuild(a2, b2, loose));
|
|
14348
14369
|
module.exports = sort;
|
|
14349
14370
|
}
|
|
14350
14371
|
});
|
|
14351
14372
|
var require_rsort = __commonJS2({
|
|
14352
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14373
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rsort.js"(exports$1, module) {
|
|
14353
14374
|
var compareBuild = require_compare_build();
|
|
14354
14375
|
var rsort = (list, loose) => list.sort((a2, b2) => compareBuild(b2, a2, loose));
|
|
14355
14376
|
module.exports = rsort;
|
|
14356
14377
|
}
|
|
14357
14378
|
});
|
|
14358
14379
|
var require_gt = __commonJS2({
|
|
14359
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14380
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gt.js"(exports$1, module) {
|
|
14360
14381
|
var compare = require_compare();
|
|
14361
14382
|
var gt4 = (a2, b2, loose) => compare(a2, b2, loose) > 0;
|
|
14362
14383
|
module.exports = gt4;
|
|
14363
14384
|
}
|
|
14364
14385
|
});
|
|
14365
14386
|
var require_lt = __commonJS2({
|
|
14366
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14387
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lt.js"(exports$1, module) {
|
|
14367
14388
|
var compare = require_compare();
|
|
14368
14389
|
var lt3 = (a2, b2, loose) => compare(a2, b2, loose) < 0;
|
|
14369
14390
|
module.exports = lt3;
|
|
14370
14391
|
}
|
|
14371
14392
|
});
|
|
14372
14393
|
var require_eq = __commonJS2({
|
|
14373
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14394
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/eq.js"(exports$1, module) {
|
|
14374
14395
|
var compare = require_compare();
|
|
14375
14396
|
var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0;
|
|
14376
14397
|
module.exports = eq;
|
|
14377
14398
|
}
|
|
14378
14399
|
});
|
|
14379
14400
|
var require_neq = __commonJS2({
|
|
14380
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14401
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/neq.js"(exports$1, module) {
|
|
14381
14402
|
var compare = require_compare();
|
|
14382
14403
|
var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0;
|
|
14383
14404
|
module.exports = neq;
|
|
14384
14405
|
}
|
|
14385
14406
|
});
|
|
14386
14407
|
var require_gte = __commonJS2({
|
|
14387
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14408
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gte.js"(exports$1, module) {
|
|
14388
14409
|
var compare = require_compare();
|
|
14389
14410
|
var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0;
|
|
14390
14411
|
module.exports = gte;
|
|
14391
14412
|
}
|
|
14392
14413
|
});
|
|
14393
14414
|
var require_lte = __commonJS2({
|
|
14394
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14415
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lte.js"(exports$1, module) {
|
|
14395
14416
|
var compare = require_compare();
|
|
14396
14417
|
var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0;
|
|
14397
14418
|
module.exports = lte;
|
|
14398
14419
|
}
|
|
14399
14420
|
});
|
|
14400
14421
|
var require_cmp = __commonJS2({
|
|
14401
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14422
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/cmp.js"(exports$1, module) {
|
|
14402
14423
|
var eq = require_eq();
|
|
14403
14424
|
var neq = require_neq();
|
|
14404
14425
|
var gt4 = require_gt();
|
|
@@ -14445,7 +14466,7 @@ var require_cmp = __commonJS2({
|
|
|
14445
14466
|
}
|
|
14446
14467
|
});
|
|
14447
14468
|
var require_coerce = __commonJS2({
|
|
14448
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14469
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/coerce.js"(exports$1, module) {
|
|
14449
14470
|
var SemVer = require_semver();
|
|
14450
14471
|
var parse = require_parse();
|
|
14451
14472
|
var { safeRe: re3, t: t2 } = require_re();
|
|
@@ -14487,8 +14508,46 @@ var require_coerce = __commonJS2({
|
|
|
14487
14508
|
module.exports = coerce;
|
|
14488
14509
|
}
|
|
14489
14510
|
});
|
|
14511
|
+
var require_truncate = __commonJS2({
|
|
14512
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/truncate.js"(exports$1, module) {
|
|
14513
|
+
var parse = require_parse();
|
|
14514
|
+
var constants4 = require_constants();
|
|
14515
|
+
var SemVer = require_semver();
|
|
14516
|
+
var truncate = (version2, truncation, options) => {
|
|
14517
|
+
if (!constants4.RELEASE_TYPES.includes(truncation)) {
|
|
14518
|
+
return null;
|
|
14519
|
+
}
|
|
14520
|
+
const clonedVersion = cloneInputVersion(version2, options);
|
|
14521
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
14522
|
+
};
|
|
14523
|
+
var cloneInputVersion = (version2, options) => {
|
|
14524
|
+
const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
|
|
14525
|
+
return parse(versionStringToParse, options);
|
|
14526
|
+
};
|
|
14527
|
+
var doTruncation = (version2, truncation) => {
|
|
14528
|
+
if (isPrerelease(truncation)) {
|
|
14529
|
+
return version2.version;
|
|
14530
|
+
}
|
|
14531
|
+
version2.prerelease = [];
|
|
14532
|
+
switch (truncation) {
|
|
14533
|
+
case "major":
|
|
14534
|
+
version2.minor = 0;
|
|
14535
|
+
version2.patch = 0;
|
|
14536
|
+
break;
|
|
14537
|
+
case "minor":
|
|
14538
|
+
version2.patch = 0;
|
|
14539
|
+
break;
|
|
14540
|
+
}
|
|
14541
|
+
return version2.format();
|
|
14542
|
+
};
|
|
14543
|
+
var isPrerelease = (type) => {
|
|
14544
|
+
return type.startsWith("pre");
|
|
14545
|
+
};
|
|
14546
|
+
module.exports = truncate;
|
|
14547
|
+
}
|
|
14548
|
+
});
|
|
14490
14549
|
var require_lrucache = __commonJS2({
|
|
14491
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14550
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/lrucache.js"(exports$1, module) {
|
|
14492
14551
|
var LRUCache = class {
|
|
14493
14552
|
constructor() {
|
|
14494
14553
|
this.max = 1e3;
|
|
@@ -14523,7 +14582,7 @@ var require_lrucache = __commonJS2({
|
|
|
14523
14582
|
}
|
|
14524
14583
|
});
|
|
14525
14584
|
var require_range = __commonJS2({
|
|
14526
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14585
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/range.js"(exports$1, module) {
|
|
14527
14586
|
var SPACE_CHARACTERS = /\s+/g;
|
|
14528
14587
|
var Range = class _Range {
|
|
14529
14588
|
constructor(range, options) {
|
|
@@ -14693,6 +14752,7 @@ var require_range = __commonJS2({
|
|
|
14693
14752
|
return result;
|
|
14694
14753
|
};
|
|
14695
14754
|
var parseComparator = (comp, options) => {
|
|
14755
|
+
comp = comp.replace(re3[t2.BUILD], "");
|
|
14696
14756
|
debug("comp", comp, options);
|
|
14697
14757
|
comp = replaceCarets(comp, options);
|
|
14698
14758
|
debug("caret", comp);
|
|
@@ -14896,7 +14956,7 @@ var require_range = __commonJS2({
|
|
|
14896
14956
|
}
|
|
14897
14957
|
});
|
|
14898
14958
|
var require_comparator = __commonJS2({
|
|
14899
|
-
"../../node_modules/.pnpm/semver@7.
|
|
14959
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/comparator.js"(exports$1, module) {
|
|
14900
14960
|
var ANY = Symbol("SemVer ANY");
|
|
14901
14961
|
var Comparator = class _Comparator {
|
|
14902
14962
|
static get ANY() {
|
|
@@ -15006,7 +15066,7 @@ var require_comparator = __commonJS2({
|
|
|
15006
15066
|
}
|
|
15007
15067
|
});
|
|
15008
15068
|
var require_satisfies = __commonJS2({
|
|
15009
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15069
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/satisfies.js"(exports$1, module) {
|
|
15010
15070
|
var Range = require_range();
|
|
15011
15071
|
var satisfies = (version2, range, options) => {
|
|
15012
15072
|
try {
|
|
@@ -15020,14 +15080,14 @@ var require_satisfies = __commonJS2({
|
|
|
15020
15080
|
}
|
|
15021
15081
|
});
|
|
15022
15082
|
var require_to_comparators = __commonJS2({
|
|
15023
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15083
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/to-comparators.js"(exports$1, module) {
|
|
15024
15084
|
var Range = require_range();
|
|
15025
15085
|
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c3) => c3.value).join(" ").trim().split(" "));
|
|
15026
15086
|
module.exports = toComparators;
|
|
15027
15087
|
}
|
|
15028
15088
|
});
|
|
15029
15089
|
var require_max_satisfying = __commonJS2({
|
|
15030
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15090
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/max-satisfying.js"(exports$1, module) {
|
|
15031
15091
|
var SemVer = require_semver();
|
|
15032
15092
|
var Range = require_range();
|
|
15033
15093
|
var maxSatisfying = (versions, range, options) => {
|
|
@@ -15053,7 +15113,7 @@ var require_max_satisfying = __commonJS2({
|
|
|
15053
15113
|
}
|
|
15054
15114
|
});
|
|
15055
15115
|
var require_min_satisfying = __commonJS2({
|
|
15056
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15116
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-satisfying.js"(exports$1, module) {
|
|
15057
15117
|
var SemVer = require_semver();
|
|
15058
15118
|
var Range = require_range();
|
|
15059
15119
|
var minSatisfying = (versions, range, options) => {
|
|
@@ -15079,7 +15139,7 @@ var require_min_satisfying = __commonJS2({
|
|
|
15079
15139
|
}
|
|
15080
15140
|
});
|
|
15081
15141
|
var require_min_version = __commonJS2({
|
|
15082
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15142
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-version.js"(exports$1, module) {
|
|
15083
15143
|
var SemVer = require_semver();
|
|
15084
15144
|
var Range = require_range();
|
|
15085
15145
|
var gt4 = require_gt();
|
|
@@ -15135,7 +15195,7 @@ var require_min_version = __commonJS2({
|
|
|
15135
15195
|
}
|
|
15136
15196
|
});
|
|
15137
15197
|
var require_valid2 = __commonJS2({
|
|
15138
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15198
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/valid.js"(exports$1, module) {
|
|
15139
15199
|
var Range = require_range();
|
|
15140
15200
|
var validRange = (range, options) => {
|
|
15141
15201
|
try {
|
|
@@ -15148,7 +15208,7 @@ var require_valid2 = __commonJS2({
|
|
|
15148
15208
|
}
|
|
15149
15209
|
});
|
|
15150
15210
|
var require_outside = __commonJS2({
|
|
15151
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15211
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/outside.js"(exports$1, module) {
|
|
15152
15212
|
var SemVer = require_semver();
|
|
15153
15213
|
var Comparator = require_comparator();
|
|
15154
15214
|
var { ANY } = Comparator;
|
|
@@ -15214,21 +15274,21 @@ var require_outside = __commonJS2({
|
|
|
15214
15274
|
}
|
|
15215
15275
|
});
|
|
15216
15276
|
var require_gtr = __commonJS2({
|
|
15217
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15277
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/gtr.js"(exports$1, module) {
|
|
15218
15278
|
var outside = require_outside();
|
|
15219
15279
|
var gtr = (version2, range, options) => outside(version2, range, ">", options);
|
|
15220
15280
|
module.exports = gtr;
|
|
15221
15281
|
}
|
|
15222
15282
|
});
|
|
15223
15283
|
var require_ltr = __commonJS2({
|
|
15224
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15284
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/ltr.js"(exports$1, module) {
|
|
15225
15285
|
var outside = require_outside();
|
|
15226
15286
|
var ltr = (version2, range, options) => outside(version2, range, "<", options);
|
|
15227
15287
|
module.exports = ltr;
|
|
15228
15288
|
}
|
|
15229
15289
|
});
|
|
15230
15290
|
var require_intersects = __commonJS2({
|
|
15231
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15291
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/intersects.js"(exports$1, module) {
|
|
15232
15292
|
var Range = require_range();
|
|
15233
15293
|
var intersects = (r1, r2, options) => {
|
|
15234
15294
|
r1 = new Range(r1, options);
|
|
@@ -15239,7 +15299,7 @@ var require_intersects = __commonJS2({
|
|
|
15239
15299
|
}
|
|
15240
15300
|
});
|
|
15241
15301
|
var require_simplify = __commonJS2({
|
|
15242
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15302
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/simplify.js"(exports$1, module) {
|
|
15243
15303
|
var satisfies = require_satisfies();
|
|
15244
15304
|
var compare = require_compare();
|
|
15245
15305
|
module.exports = (versions, range, options) => {
|
|
@@ -15286,7 +15346,7 @@ var require_simplify = __commonJS2({
|
|
|
15286
15346
|
}
|
|
15287
15347
|
});
|
|
15288
15348
|
var require_subset = __commonJS2({
|
|
15289
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15349
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/subset.js"(exports$1, module) {
|
|
15290
15350
|
var Range = require_range();
|
|
15291
15351
|
var Comparator = require_comparator();
|
|
15292
15352
|
var { ANY } = Comparator;
|
|
@@ -15445,7 +15505,7 @@ var require_subset = __commonJS2({
|
|
|
15445
15505
|
}
|
|
15446
15506
|
});
|
|
15447
15507
|
var require_semver2 = __commonJS2({
|
|
15448
|
-
"../../node_modules/.pnpm/semver@7.
|
|
15508
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/index.js"(exports$1, module) {
|
|
15449
15509
|
var internalRe = require_re();
|
|
15450
15510
|
var constants4 = require_constants();
|
|
15451
15511
|
var SemVer = require_semver();
|
|
@@ -15473,6 +15533,7 @@ var require_semver2 = __commonJS2({
|
|
|
15473
15533
|
var lte = require_lte();
|
|
15474
15534
|
var cmp = require_cmp();
|
|
15475
15535
|
var coerce = require_coerce();
|
|
15536
|
+
var truncate = require_truncate();
|
|
15476
15537
|
var Comparator = require_comparator();
|
|
15477
15538
|
var Range = require_range();
|
|
15478
15539
|
var satisfies = require_satisfies();
|
|
@@ -15511,6 +15572,7 @@ var require_semver2 = __commonJS2({
|
|
|
15511
15572
|
lte,
|
|
15512
15573
|
cmp,
|
|
15513
15574
|
coerce,
|
|
15575
|
+
truncate,
|
|
15514
15576
|
Comparator,
|
|
15515
15577
|
Range,
|
|
15516
15578
|
satisfies,
|
|
@@ -15568,12 +15630,12 @@ function createModulerModifier() {
|
|
|
15568
15630
|
return frames;
|
|
15569
15631
|
};
|
|
15570
15632
|
}
|
|
15571
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
15633
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? path15.dirname(process.argv[1]) : process.cwd(), isWindows = "\\" === path15.sep) {
|
|
15572
15634
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
15573
15635
|
return (filename) => {
|
|
15574
15636
|
if (!filename) return;
|
|
15575
15637
|
const normalizedFilename = isWindows ? normalizeWindowsPath(filename) : filename;
|
|
15576
|
-
let { dir, base: file, ext } =
|
|
15638
|
+
let { dir, base: file, ext } = path15.posix.parse(normalizedFilename);
|
|
15577
15639
|
if (".js" === ext || ".mjs" === ext || ".cjs" === ext) file = file.slice(0, -1 * ext.length);
|
|
15578
15640
|
const decodedFile = decodeURIComponent(file);
|
|
15579
15641
|
if (!dir) dir = ".";
|
|
@@ -19499,36 +19561,36 @@ var homedir = os__default.default.homedir();
|
|
|
19499
19561
|
var tmpdir = os__default.default.tmpdir();
|
|
19500
19562
|
var { env } = process4__default.default;
|
|
19501
19563
|
var macos = (name) => {
|
|
19502
|
-
const library =
|
|
19564
|
+
const library = path15__default.default.join(homedir, "Library");
|
|
19503
19565
|
return {
|
|
19504
|
-
data:
|
|
19505
|
-
config:
|
|
19506
|
-
cache:
|
|
19507
|
-
log:
|
|
19508
|
-
temp:
|
|
19566
|
+
data: path15__default.default.join(library, "Application Support", name),
|
|
19567
|
+
config: path15__default.default.join(library, "Preferences", name),
|
|
19568
|
+
cache: path15__default.default.join(library, "Caches", name),
|
|
19569
|
+
log: path15__default.default.join(library, "Logs", name),
|
|
19570
|
+
temp: path15__default.default.join(tmpdir, name)
|
|
19509
19571
|
};
|
|
19510
19572
|
};
|
|
19511
19573
|
var windows = (name) => {
|
|
19512
|
-
const appData = env.APPDATA ||
|
|
19513
|
-
const localAppData = env.LOCALAPPDATA ||
|
|
19574
|
+
const appData = env.APPDATA || path15__default.default.join(homedir, "AppData", "Roaming");
|
|
19575
|
+
const localAppData = env.LOCALAPPDATA || path15__default.default.join(homedir, "AppData", "Local");
|
|
19514
19576
|
return {
|
|
19515
19577
|
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
19516
|
-
data:
|
|
19517
|
-
config:
|
|
19518
|
-
cache:
|
|
19519
|
-
log:
|
|
19520
|
-
temp:
|
|
19578
|
+
data: path15__default.default.join(localAppData, name, "Data"),
|
|
19579
|
+
config: path15__default.default.join(appData, name, "Config"),
|
|
19580
|
+
cache: path15__default.default.join(localAppData, name, "Cache"),
|
|
19581
|
+
log: path15__default.default.join(localAppData, name, "Log"),
|
|
19582
|
+
temp: path15__default.default.join(tmpdir, name)
|
|
19521
19583
|
};
|
|
19522
19584
|
};
|
|
19523
19585
|
var linux = (name) => {
|
|
19524
|
-
const username =
|
|
19586
|
+
const username = path15__default.default.basename(homedir);
|
|
19525
19587
|
return {
|
|
19526
|
-
data:
|
|
19527
|
-
config:
|
|
19528
|
-
cache:
|
|
19588
|
+
data: path15__default.default.join(env.XDG_DATA_HOME || path15__default.default.join(homedir, ".local", "share"), name),
|
|
19589
|
+
config: path15__default.default.join(env.XDG_CONFIG_HOME || path15__default.default.join(homedir, ".config"), name),
|
|
19590
|
+
cache: path15__default.default.join(env.XDG_CACHE_HOME || path15__default.default.join(homedir, ".cache"), name),
|
|
19529
19591
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
19530
|
-
log:
|
|
19531
|
-
temp:
|
|
19592
|
+
log: path15__default.default.join(env.XDG_STATE_HOME || path15__default.default.join(homedir, ".local", "state"), name),
|
|
19593
|
+
temp: path15__default.default.join(tmpdir, username, name)
|
|
19532
19594
|
};
|
|
19533
19595
|
};
|
|
19534
19596
|
function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
@@ -19805,7 +19867,7 @@ var Temp = {
|
|
|
19805
19867
|
}
|
|
19806
19868
|
},
|
|
19807
19869
|
truncate: (filePath) => {
|
|
19808
|
-
const basename =
|
|
19870
|
+
const basename = path15__default.default.basename(filePath);
|
|
19809
19871
|
if (basename.length <= LIMIT_BASENAME_LENGTH)
|
|
19810
19872
|
return filePath;
|
|
19811
19873
|
const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
|
|
@@ -19845,7 +19907,7 @@ function writeFileSync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {
|
|
|
19845
19907
|
}
|
|
19846
19908
|
}
|
|
19847
19909
|
if (!filePathExists) {
|
|
19848
|
-
const parentPath =
|
|
19910
|
+
const parentPath = path15__default.default.dirname(filePath);
|
|
19849
19911
|
dist_default.attempt.mkdirSync(parentPath, {
|
|
19850
19912
|
mode: DEFAULT_FOLDER_MODE,
|
|
19851
19913
|
recursive: true
|
|
@@ -20148,7 +20210,7 @@ var Conf = class {
|
|
|
20148
20210
|
this.events = new EventTarget();
|
|
20149
20211
|
this.#encryptionKey = options.encryptionKey;
|
|
20150
20212
|
const fileExtension = options.fileExtension ? `.${options.fileExtension}` : "";
|
|
20151
|
-
this.path =
|
|
20213
|
+
this.path = path15__default.default.resolve(options.cwd, `${options.configName ?? "config"}${fileExtension}`);
|
|
20152
20214
|
const fileStore = this.store;
|
|
20153
20215
|
const store = Object.assign(createPlainObject(), options.defaults, fileStore);
|
|
20154
20216
|
if (options.migrations) {
|
|
@@ -20353,7 +20415,7 @@ var Conf = class {
|
|
|
20353
20415
|
throw new Error("Config schema violation: " + errors.join("; "));
|
|
20354
20416
|
}
|
|
20355
20417
|
_ensureDirectory() {
|
|
20356
|
-
fs__default.default.mkdirSync(
|
|
20418
|
+
fs__default.default.mkdirSync(path15__default.default.dirname(this.path), { recursive: true });
|
|
20357
20419
|
}
|
|
20358
20420
|
_write(value) {
|
|
20359
20421
|
let data = this._serialize(value);
|
|
@@ -20690,7 +20752,7 @@ function resolveProjectArg(directory) {
|
|
|
20690
20752
|
if (trimmed === "." || trimmed === "./") {
|
|
20691
20753
|
return { projectName: void 0, installInCwd: true };
|
|
20692
20754
|
}
|
|
20693
|
-
return { projectName:
|
|
20755
|
+
return { projectName: path15__default.default.basename(trimmed), installInCwd: false };
|
|
20694
20756
|
}
|
|
20695
20757
|
function validateProjectName(name) {
|
|
20696
20758
|
if (!/^[a-z0-9][a-z0-9._-]*$/.test(name)) {
|
|
@@ -20703,7 +20765,7 @@ function validateProjectNamePromptInput(value) {
|
|
|
20703
20765
|
if (trimmed === "") return void 0;
|
|
20704
20766
|
if (trimmed === "." || trimmed === "./") return void 0;
|
|
20705
20767
|
const candidate = trimmed.startsWith("./") ? trimmed.slice(2) : trimmed;
|
|
20706
|
-
return validateProjectName(
|
|
20768
|
+
return validateProjectName(path15__default.default.basename(candidate));
|
|
20707
20769
|
}
|
|
20708
20770
|
|
|
20709
20771
|
// ../../node_modules/.pnpm/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
|
|
@@ -21636,9 +21698,9 @@ export default function AdminLayout({
|
|
|
21636
21698
|
`;
|
|
21637
21699
|
}
|
|
21638
21700
|
async function generateAdminPage(cwd, projectInfo) {
|
|
21639
|
-
const adminDir =
|
|
21640
|
-
const pagePath =
|
|
21641
|
-
const layoutPath =
|
|
21701
|
+
const adminDir = path15__default.default.join(cwd, projectInfo.appDir, "admin", "[[...params]]");
|
|
21702
|
+
const pagePath = path15__default.default.join(adminDir, "page.tsx");
|
|
21703
|
+
const layoutPath = path15__default.default.join(adminDir, "layout.tsx");
|
|
21642
21704
|
if (await import_fs_extra.default.pathExists(pagePath)) {
|
|
21643
21705
|
throw new Error(
|
|
21644
21706
|
"Admin page already exists at admin/[[...params]]/page.tsx"
|
|
@@ -21691,7 +21753,7 @@ ${singlesLine}
|
|
|
21691
21753
|
return template;
|
|
21692
21754
|
}
|
|
21693
21755
|
async function generateConfig(cwd, projectType) {
|
|
21694
|
-
const configPath =
|
|
21756
|
+
const configPath = path15__default.default.join(cwd, "nextly.config.ts");
|
|
21695
21757
|
if (await import_fs_extra2.default.pathExists(configPath)) {
|
|
21696
21758
|
throw new Error(
|
|
21697
21759
|
"nextly.config.ts already exists. Please remove it first or run in a fresh project."
|
|
@@ -21722,8 +21784,8 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
|
21722
21784
|
`;
|
|
21723
21785
|
}
|
|
21724
21786
|
async function generateEnv(cwd, database) {
|
|
21725
|
-
const envPath =
|
|
21726
|
-
const envExamplePath =
|
|
21787
|
+
const envPath = path15__default.default.join(cwd, ".env");
|
|
21788
|
+
const envExamplePath = path15__default.default.join(cwd, ".env.example");
|
|
21727
21789
|
const envContent = getEnvTemplate(database);
|
|
21728
21790
|
await import_fs_extra3.default.writeFile(envExamplePath, envContent, "utf-8");
|
|
21729
21791
|
if (await import_fs_extra3.default.pathExists(envPath)) {
|
|
@@ -21787,25 +21849,25 @@ var HEALTH_ROUTE_TEMPLATE = `/**
|
|
|
21787
21849
|
export { GET, HEAD } from "nextly/api/health";
|
|
21788
21850
|
`;
|
|
21789
21851
|
async function generateMediaRoutes(cwd, projectInfo) {
|
|
21790
|
-
const apiDir =
|
|
21791
|
-
const mediaDir =
|
|
21852
|
+
const apiDir = path15__default.default.join(cwd, projectInfo.appDir, "api");
|
|
21853
|
+
const mediaDir = path15__default.default.join(apiDir, "media");
|
|
21792
21854
|
if (await import_fs_extra4.default.pathExists(mediaDir)) {
|
|
21793
21855
|
throw new Error(
|
|
21794
21856
|
"Media API routes already exist at api/media. Please remove them first."
|
|
21795
21857
|
);
|
|
21796
21858
|
}
|
|
21797
|
-
const mediaRoutePath =
|
|
21859
|
+
const mediaRoutePath = path15__default.default.join(apiDir, "media", "[[...path]]", "route.ts");
|
|
21798
21860
|
const configImportPath = getConfigImportPath(
|
|
21799
21861
|
projectInfo.appDir.startsWith("src")
|
|
21800
21862
|
);
|
|
21801
|
-
await import_fs_extra4.default.ensureDir(
|
|
21863
|
+
await import_fs_extra4.default.ensureDir(path15__default.default.dirname(mediaRoutePath));
|
|
21802
21864
|
await import_fs_extra4.default.writeFile(
|
|
21803
21865
|
mediaRoutePath,
|
|
21804
21866
|
MEDIA_CATCH_ALL_TEMPLATE(configImportPath),
|
|
21805
21867
|
"utf-8"
|
|
21806
21868
|
);
|
|
21807
|
-
const healthRoutePath =
|
|
21808
|
-
await import_fs_extra4.default.ensureDir(
|
|
21869
|
+
const healthRoutePath = path15__default.default.join(apiDir, "health", "route.ts");
|
|
21870
|
+
await import_fs_extra4.default.ensureDir(path15__default.default.dirname(healthRoutePath));
|
|
21809
21871
|
await import_fs_extra4.default.writeFile(healthRoutePath, HEALTH_ROUTE_TEMPLATE, "utf-8");
|
|
21810
21872
|
}
|
|
21811
21873
|
|
|
@@ -21850,7 +21912,7 @@ async function patchNextConfig(cwd, database) {
|
|
|
21850
21912
|
const candidates = ["next.config.ts", "next.config.mjs", "next.config.js"];
|
|
21851
21913
|
let configPath = null;
|
|
21852
21914
|
for (const name of candidates) {
|
|
21853
|
-
const full =
|
|
21915
|
+
const full = path15__default.default.join(cwd, name);
|
|
21854
21916
|
if (await import_fs_extra5.default.pathExists(full)) {
|
|
21855
21917
|
configPath = full;
|
|
21856
21918
|
break;
|
|
@@ -21907,7 +21969,7 @@ export const DELETE = handlers.DELETE;
|
|
|
21907
21969
|
export const OPTIONS = handlers.OPTIONS;
|
|
21908
21970
|
`;
|
|
21909
21971
|
async function generateRoutes(cwd, projectInfo) {
|
|
21910
|
-
const routePath =
|
|
21972
|
+
const routePath = path15__default.default.join(
|
|
21911
21973
|
cwd,
|
|
21912
21974
|
projectInfo.appDir,
|
|
21913
21975
|
"admin",
|
|
@@ -21920,7 +21982,7 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
21920
21982
|
"API route already exists at admin/api/[[...params]]/route.ts"
|
|
21921
21983
|
);
|
|
21922
21984
|
}
|
|
21923
|
-
await import_fs_extra6.default.ensureDir(
|
|
21985
|
+
await import_fs_extra6.default.ensureDir(path15__default.default.dirname(routePath));
|
|
21924
21986
|
await import_fs_extra6.default.writeFile(routePath, API_ROUTE_TEMPLATE, "utf-8");
|
|
21925
21987
|
}
|
|
21926
21988
|
|
|
@@ -21928,13 +21990,13 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
21928
21990
|
var import_fs_extra7 = __toESM(require_lib());
|
|
21929
21991
|
async function generateTypesDirectory(cwd, projectInfo) {
|
|
21930
21992
|
const baseDir = projectInfo.srcDir ? "src" : ".";
|
|
21931
|
-
const typesDir =
|
|
21993
|
+
const typesDir = path15__default.default.join(cwd, baseDir, "types", "generated");
|
|
21932
21994
|
await import_fs_extra7.default.ensureDir(typesDir);
|
|
21933
|
-
const gitkeepPath =
|
|
21995
|
+
const gitkeepPath = path15__default.default.join(typesDir, ".gitkeep");
|
|
21934
21996
|
if (!await import_fs_extra7.default.pathExists(gitkeepPath)) {
|
|
21935
21997
|
await import_fs_extra7.default.writeFile(gitkeepPath, "", "utf-8");
|
|
21936
21998
|
}
|
|
21937
|
-
const placeholderPath =
|
|
21999
|
+
const placeholderPath = path15__default.default.join(typesDir, "nextly-types.ts");
|
|
21938
22000
|
if (!await import_fs_extra7.default.pathExists(placeholderPath)) {
|
|
21939
22001
|
const placeholderContent = `/**
|
|
21940
22002
|
* Nextly Generated Types
|
|
@@ -22745,12 +22807,12 @@ function toPath(urlOrPath) {
|
|
|
22745
22807
|
function traversePathUp(startPath) {
|
|
22746
22808
|
return {
|
|
22747
22809
|
*[Symbol.iterator]() {
|
|
22748
|
-
let currentPath =
|
|
22810
|
+
let currentPath = path15__default.default.resolve(toPath(startPath));
|
|
22749
22811
|
let previousPath;
|
|
22750
22812
|
while (previousPath !== currentPath) {
|
|
22751
22813
|
yield currentPath;
|
|
22752
22814
|
previousPath = currentPath;
|
|
22753
|
-
currentPath =
|
|
22815
|
+
currentPath = path15__default.default.resolve(currentPath, "..");
|
|
22754
22816
|
}
|
|
22755
22817
|
}
|
|
22756
22818
|
};
|
|
@@ -22764,27 +22826,27 @@ var npmRunPath = ({
|
|
|
22764
22826
|
execPath: execPath2 = process4__default.default.execPath,
|
|
22765
22827
|
addExecPath = true
|
|
22766
22828
|
} = {}) => {
|
|
22767
|
-
const cwdPath =
|
|
22829
|
+
const cwdPath = path15__default.default.resolve(toPath(cwd));
|
|
22768
22830
|
const result = [];
|
|
22769
|
-
const pathParts = pathOption.split(
|
|
22831
|
+
const pathParts = pathOption.split(path15__default.default.delimiter);
|
|
22770
22832
|
if (preferLocal) {
|
|
22771
22833
|
applyPreferLocal(result, pathParts, cwdPath);
|
|
22772
22834
|
}
|
|
22773
22835
|
if (addExecPath) {
|
|
22774
22836
|
applyExecPath(result, pathParts, execPath2, cwdPath);
|
|
22775
22837
|
}
|
|
22776
|
-
return pathOption === "" || pathOption ===
|
|
22838
|
+
return pathOption === "" || pathOption === path15__default.default.delimiter ? `${result.join(path15__default.default.delimiter)}${pathOption}` : [...result, pathOption].join(path15__default.default.delimiter);
|
|
22777
22839
|
};
|
|
22778
22840
|
var applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
22779
22841
|
for (const directory of traversePathUp(cwdPath)) {
|
|
22780
|
-
const pathPart =
|
|
22842
|
+
const pathPart = path15__default.default.join(directory, "node_modules/.bin");
|
|
22781
22843
|
if (!pathParts.includes(pathPart)) {
|
|
22782
22844
|
result.push(pathPart);
|
|
22783
22845
|
}
|
|
22784
22846
|
}
|
|
22785
22847
|
};
|
|
22786
22848
|
var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
|
|
22787
|
-
const pathPart =
|
|
22849
|
+
const pathPart = path15__default.default.resolve(cwdPath, toPath(execPath2), "..");
|
|
22788
22850
|
if (!pathParts.includes(pathPart)) {
|
|
22789
22851
|
result.push(pathPart);
|
|
22790
22852
|
}
|
|
@@ -23917,7 +23979,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
23917
23979
|
throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
|
|
23918
23980
|
}
|
|
23919
23981
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option');
|
|
23920
|
-
const resolvedNodePath =
|
|
23982
|
+
const resolvedNodePath = path15__default.default.resolve(cwd, normalizedNodePath);
|
|
23921
23983
|
const newOptions = {
|
|
23922
23984
|
...options,
|
|
23923
23985
|
nodePath: resolvedNodePath,
|
|
@@ -23927,7 +23989,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
23927
23989
|
if (!shouldHandleNode) {
|
|
23928
23990
|
return [file, commandArguments, newOptions];
|
|
23929
23991
|
}
|
|
23930
|
-
if (
|
|
23992
|
+
if (path15__default.default.basename(file, ".exe") === "node") {
|
|
23931
23993
|
throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
|
|
23932
23994
|
}
|
|
23933
23995
|
return [
|
|
@@ -24013,7 +24075,7 @@ var ENCODING_ALIASES = {
|
|
|
24013
24075
|
var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
|
|
24014
24076
|
var normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
24015
24077
|
const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
|
|
24016
|
-
return
|
|
24078
|
+
return path15__default.default.resolve(cwdString);
|
|
24017
24079
|
};
|
|
24018
24080
|
var getDefaultCwd = () => {
|
|
24019
24081
|
try {
|
|
@@ -24060,7 +24122,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
24060
24122
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
24061
24123
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
24062
24124
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
24063
|
-
if (process4__default.default.platform === "win32" &&
|
|
24125
|
+
if (process4__default.default.platform === "win32" && path15__default.default.basename(file, ".exe") === "cmd") {
|
|
24064
24126
|
commandArguments.unshift("/q");
|
|
24065
24127
|
}
|
|
24066
24128
|
return { file, commandArguments, options };
|
|
@@ -28492,12 +28554,12 @@ var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
|
28492
28554
|
]);
|
|
28493
28555
|
var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
|
|
28494
28556
|
function resolveTemplatePath(localTemplatePath) {
|
|
28495
|
-
const __dirname =
|
|
28496
|
-
const fromDist =
|
|
28557
|
+
const __dirname = path15__default.default.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.cjs', document.baseURI).href))));
|
|
28558
|
+
const fromDist = path15__default.default.resolve(__dirname, "../templates");
|
|
28497
28559
|
if (import_fs_extra8.default.existsSync(fromDist)) {
|
|
28498
28560
|
return fromDist;
|
|
28499
28561
|
}
|
|
28500
|
-
const fromSrc =
|
|
28562
|
+
const fromSrc = path15__default.default.resolve(__dirname, "../../templates");
|
|
28501
28563
|
if (import_fs_extra8.default.existsSync(fromSrc)) {
|
|
28502
28564
|
return fromSrc;
|
|
28503
28565
|
}
|
|
@@ -28506,15 +28568,19 @@ function resolveTemplatePath(localTemplatePath) {
|
|
|
28506
28568
|
);
|
|
28507
28569
|
}
|
|
28508
28570
|
function buildPlaceholderMap(options) {
|
|
28509
|
-
const { database, databaseUrl } = options;
|
|
28510
|
-
|
|
28511
|
-
|
|
28512
|
-
"{{
|
|
28513
|
-
|
|
28571
|
+
const { database, databaseUrl, pluginName, nextlyRange } = options;
|
|
28572
|
+
const map = {};
|
|
28573
|
+
if (database) {
|
|
28574
|
+
map["{{databaseDialect}}"] = database.type;
|
|
28575
|
+
map["{{databaseUrl}}"] = databaseUrl || database.envExample;
|
|
28576
|
+
}
|
|
28577
|
+
if (pluginName) map["{{pluginName}}"] = pluginName;
|
|
28578
|
+
if (nextlyRange) map["{{nextlyRange}}"] = nextlyRange;
|
|
28579
|
+
return map;
|
|
28514
28580
|
}
|
|
28515
28581
|
async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
28516
|
-
const ext =
|
|
28517
|
-
const basename =
|
|
28582
|
+
const ext = path15__default.default.extname(filePath).toLowerCase();
|
|
28583
|
+
const basename = path15__default.default.basename(filePath);
|
|
28518
28584
|
const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
|
|
28519
28585
|
if (!isTextFile) return;
|
|
28520
28586
|
let content = await import_fs_extra8.default.readFile(filePath, "utf-8");
|
|
@@ -28532,7 +28598,7 @@ async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
|
28532
28598
|
async function replacePlaceholders(dir, placeholders) {
|
|
28533
28599
|
const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
|
|
28534
28600
|
for (const entry of entries) {
|
|
28535
|
-
const fullPath =
|
|
28601
|
+
const fullPath = path15__default.default.join(dir, entry.name);
|
|
28536
28602
|
if (entry.isDirectory()) {
|
|
28537
28603
|
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
28538
28604
|
await replacePlaceholders(fullPath, placeholders);
|
|
@@ -28564,7 +28630,8 @@ var NEXTLY_PACKAGES = [
|
|
|
28564
28630
|
"@nextlyhq/adapter-postgres",
|
|
28565
28631
|
"@nextlyhq/adapter-mysql",
|
|
28566
28632
|
"@nextlyhq/adapter-sqlite",
|
|
28567
|
-
"@nextlyhq/plugin-form-builder"
|
|
28633
|
+
"@nextlyhq/plugin-form-builder",
|
|
28634
|
+
"@nextlyhq/plugin-sdk"
|
|
28568
28635
|
];
|
|
28569
28636
|
var resolvedNextlyVersions = null;
|
|
28570
28637
|
async function fetchLatestVersion(pkg2) {
|
|
@@ -28607,6 +28674,9 @@ async function resolveRuntimeVersions() {
|
|
|
28607
28674
|
return resolvedRuntimeVersions;
|
|
28608
28675
|
}
|
|
28609
28676
|
async function generatePackageJson(projectName, database, useYalc = false, projectType = "blank") {
|
|
28677
|
+
if (projectType === "plugin") {
|
|
28678
|
+
return generatePluginPackageJson(projectName, useYalc);
|
|
28679
|
+
}
|
|
28610
28680
|
const runtimeVersions = await resolveRuntimeVersions();
|
|
28611
28681
|
const dependencies = {
|
|
28612
28682
|
next: runtimeVersions.next,
|
|
@@ -28673,6 +28743,82 @@ async function generatePackageJson(projectName, database, useYalc = false, proje
|
|
|
28673
28743
|
};
|
|
28674
28744
|
return JSON.stringify(pkg2, null, 2) + "\n";
|
|
28675
28745
|
}
|
|
28746
|
+
async function resolvePluginNextlyRange(useYalc) {
|
|
28747
|
+
if (useYalc) return ">=0.0.0";
|
|
28748
|
+
const versions = await resolveNextlyVersions();
|
|
28749
|
+
const v2 = versions["nextly"];
|
|
28750
|
+
return v2 && v2 !== "latest" ? v2 : ">=0.0.0";
|
|
28751
|
+
}
|
|
28752
|
+
async function generatePluginPackageJson(projectName, useYalc) {
|
|
28753
|
+
const versions = useYalc ? {} : await resolveNextlyVersions();
|
|
28754
|
+
const runtimeVersions = await resolveRuntimeVersions();
|
|
28755
|
+
const range = (pkg3) => versions[pkg3] ?? "latest";
|
|
28756
|
+
const peerDependencies = {
|
|
28757
|
+
nextly: range("nextly"),
|
|
28758
|
+
"@nextlyhq/admin": range("@nextlyhq/admin"),
|
|
28759
|
+
"@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
|
|
28760
|
+
react: PINNED_VERSIONS.react,
|
|
28761
|
+
"react-dom": PINNED_VERSIONS["react-dom"]
|
|
28762
|
+
};
|
|
28763
|
+
const devDependencies = {
|
|
28764
|
+
nextly: range("nextly"),
|
|
28765
|
+
"@nextlyhq/admin": range("@nextlyhq/admin"),
|
|
28766
|
+
"@nextlyhq/ui": range("@nextlyhq/ui"),
|
|
28767
|
+
"@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
|
|
28768
|
+
"@nextlyhq/adapter-drizzle": range("@nextlyhq/adapter-drizzle"),
|
|
28769
|
+
"@nextlyhq/adapter-sqlite": range("@nextlyhq/adapter-sqlite"),
|
|
28770
|
+
next: runtimeVersions.next,
|
|
28771
|
+
react: PINNED_VERSIONS.react,
|
|
28772
|
+
"react-dom": PINNED_VERSIONS["react-dom"],
|
|
28773
|
+
"better-sqlite3": "^12.0.0",
|
|
28774
|
+
"@types/node": PINNED_VERSIONS["@types/node"],
|
|
28775
|
+
"@types/react": PINNED_VERSIONS["@types/react"],
|
|
28776
|
+
"@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
|
|
28777
|
+
typescript: PINNED_VERSIONS.typescript,
|
|
28778
|
+
tsup: "^8.5.0",
|
|
28779
|
+
vitest: "^4.0.8",
|
|
28780
|
+
eslint: PINNED_VERSIONS.eslint,
|
|
28781
|
+
"@eslint/js": PINNED_VERSIONS.eslint,
|
|
28782
|
+
"typescript-eslint": "^8.0.0"
|
|
28783
|
+
};
|
|
28784
|
+
const pkg2 = {
|
|
28785
|
+
name: projectName,
|
|
28786
|
+
version: "0.1.0",
|
|
28787
|
+
description: "A Nextly plugin.",
|
|
28788
|
+
type: "module",
|
|
28789
|
+
main: "./dist/index.mjs",
|
|
28790
|
+
module: "./dist/index.mjs",
|
|
28791
|
+
types: "./dist/index.d.ts",
|
|
28792
|
+
exports: {
|
|
28793
|
+
".": {
|
|
28794
|
+
types: "./dist/index.d.ts",
|
|
28795
|
+
import: "./dist/index.mjs"
|
|
28796
|
+
},
|
|
28797
|
+
"./admin": {
|
|
28798
|
+
types: "./dist/admin/index.d.ts",
|
|
28799
|
+
import: "./dist/admin/index.mjs"
|
|
28800
|
+
}
|
|
28801
|
+
},
|
|
28802
|
+
// Only the built library ships. The dev/ playground is never published.
|
|
28803
|
+
files: ["dist"],
|
|
28804
|
+
keywords: ["nextly", "nextly-plugin"],
|
|
28805
|
+
scripts: {
|
|
28806
|
+
build: "tsup",
|
|
28807
|
+
// Runs the embedded playground (next dev with dev/ as the project root).
|
|
28808
|
+
dev: "next dev dev --turbopack",
|
|
28809
|
+
"check-types": "tsc --noEmit",
|
|
28810
|
+
lint: "eslint .",
|
|
28811
|
+
test: "vitest run",
|
|
28812
|
+
"types:generate": "nextly generate:types"
|
|
28813
|
+
},
|
|
28814
|
+
peerDependencies,
|
|
28815
|
+
devDependencies
|
|
28816
|
+
// Native build-script allowlist is NOT emitted here: pnpm 11 ignores the
|
|
28817
|
+
// package.json `pnpm` field. It lives in pnpm-workspace.yaml instead (written
|
|
28818
|
+
// by copyPluginTemplate via generatePnpmWorkspaceYaml).
|
|
28819
|
+
};
|
|
28820
|
+
return JSON.stringify(pkg2, null, 2) + "\n";
|
|
28821
|
+
}
|
|
28676
28822
|
var NATIVE_BUILD_DEPENDENCIES = [
|
|
28677
28823
|
"better-sqlite3",
|
|
28678
28824
|
"esbuild",
|
|
@@ -28712,7 +28858,7 @@ async function copyTemplate(options) {
|
|
|
28712
28858
|
} = options;
|
|
28713
28859
|
if (!allowExistingTarget && targetDir !== process.cwd() && await import_fs_extra8.default.pathExists(targetDir)) {
|
|
28714
28860
|
throw new Error(
|
|
28715
|
-
`Directory "${
|
|
28861
|
+
`Directory "${path15__default.default.basename(targetDir)}" already exists. Please choose a different name.`
|
|
28716
28862
|
);
|
|
28717
28863
|
}
|
|
28718
28864
|
let baseDir;
|
|
@@ -28722,8 +28868,12 @@ async function copyTemplate(options) {
|
|
|
28722
28868
|
typeDir = templateSource.templatePath;
|
|
28723
28869
|
} else {
|
|
28724
28870
|
const templatesRoot = resolveTemplatePath();
|
|
28725
|
-
baseDir =
|
|
28726
|
-
typeDir =
|
|
28871
|
+
baseDir = path15__default.default.join(templatesRoot, "base");
|
|
28872
|
+
typeDir = path15__default.default.join(templatesRoot, projectType);
|
|
28873
|
+
}
|
|
28874
|
+
if (projectType === "plugin") {
|
|
28875
|
+
await copyPluginTemplate({ projectName, typeDir, targetDir, useYalc });
|
|
28876
|
+
return;
|
|
28727
28877
|
}
|
|
28728
28878
|
if (!await import_fs_extra8.default.pathExists(baseDir)) {
|
|
28729
28879
|
throw new Error(
|
|
@@ -28737,52 +28887,52 @@ async function copyTemplate(options) {
|
|
|
28737
28887
|
}
|
|
28738
28888
|
await import_fs_extra8.default.copy(baseDir, targetDir, {
|
|
28739
28889
|
filter: (_src) => {
|
|
28740
|
-
const basename =
|
|
28890
|
+
const basename = path15__default.default.basename(_src);
|
|
28741
28891
|
return !SKIP_FILES.has(basename);
|
|
28742
28892
|
}
|
|
28743
28893
|
});
|
|
28744
|
-
const templateSrcDir =
|
|
28894
|
+
const templateSrcDir = path15__default.default.join(typeDir, "src");
|
|
28745
28895
|
if (await import_fs_extra8.default.pathExists(templateSrcDir)) {
|
|
28746
|
-
await import_fs_extra8.default.copy(templateSrcDir,
|
|
28896
|
+
await import_fs_extra8.default.copy(templateSrcDir, path15__default.default.join(targetDir, "src"), {
|
|
28747
28897
|
overwrite: true,
|
|
28748
28898
|
filter: (_src) => {
|
|
28749
|
-
const basename =
|
|
28899
|
+
const basename = path15__default.default.basename(_src);
|
|
28750
28900
|
return !SKIP_FILES.has(basename);
|
|
28751
28901
|
}
|
|
28752
28902
|
});
|
|
28753
28903
|
}
|
|
28754
|
-
const templateRootConfig =
|
|
28904
|
+
const templateRootConfig = path15__default.default.join(typeDir, "nextly.config.ts");
|
|
28755
28905
|
if (await import_fs_extra8.default.pathExists(templateRootConfig)) {
|
|
28756
28906
|
await import_fs_extra8.default.copy(
|
|
28757
28907
|
templateRootConfig,
|
|
28758
|
-
|
|
28908
|
+
path15__default.default.join(targetDir, "nextly.config.ts"),
|
|
28759
28909
|
{ overwrite: true }
|
|
28760
28910
|
);
|
|
28761
28911
|
}
|
|
28762
|
-
const configsDir =
|
|
28912
|
+
const configsDir = path15__default.default.join(typeDir, "configs");
|
|
28763
28913
|
if (approach && await import_fs_extra8.default.pathExists(configsDir)) {
|
|
28764
28914
|
const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
|
|
28765
|
-
const configSrc =
|
|
28915
|
+
const configSrc = path15__default.default.join(configsDir, configFileName);
|
|
28766
28916
|
if (await import_fs_extra8.default.pathExists(configSrc)) {
|
|
28767
|
-
await import_fs_extra8.default.copy(configSrc,
|
|
28917
|
+
await import_fs_extra8.default.copy(configSrc, path15__default.default.join(targetDir, "nextly.config.ts"), {
|
|
28768
28918
|
overwrite: true
|
|
28769
28919
|
});
|
|
28770
28920
|
}
|
|
28771
|
-
const sharedSrc =
|
|
28921
|
+
const sharedSrc = path15__default.default.join(configsDir, "shared.ts");
|
|
28772
28922
|
if (await import_fs_extra8.default.pathExists(sharedSrc)) {
|
|
28773
|
-
await import_fs_extra8.default.copy(sharedSrc,
|
|
28923
|
+
await import_fs_extra8.default.copy(sharedSrc, path15__default.default.join(targetDir, "shared.ts"), {
|
|
28774
28924
|
overwrite: true
|
|
28775
28925
|
});
|
|
28776
28926
|
}
|
|
28777
28927
|
}
|
|
28778
|
-
const frontendPagePath =
|
|
28928
|
+
const frontendPagePath = path15__default.default.join(
|
|
28779
28929
|
targetDir,
|
|
28780
28930
|
"src",
|
|
28781
28931
|
"app",
|
|
28782
28932
|
"(frontend)",
|
|
28783
28933
|
"page.tsx"
|
|
28784
28934
|
);
|
|
28785
|
-
const basePagePath =
|
|
28935
|
+
const basePagePath = path15__default.default.join(targetDir, "src", "app", "page.tsx");
|
|
28786
28936
|
if (await import_fs_extra8.default.pathExists(frontendPagePath) && await import_fs_extra8.default.pathExists(basePagePath)) {
|
|
28787
28937
|
await import_fs_extra8.default.remove(basePagePath);
|
|
28788
28938
|
}
|
|
@@ -28793,20 +28943,20 @@ async function copyTemplate(options) {
|
|
|
28793
28943
|
projectType
|
|
28794
28944
|
);
|
|
28795
28945
|
await import_fs_extra8.default.writeFile(
|
|
28796
|
-
|
|
28946
|
+
path15__default.default.join(targetDir, "package.json"),
|
|
28797
28947
|
packageJsonContent,
|
|
28798
28948
|
"utf-8"
|
|
28799
28949
|
);
|
|
28800
28950
|
await import_fs_extra8.default.writeFile(
|
|
28801
|
-
|
|
28951
|
+
path15__default.default.join(targetDir, "pnpm-workspace.yaml"),
|
|
28802
28952
|
generatePnpmWorkspaceYaml(),
|
|
28803
28953
|
"utf-8"
|
|
28804
28954
|
);
|
|
28805
28955
|
if (database.type === "sqlite") {
|
|
28806
|
-
await import_fs_extra8.default.ensureDir(
|
|
28956
|
+
await import_fs_extra8.default.ensureDir(path15__default.default.join(targetDir, "data"));
|
|
28807
28957
|
}
|
|
28808
28958
|
await import_fs_extra8.default.writeFile(
|
|
28809
|
-
|
|
28959
|
+
path15__default.default.join(targetDir, "next.config.ts"),
|
|
28810
28960
|
buildNextConfigTemplate(database),
|
|
28811
28961
|
"utf-8"
|
|
28812
28962
|
);
|
|
@@ -28816,6 +28966,42 @@ async function copyTemplate(options) {
|
|
|
28816
28966
|
}
|
|
28817
28967
|
await replacePlaceholders(targetDir, placeholders);
|
|
28818
28968
|
}
|
|
28969
|
+
async function copyPluginTemplate(opts) {
|
|
28970
|
+
const { projectName, typeDir, targetDir, useYalc } = opts;
|
|
28971
|
+
if (!await import_fs_extra8.default.pathExists(typeDir)) {
|
|
28972
|
+
throw new Error(
|
|
28973
|
+
`Plugin template not found at ${typeDir}. The package may be corrupted or the download failed.`
|
|
28974
|
+
);
|
|
28975
|
+
}
|
|
28976
|
+
await import_fs_extra8.default.copy(typeDir, targetDir, {
|
|
28977
|
+
overwrite: true,
|
|
28978
|
+
filter: (src) => {
|
|
28979
|
+
const basename = path15__default.default.basename(src);
|
|
28980
|
+
return !SKIP_FILES.has(basename) && basename !== "template.json";
|
|
28981
|
+
}
|
|
28982
|
+
});
|
|
28983
|
+
const packageJsonContent = await generatePackageJson(
|
|
28984
|
+
projectName,
|
|
28985
|
+
{ },
|
|
28986
|
+
useYalc,
|
|
28987
|
+
"plugin"
|
|
28988
|
+
);
|
|
28989
|
+
await import_fs_extra8.default.writeFile(
|
|
28990
|
+
path15__default.default.join(targetDir, "package.json"),
|
|
28991
|
+
packageJsonContent,
|
|
28992
|
+
"utf-8"
|
|
28993
|
+
);
|
|
28994
|
+
await import_fs_extra8.default.writeFile(
|
|
28995
|
+
path15__default.default.join(targetDir, "pnpm-workspace.yaml"),
|
|
28996
|
+
generatePnpmWorkspaceYaml(),
|
|
28997
|
+
"utf-8"
|
|
28998
|
+
);
|
|
28999
|
+
const nextlyRange = await resolvePluginNextlyRange(useYalc);
|
|
29000
|
+
await replacePlaceholders(
|
|
29001
|
+
targetDir,
|
|
29002
|
+
buildPlaceholderMap({ pluginName: projectName, nextlyRange })
|
|
29003
|
+
);
|
|
29004
|
+
}
|
|
28819
29005
|
|
|
28820
29006
|
// src/installers/dependencies.ts
|
|
28821
29007
|
var INSTALL_COMMANDS = {
|
|
@@ -29784,12 +29970,12 @@ var F = class {
|
|
|
29784
29970
|
}
|
|
29785
29971
|
};
|
|
29786
29972
|
var an = (s3, t2) => {
|
|
29787
|
-
let i2 = s3, r = "", n2, o2 =
|
|
29973
|
+
let i2 = s3, r = "", n2, o2 = path15.posix.parse(s3).root || ".";
|
|
29788
29974
|
if (Buffer.byteLength(i2) < 100) n2 = [i2, r, false];
|
|
29789
29975
|
else {
|
|
29790
|
-
r =
|
|
29976
|
+
r = path15.posix.dirname(i2), i2 = path15.posix.basename(i2);
|
|
29791
29977
|
do
|
|
29792
|
-
Buffer.byteLength(i2) <= 100 && Buffer.byteLength(r) <= t2 ? n2 = [i2, r, false] : Buffer.byteLength(i2) > 100 && Buffer.byteLength(r) <= t2 ? n2 = [i2.slice(0, 99), r, true] : (i2 =
|
|
29978
|
+
Buffer.byteLength(i2) <= 100 && Buffer.byteLength(r) <= t2 ? n2 = [i2, r, false] : Buffer.byteLength(i2) > 100 && Buffer.byteLength(r) <= t2 ? n2 = [i2.slice(0, 99), r, true] : (i2 = path15.posix.join(path15.posix.basename(r), i2), r = path15.posix.dirname(r));
|
|
29793
29979
|
while (r !== o2 && n2 === void 0);
|
|
29794
29980
|
n2 || (n2 = [s3.slice(0, 99), "", true]);
|
|
29795
29981
|
}
|
|
@@ -29835,7 +30021,7 @@ var ct2 = class s {
|
|
|
29835
30021
|
if (t2 === "") return Buffer.allocUnsafe(0);
|
|
29836
30022
|
let e = Buffer.byteLength(t2), i2 = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i2);
|
|
29837
30023
|
for (let n2 = 0; n2 < 512; n2++) r[n2] = 0;
|
|
29838
|
-
new F({ path: ("PaxHeader/" +
|
|
30024
|
+
new F({ path: ("PaxHeader/" + path15.basename(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t2, 512, e, "utf8");
|
|
29839
30025
|
for (let n2 = e + 512; n2 < r.length; n2++) r[n2] = 0;
|
|
29840
30026
|
return r;
|
|
29841
30027
|
}
|
|
@@ -30197,11 +30383,11 @@ var Nn = (s3) => {
|
|
|
30197
30383
|
};
|
|
30198
30384
|
var Ki = (s3, t2) => {
|
|
30199
30385
|
let e = new Map(t2.map((n2) => [mt3(n2), true])), i2 = s3.filter, r = (n2, o2 = "") => {
|
|
30200
|
-
let h3 = o2 ||
|
|
30386
|
+
let h3 = o2 || path15.parse(n2).root || ".", a2;
|
|
30201
30387
|
if (n2 === h3) a2 = false;
|
|
30202
30388
|
else {
|
|
30203
30389
|
let l = e.get(n2);
|
|
30204
|
-
a2 = l !== void 0 ? l : r(
|
|
30390
|
+
a2 = l !== void 0 ? l : r(path15.dirname(n2), h3);
|
|
30205
30391
|
}
|
|
30206
30392
|
return e.set(n2, a2), a2;
|
|
30207
30393
|
};
|
|
@@ -30247,7 +30433,7 @@ var It3 = K2(An, Dn, (s3) => new st2(s3), (s3) => new st2(s3), (s3, t2) => {
|
|
|
30247
30433
|
t2?.length && Ki(s3, t2), s3.noResume || Nn(s3);
|
|
30248
30434
|
});
|
|
30249
30435
|
var Vi = (s3, t2, e) => (s3 &= 4095, e && (s3 = (s3 | 384) & -19), t2 && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
|
|
30250
|
-
var { isAbsolute: Cn, parse: Ys } =
|
|
30436
|
+
var { isAbsolute: Cn, parse: Ys } = path15.win32;
|
|
30251
30437
|
var ce2 = (s3) => {
|
|
30252
30438
|
let t2 = "", e = Ys(s3);
|
|
30253
30439
|
for (; Cn(s3) || e.root; ) {
|
|
@@ -30321,7 +30507,7 @@ var de2 = class extends D3 {
|
|
|
30321
30507
|
let [o2, h3] = ce2(this.path);
|
|
30322
30508
|
o2 && typeof h3 == "string" && (this.path = h3, r = o2);
|
|
30323
30509
|
}
|
|
30324
|
-
this.win32 = !!i2.win32 || process.platform === "win32", this.win32 && (this.path = Ks(this.path.replaceAll(/\\/g, "/")), t2 = t2.replaceAll(/\\/g, "/")), this.absolute = f(i2.absolute ||
|
|
30510
|
+
this.win32 = !!i2.win32 || process.platform === "win32", this.win32 && (this.path = Ks(this.path.replaceAll(/\\/g, "/")), t2 = t2.replaceAll(/\\/g, "/")), this.absolute = f(i2.absolute || path15__default.default.resolve(this.cwd, t2)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, { entry: this, path: r + this.path });
|
|
30325
30511
|
let n2 = this.statCache.get(this.absolute);
|
|
30326
30512
|
n2 ? this[ei](n2) : this[Qi]();
|
|
30327
30513
|
}
|
|
@@ -30380,7 +30566,7 @@ var de2 = class extends D3 {
|
|
|
30380
30566
|
}
|
|
30381
30567
|
[Qs](t2) {
|
|
30382
30568
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
30383
|
-
this.type = "Link", this.linkpath = f(
|
|
30569
|
+
this.type = "Link", this.linkpath = f(path15__default.default.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
|
|
30384
30570
|
}
|
|
30385
30571
|
[qs]() {
|
|
30386
30572
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
@@ -30791,7 +30977,7 @@ var Et3 = class extends D3 {
|
|
|
30791
30977
|
return t2 instanceof Yt ? this[er](t2) : this[hi](t2), this.flowing;
|
|
30792
30978
|
}
|
|
30793
30979
|
[er](t2) {
|
|
30794
|
-
let e = f(
|
|
30980
|
+
let e = f(path15__default.default.resolve(this.cwd, t2.path));
|
|
30795
30981
|
if (!this.filter(t2.path, t2)) t2.resume();
|
|
30796
30982
|
else {
|
|
30797
30983
|
let i2 = new di(t2.path, e);
|
|
@@ -30800,7 +30986,7 @@ var Et3 = class extends D3 {
|
|
|
30800
30986
|
this[Ft3]();
|
|
30801
30987
|
}
|
|
30802
30988
|
[hi](t2) {
|
|
30803
|
-
let e = f(
|
|
30989
|
+
let e = f(path15__default.default.resolve(this.cwd, t2));
|
|
30804
30990
|
this[W3].push(new di(t2, e)), this[Ft3]();
|
|
30805
30991
|
}
|
|
30806
30992
|
[as](t2) {
|
|
@@ -30938,11 +31124,11 @@ var Hn = (s3, t2) => {
|
|
|
30938
31124
|
};
|
|
30939
31125
|
var or = (s3, t2) => {
|
|
30940
31126
|
t2.forEach((e) => {
|
|
30941
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
31127
|
+
e.charAt(0) === "@" ? It3({ file: path15__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
|
|
30942
31128
|
}), s3.end();
|
|
30943
31129
|
};
|
|
30944
31130
|
var hr = async (s3, t2) => {
|
|
30945
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
31131
|
+
for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => {
|
|
30946
31132
|
s3.add(i2);
|
|
30947
31133
|
} }) : s3.add(e);
|
|
30948
31134
|
s3.end();
|
|
@@ -30980,13 +31166,13 @@ var ui = (s3, t2, e, i2) => {
|
|
|
30980
31166
|
});
|
|
30981
31167
|
};
|
|
30982
31168
|
var Xn = (s3, t2, e, i2, r) => {
|
|
30983
|
-
if (t2.isDirectory()) ds(
|
|
31169
|
+
if (t2.isDirectory()) ds(path15__default.default.resolve(s3, t2.name), e, i2, (n2) => {
|
|
30984
31170
|
if (n2) return r(n2);
|
|
30985
|
-
let o2 =
|
|
31171
|
+
let o2 = path15__default.default.resolve(s3, t2.name);
|
|
30986
31172
|
ui(o2, e, i2, r);
|
|
30987
31173
|
});
|
|
30988
31174
|
else {
|
|
30989
|
-
let n2 =
|
|
31175
|
+
let n2 = path15__default.default.resolve(s3, t2.name);
|
|
30990
31176
|
ui(n2, e, i2, r);
|
|
30991
31177
|
}
|
|
30992
31178
|
};
|
|
@@ -31007,7 +31193,7 @@ var ds = (s3, t2, e, i2) => {
|
|
|
31007
31193
|
});
|
|
31008
31194
|
};
|
|
31009
31195
|
var qn = (s3, t2, e, i2) => {
|
|
31010
|
-
t2.isDirectory() && us(
|
|
31196
|
+
t2.isDirectory() && us(path15__default.default.resolve(s3, t2.name), e, i2), fs10(path15__default.default.resolve(s3, t2.name), e, i2);
|
|
31011
31197
|
};
|
|
31012
31198
|
var us = (s3, t2, e) => {
|
|
31013
31199
|
let i2;
|
|
@@ -31057,12 +31243,12 @@ var Er = (s3, t2, e) => {
|
|
|
31057
31243
|
};
|
|
31058
31244
|
if (s3 === d) return Qn(s3, S2);
|
|
31059
31245
|
if (l) return jn__default.default.mkdir(s3, { mode: r, recursive: true }).then((E) => S2(null, E ?? void 0), S2);
|
|
31060
|
-
let N3 = f(
|
|
31246
|
+
let N3 = f(path15__default.default.relative(d, s3)).split("/");
|
|
31061
31247
|
ms(d, N3, r, c3, d, void 0, S2);
|
|
31062
31248
|
};
|
|
31063
31249
|
var ms = (s3, t2, e, i2, r, n2, o2) => {
|
|
31064
31250
|
if (t2.length === 0) return o2(null, n2);
|
|
31065
|
-
let h3 = t2.shift(), a2 = f(
|
|
31251
|
+
let h3 = t2.shift(), a2 = f(path15__default.default.resolve(s3 + "/" + h3));
|
|
31066
31252
|
fs__default.default.mkdir(a2, e, wr(a2, t2, e, i2, r, n2, o2));
|
|
31067
31253
|
};
|
|
31068
31254
|
var wr = (s3, t2, e, i2, r, n2, o2) => (h3) => {
|
|
@@ -31096,9 +31282,9 @@ var Sr = (s3, t2) => {
|
|
|
31096
31282
|
};
|
|
31097
31283
|
if (s3 === c3) return Jn(c3), d();
|
|
31098
31284
|
if (a2) return d(fs__default.default.mkdirSync(s3, { mode: i2, recursive: true }) ?? void 0);
|
|
31099
|
-
let T2 = f(
|
|
31285
|
+
let T2 = f(path15__default.default.relative(c3, s3)).split("/"), N3;
|
|
31100
31286
|
for (let E = T2.shift(), x3 = c3; E && (x3 += "/" + E); E = T2.shift()) {
|
|
31101
|
-
x3 = f(
|
|
31287
|
+
x3 = f(path15__default.default.resolve(x3));
|
|
31102
31288
|
try {
|
|
31103
31289
|
fs__default.default.mkdirSync(x3, i2), N3 = N3 || x3;
|
|
31104
31290
|
} catch {
|
|
@@ -31127,14 +31313,14 @@ var to = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
|
31127
31313
|
var eo = to === "win32";
|
|
31128
31314
|
var io = (s3) => s3.split("/").slice(0, -1).reduce((e, i2) => {
|
|
31129
31315
|
let r = e.at(-1);
|
|
31130
|
-
return r !== void 0 && (i2 =
|
|
31316
|
+
return r !== void 0 && (i2 = path15.join(r, i2)), e.push(i2 || "/"), e;
|
|
31131
31317
|
}, []);
|
|
31132
31318
|
var Ei = class {
|
|
31133
31319
|
#t = /* @__PURE__ */ new Map();
|
|
31134
31320
|
#i = /* @__PURE__ */ new Map();
|
|
31135
31321
|
#s = /* @__PURE__ */ new Set();
|
|
31136
31322
|
reserve(t2, e) {
|
|
31137
|
-
t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(
|
|
31323
|
+
t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(path15.join(Rr(r))));
|
|
31138
31324
|
let i2 = new Set(t2.map((r) => io(r)).reduce((r, n2) => r.concat(n2)));
|
|
31139
31325
|
this.#i.set(e, { dirs: i2, paths: t2 });
|
|
31140
31326
|
for (let r of t2) {
|
|
@@ -31274,7 +31460,7 @@ var qt = class extends st2 {
|
|
|
31274
31460
|
if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
31275
31461
|
this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
|
|
31276
31462
|
} else this.uid = void 0, this.gid = void 0, this.setOwner = false;
|
|
31277
|
-
this.preserveOwner = t2.preserveOwner === void 0 && typeof t2.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t2.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t2.maxDepth == "number" ? t2.maxDepth : no, this.forceChown = t2.forceChown === true, this.win32 = !!t2.win32 || Oe2, this.newer = !!t2.newer, this.keep = !!t2.keep, this.noMtime = !!t2.noMtime, this.preservePaths = !!t2.preservePaths, this.unlink = !!t2.unlink, this.cwd = f(
|
|
31463
|
+
this.preserveOwner = t2.preserveOwner === void 0 && typeof t2.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t2.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t2.maxDepth == "number" ? t2.maxDepth : no, this.forceChown = t2.forceChown === true, this.win32 = !!t2.win32 || Oe2, this.newer = !!t2.newer, this.keep = !!t2.keep, this.noMtime = !!t2.noMtime, this.preservePaths = !!t2.preservePaths, this.unlink = !!t2.unlink, this.cwd = f(path15__default.default.resolve(t2.cwd || process.cwd())), this.strip = Number(t2.strip) || 0, this.processUmask = this.chmod ? typeof t2.processUmask == "number" ? t2.processUmask : _r() : 0, this.umask = typeof t2.umask == "number" ? t2.umask : this.processUmask, this.dmode = t2.dmode || 511 & ~this.umask, this.fmode = t2.fmode || 438 & ~this.umask, this.on("entry", (e) => this[gr](e));
|
|
31278
31464
|
}
|
|
31279
31465
|
warn(t2, e, i2 = {}) {
|
|
31280
31466
|
return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i2.recoverable = false), super.warn(t2, e, i2);
|
|
@@ -31288,7 +31474,7 @@ var qt = class extends st2 {
|
|
|
31288
31474
|
let [n2, o2] = ce2(i2), h3 = o2.replaceAll(/\\/g, "/").split("/");
|
|
31289
31475
|
if (h3.includes("..") || Oe2 && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
|
|
31290
31476
|
if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t2, [e]: i2 }), false;
|
|
31291
|
-
let a2 =
|
|
31477
|
+
let a2 = path15__default.default.posix.dirname(t2.path), l = path15__default.default.posix.normalize(path15__default.default.posix.join(a2, h3.join("/")));
|
|
31292
31478
|
if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i2 }), false;
|
|
31293
31479
|
}
|
|
31294
31480
|
return n2 && (t2[e] = String(o2), this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute ${e}`, { entry: t2, [e]: i2 })), true;
|
|
@@ -31306,12 +31492,12 @@ var qt = class extends st2 {
|
|
|
31306
31492
|
}
|
|
31307
31493
|
if (isFinite(this.maxDepth) && i2.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", { entry: t2, path: e, depth: i2.length, maxDepth: this.maxDepth }), false;
|
|
31308
31494
|
if (!this[Es](t2, "path") || !this[Es](t2, "linkpath")) return false;
|
|
31309
|
-
if (t2.absolute =
|
|
31495
|
+
if (t2.absolute = path15__default.default.isAbsolute(t2.path) ? f(path15__default.default.resolve(t2.path)) : f(path15__default.default.resolve(this.cwd, t2.path)), !this.preservePaths && typeof t2.absolute == "string" && t2.absolute.indexOf(this.cwd + "/") !== 0 && t2.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t2, path: f(t2.path), resolvedPath: t2.absolute, cwd: this.cwd }), false;
|
|
31310
31496
|
if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
|
|
31311
31497
|
if (this.win32) {
|
|
31312
|
-
let { root: r } =
|
|
31498
|
+
let { root: r } = path15__default.default.win32.parse(String(t2.absolute));
|
|
31313
31499
|
t2.absolute = r + Xi(String(t2.absolute).slice(r.length));
|
|
31314
|
-
let { root: n2 } =
|
|
31500
|
+
let { root: n2 } = path15__default.default.win32.parse(t2.path);
|
|
31315
31501
|
t2.path = n2 + Xi(t2.path.slice(n2.length));
|
|
31316
31502
|
}
|
|
31317
31503
|
return true;
|
|
@@ -31399,13 +31585,13 @@ var qt = class extends st2 {
|
|
|
31399
31585
|
t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
|
|
31400
31586
|
}
|
|
31401
31587
|
[Tr](t2, e) {
|
|
31402
|
-
let i2 = f(
|
|
31588
|
+
let i2 = f(path15__default.default.relative(this.cwd, path15__default.default.resolve(path15__default.default.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
|
|
31403
31589
|
this[ye2](t2, this.cwd, i2, () => this[Si](t2, String(t2.linkpath), "symlink", e), (r) => {
|
|
31404
31590
|
this[O2](r, t2), e();
|
|
31405
31591
|
});
|
|
31406
31592
|
}
|
|
31407
31593
|
[xr](t2, e) {
|
|
31408
|
-
let i2 = f(
|
|
31594
|
+
let i2 = f(path15__default.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
|
|
31409
31595
|
this[ye2](t2, this.cwd, r, () => this[Si](t2, i2, "link", e), (n2) => {
|
|
31410
31596
|
this[O2](n2, t2), e();
|
|
31411
31597
|
});
|
|
@@ -31413,10 +31599,10 @@ var qt = class extends st2 {
|
|
|
31413
31599
|
[ye2](t2, e, i2, r, n2) {
|
|
31414
31600
|
let o2 = i2.shift();
|
|
31415
31601
|
if (this.preservePaths || o2 === void 0) return r();
|
|
31416
|
-
let h3 =
|
|
31602
|
+
let h3 = path15__default.default.resolve(e, o2);
|
|
31417
31603
|
fs__default.default.lstat(h3, (a2, l) => {
|
|
31418
31604
|
if (a2) return r();
|
|
31419
|
-
if (l?.isSymbolicLink()) return n2(new wt2(h3,
|
|
31605
|
+
if (l?.isSymbolicLink()) return n2(new wt2(h3, path15__default.default.resolve(h3, i2.join("/"))));
|
|
31420
31606
|
this[ye2](t2, h3, i2, r, n2);
|
|
31421
31607
|
});
|
|
31422
31608
|
}
|
|
@@ -31450,7 +31636,7 @@ var qt = class extends st2 {
|
|
|
31450
31636
|
});
|
|
31451
31637
|
}, n2 = () => {
|
|
31452
31638
|
if (t2.absolute !== this.cwd) {
|
|
31453
|
-
let h3 = f(
|
|
31639
|
+
let h3 = f(path15__default.default.dirname(String(t2.absolute)));
|
|
31454
31640
|
if (h3 !== this.cwd) return this[St2](h3, this.dmode, (a2) => {
|
|
31455
31641
|
if (a2) {
|
|
31456
31642
|
this[O2](a2, t2), i2();
|
|
@@ -31525,7 +31711,7 @@ var Te2 = class extends qt {
|
|
|
31525
31711
|
this[ge2] = true;
|
|
31526
31712
|
}
|
|
31527
31713
|
if (t2.absolute !== this.cwd) {
|
|
31528
|
-
let n2 = f(
|
|
31714
|
+
let n2 = f(path15__default.default.dirname(String(t2.absolute)));
|
|
31529
31715
|
if (n2 !== this.cwd) {
|
|
31530
31716
|
let o2 = this[St2](n2, this.dmode);
|
|
31531
31717
|
if (o2) return this[O2](o2, t2);
|
|
@@ -31625,10 +31811,10 @@ var Te2 = class extends qt {
|
|
|
31625
31811
|
if (this.preservePaths || i2.length === 0) return r();
|
|
31626
31812
|
let o2 = e;
|
|
31627
31813
|
for (let h3 of i2) {
|
|
31628
|
-
o2 =
|
|
31814
|
+
o2 = path15__default.default.resolve(o2, h3);
|
|
31629
31815
|
let [a2, l] = Se2(() => fs__default.default.lstatSync(o2));
|
|
31630
31816
|
if (a2) return r();
|
|
31631
|
-
if (l.isSymbolicLink()) return n2(new wt2(o2,
|
|
31817
|
+
if (l.isSymbolicLink()) return n2(new wt2(o2, path15__default.default.resolve(e, i2.join("/"))));
|
|
31632
31818
|
}
|
|
31633
31819
|
r();
|
|
31634
31820
|
}
|
|
@@ -31732,11 +31918,11 @@ var mo = (s3, t2) => {
|
|
|
31732
31918
|
};
|
|
31733
31919
|
var po = (s3, t2) => {
|
|
31734
31920
|
t2.forEach((e) => {
|
|
31735
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
31921
|
+
e.charAt(0) === "@" ? It3({ file: path15__default.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
|
|
31736
31922
|
}), s3.end();
|
|
31737
31923
|
};
|
|
31738
31924
|
var Eo = async (s3, t2) => {
|
|
31739
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
31925
|
+
for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15__default.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
|
|
31740
31926
|
s3.end();
|
|
31741
31927
|
};
|
|
31742
31928
|
var vt3 = K2(fo, mo, () => {
|
|
@@ -31761,7 +31947,7 @@ var GITHUB_ORG = "nextlyhq";
|
|
|
31761
31947
|
var GITHUB_REPO = "nextly";
|
|
31762
31948
|
async function downloadTemplate(templateName, branch = "main") {
|
|
31763
31949
|
const url = `https://codeload.github.com/${GITHUB_ORG}/${GITHUB_REPO}/tar.gz/${branch}`;
|
|
31764
|
-
const tmpDir =
|
|
31950
|
+
const tmpDir = path15__default.default.join(
|
|
31765
31951
|
process.env.TMPDIR || "/tmp",
|
|
31766
31952
|
`nextly-template-${Date.now()}`
|
|
31767
31953
|
);
|
|
@@ -31803,8 +31989,8 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
31803
31989
|
}
|
|
31804
31990
|
throw error;
|
|
31805
31991
|
}
|
|
31806
|
-
const basePath =
|
|
31807
|
-
const templatePath =
|
|
31992
|
+
const basePath = path15__default.default.join(tmpDir, "templates", "base");
|
|
31993
|
+
const templatePath = path15__default.default.join(tmpDir, "templates", templateName);
|
|
31808
31994
|
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
31809
31995
|
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
31810
31996
|
});
|
|
@@ -31822,8 +32008,8 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
31822
32008
|
return { basePath, templatePath };
|
|
31823
32009
|
}
|
|
31824
32010
|
async function resolveLocalTemplate(localPath, templateName) {
|
|
31825
|
-
const basePath =
|
|
31826
|
-
const templatePath =
|
|
32011
|
+
const basePath = path15__default.default.join(localPath, "base");
|
|
32012
|
+
const templatePath = path15__default.default.join(localPath, templateName);
|
|
31827
32013
|
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
31828
32014
|
throw new Error(
|
|
31829
32015
|
`Base template not found at ${basePath}. Check the --local-template path points to the templates/ directory.`
|
|
@@ -31846,7 +32032,7 @@ async function resolveTemplateSource(templateName, options = {}) {
|
|
|
31846
32032
|
async function cleanupDownload(source) {
|
|
31847
32033
|
const tmpBase = process.env.TMPDIR || "/tmp";
|
|
31848
32034
|
if (source.basePath.startsWith(tmpBase)) {
|
|
31849
|
-
const extractionRoot =
|
|
32035
|
+
const extractionRoot = path15__default.default.resolve(source.basePath, "../..");
|
|
31850
32036
|
await import_fs_extra9.default.remove(extractionRoot).catch(() => {
|
|
31851
32037
|
});
|
|
31852
32038
|
}
|
|
@@ -31881,6 +32067,22 @@ var AVAILABLE_TEMPLATES = [
|
|
|
31881
32067
|
hasFrontendPages: true,
|
|
31882
32068
|
recommendedDatabase: "any",
|
|
31883
32069
|
release: "alpha"
|
|
32070
|
+
},
|
|
32071
|
+
{
|
|
32072
|
+
name: "plugin",
|
|
32073
|
+
label: "Plugin",
|
|
32074
|
+
description: "Build a reusable Nextly plugin (publishable npm package)",
|
|
32075
|
+
hint: "Plugin package + embedded /dev playground; no schema approach",
|
|
32076
|
+
// Plugins don't ask code-first vs visual, ship no app frontend, and bring
|
|
32077
|
+
// their own collections — they are a publishable library, not an app.
|
|
32078
|
+
approaches: [],
|
|
32079
|
+
defaultApproach: null,
|
|
32080
|
+
collections: [],
|
|
32081
|
+
singles: [],
|
|
32082
|
+
hasDemoData: false,
|
|
32083
|
+
hasFrontendPages: false,
|
|
32084
|
+
recommendedDatabase: "sqlite",
|
|
32085
|
+
release: "alpha"
|
|
31884
32086
|
}
|
|
31885
32087
|
];
|
|
31886
32088
|
function getTemplate(name) {
|
|
@@ -31951,7 +32153,7 @@ var DATABASE_LABELS = {
|
|
|
31951
32153
|
};
|
|
31952
32154
|
var import_fs_extra10 = __toESM(require_lib());
|
|
31953
32155
|
async function isExistingNextProject(cwd) {
|
|
31954
|
-
const packageJsonPath =
|
|
32156
|
+
const packageJsonPath = path15__default.default.join(cwd, "package.json");
|
|
31955
32157
|
if (!await import_fs_extra10.default.pathExists(packageJsonPath)) return false;
|
|
31956
32158
|
try {
|
|
31957
32159
|
const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
|
|
@@ -32015,6 +32217,11 @@ function getTemplatePromptOptions() {
|
|
|
32015
32217
|
label: "Blog",
|
|
32016
32218
|
hint: "Posts, authors, categories, clean design"
|
|
32017
32219
|
},
|
|
32220
|
+
{
|
|
32221
|
+
value: "plugin",
|
|
32222
|
+
label: "Plugin",
|
|
32223
|
+
hint: "Build a reusable Nextly plugin + embedded /dev playground"
|
|
32224
|
+
},
|
|
32018
32225
|
{
|
|
32019
32226
|
value: "_coming_soon",
|
|
32020
32227
|
label: import_picocolors2.default.dim("More templates coming soon"),
|
|
@@ -32043,13 +32250,13 @@ function detectPmFromUserAgent(userAgent) {
|
|
|
32043
32250
|
async function detectPackageManager2(cwd) {
|
|
32044
32251
|
const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
|
|
32045
32252
|
if (fromUa) return fromUa;
|
|
32046
|
-
if (await import_fs_extra11.default.pathExists(
|
|
32047
|
-
if (await import_fs_extra11.default.pathExists(
|
|
32048
|
-
if (await import_fs_extra11.default.pathExists(
|
|
32253
|
+
if (await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
32254
|
+
if (await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "yarn.lock"))) return "yarn";
|
|
32255
|
+
if (await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "bun.lockb"))) return "bun";
|
|
32049
32256
|
return "npm";
|
|
32050
32257
|
}
|
|
32051
32258
|
async function detectProject(cwd) {
|
|
32052
|
-
const packageJsonPath =
|
|
32259
|
+
const packageJsonPath = path15__default.default.join(cwd, "package.json");
|
|
32053
32260
|
if (!await import_fs_extra11.default.pathExists(packageJsonPath)) {
|
|
32054
32261
|
throw new Error(
|
|
32055
32262
|
"No package.json found. Please run this command in a Next.js project."
|
|
@@ -32067,8 +32274,8 @@ async function detectProject(cwd) {
|
|
|
32067
32274
|
);
|
|
32068
32275
|
}
|
|
32069
32276
|
const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
|
|
32070
|
-
const srcDir = await import_fs_extra11.default.pathExists(
|
|
32071
|
-
const appDirPaths = srcDir ? [
|
|
32277
|
+
const srcDir = await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "src"));
|
|
32278
|
+
const appDirPaths = srcDir ? [path15__default.default.join(cwd, "src", "app")] : [path15__default.default.join(cwd, "app")];
|
|
32072
32279
|
let isAppRouter = false;
|
|
32073
32280
|
for (const appPath of appDirPaths) {
|
|
32074
32281
|
if (await import_fs_extra11.default.pathExists(appPath)) {
|
|
@@ -32081,7 +32288,7 @@ async function detectProject(cwd) {
|
|
|
32081
32288
|
"App Router not detected. Nextly requires Next.js App Router (app/ directory)."
|
|
32082
32289
|
);
|
|
32083
32290
|
}
|
|
32084
|
-
const hasTypescript = await import_fs_extra11.default.pathExists(
|
|
32291
|
+
const hasTypescript = await import_fs_extra11.default.pathExists(path15__default.default.join(cwd, "tsconfig.json"));
|
|
32085
32292
|
const packageManager = await detectPackageManager2(cwd);
|
|
32086
32293
|
const appDir = srcDir ? "src/app" : "app";
|
|
32087
32294
|
return {
|
|
@@ -32106,13 +32313,13 @@ async function emptyDirectory(dir) {
|
|
|
32106
32313
|
if (!await import_fs_extra12.default.pathExists(dir)) return;
|
|
32107
32314
|
for (const entry of await import_fs_extra12.default.readdir(dir)) {
|
|
32108
32315
|
if (entry === ".git") continue;
|
|
32109
|
-
await import_fs_extra12.default.remove(
|
|
32316
|
+
await import_fs_extra12.default.remove(path15__default.default.join(dir, entry));
|
|
32110
32317
|
}
|
|
32111
32318
|
}
|
|
32112
32319
|
|
|
32113
32320
|
// src/create-nextly.ts
|
|
32114
32321
|
function cwdProjectName(cwd) {
|
|
32115
|
-
const basename =
|
|
32322
|
+
const basename = path15__default.default.basename(cwd);
|
|
32116
32323
|
if (!/^[a-z0-9][a-z0-9._-]*$/.test(basename)) {
|
|
32117
32324
|
return DEFAULT_PROJECT_NAME;
|
|
32118
32325
|
}
|
|
@@ -32166,7 +32373,7 @@ async function createNextly(options = {}) {
|
|
|
32166
32373
|
}
|
|
32167
32374
|
let allowExistingTarget = false;
|
|
32168
32375
|
if (isFreshProject && projectName) {
|
|
32169
|
-
const conflictTargetDir = installInCwd ? cwd :
|
|
32376
|
+
const conflictTargetDir = installInCwd ? cwd : path15__default.default.join(cwd, projectName);
|
|
32170
32377
|
if (await isDirectoryNotEmpty(conflictTargetDir)) {
|
|
32171
32378
|
const targetLabel = installInCwd ? "the current directory" : `"${projectName}"`;
|
|
32172
32379
|
const choice = await promptDirectoryConflict(targetLabel);
|
|
@@ -32276,7 +32483,7 @@ async function createNextly(options = {}) {
|
|
|
32276
32483
|
databaseUrl = url?.trim() || database.connectionUrl;
|
|
32277
32484
|
}
|
|
32278
32485
|
if (isFreshProject && projectName) {
|
|
32279
|
-
const targetDir = installInCwd ? cwd :
|
|
32486
|
+
const targetDir = installInCwd ? cwd : path15__default.default.join(cwd, projectName);
|
|
32280
32487
|
const s3 = be();
|
|
32281
32488
|
let templateSource;
|
|
32282
32489
|
try {
|
|
@@ -32389,8 +32596,10 @@ async function createNextly(options = {}) {
|
|
|
32389
32596
|
await generateTypesDirectory(cwd, projectInfo);
|
|
32390
32597
|
await patchNextConfig(cwd, database);
|
|
32391
32598
|
}
|
|
32392
|
-
|
|
32393
|
-
|
|
32599
|
+
if (projectType !== "plugin") {
|
|
32600
|
+
const envDatabase = databaseUrl ? { ...database, connectionUrl: databaseUrl, envExample: databaseUrl } : database;
|
|
32601
|
+
await generateEnv(cwd, envDatabase);
|
|
32602
|
+
}
|
|
32394
32603
|
s3.stop("Environment configured");
|
|
32395
32604
|
} catch (error) {
|
|
32396
32605
|
s3.stop("Failed to generate configuration");
|
|
@@ -32409,31 +32618,58 @@ async function createNextly(options = {}) {
|
|
|
32409
32618
|
if (isFreshProject && projectName && !installInCwd) {
|
|
32410
32619
|
lines.push(` ${import_picocolors3.default.bold("cd")} ${projectName}`);
|
|
32411
32620
|
}
|
|
32412
|
-
|
|
32413
|
-
|
|
32414
|
-
|
|
32621
|
+
if (projectType === "plugin") {
|
|
32622
|
+
lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
|
|
32623
|
+
lines.push(
|
|
32624
|
+
` ${import_picocolors3.default.dim("\u2192 runs the embedded /dev playground (SQLite, hot-reload)")}`
|
|
32625
|
+
);
|
|
32626
|
+
lines.push("");
|
|
32627
|
+
lines.push(
|
|
32628
|
+
` Open ${import_picocolors3.default.cyan("http://localhost:3000/admin")} \u2014 your plugin is registered.`
|
|
32629
|
+
);
|
|
32630
|
+
lines.push(
|
|
32631
|
+
` Edit your plugin in ${import_picocolors3.default.dim("src/")}; the ${import_picocolors3.default.dim("dev/")} app is never published.`
|
|
32632
|
+
);
|
|
32633
|
+
lines.push("");
|
|
32634
|
+
lines.push(
|
|
32635
|
+
` ${import_picocolors3.default.bold(`${pm} test`)} runs the in-memory integration harness.`
|
|
32636
|
+
);
|
|
32637
|
+
lines.push(
|
|
32638
|
+
` ${import_picocolors3.default.bold(`${pm} run build`)}, then ${import_picocolors3.default.bold("npm publish")} to ship.`
|
|
32639
|
+
);
|
|
32640
|
+
lines.push("");
|
|
32415
32641
|
lines.push(
|
|
32416
|
-
`
|
|
32642
|
+
` Use it in an app: add ${import_picocolors3.default.dim("myPlugin()")} to ${import_picocolors3.default.dim("plugins")} in nextly.config.ts.`
|
|
32417
32643
|
);
|
|
32418
32644
|
} else {
|
|
32645
|
+
lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
|
|
32646
|
+
lines.push("");
|
|
32647
|
+
if (databaseType === "sqlite") {
|
|
32648
|
+
lines.push(
|
|
32649
|
+
` Your database (SQLite) is stored at ${import_picocolors3.default.dim("./data/nextly.db")}`
|
|
32650
|
+
);
|
|
32651
|
+
} else {
|
|
32652
|
+
lines.push(
|
|
32653
|
+
` Make sure your ${DATABASE_LABELS[databaseType].label} server is running before starting.`
|
|
32654
|
+
);
|
|
32655
|
+
}
|
|
32419
32656
|
lines.push(
|
|
32420
|
-
`
|
|
32657
|
+
` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
|
|
32421
32658
|
);
|
|
32659
|
+
if (projectType === "blog") {
|
|
32660
|
+
lines.push(
|
|
32661
|
+
` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`
|
|
32662
|
+
);
|
|
32663
|
+
}
|
|
32664
|
+
lines.push(
|
|
32665
|
+
` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
|
|
32666
|
+
);
|
|
32667
|
+
lines.push("");
|
|
32668
|
+
lines.push(
|
|
32669
|
+
` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
|
|
32670
|
+
);
|
|
32671
|
+
lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
|
|
32422
32672
|
}
|
|
32423
|
-
lines.push(
|
|
32424
|
-
` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
|
|
32425
|
-
);
|
|
32426
|
-
if (projectType === "blog") {
|
|
32427
|
-
lines.push(` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`);
|
|
32428
|
-
}
|
|
32429
|
-
lines.push(
|
|
32430
|
-
` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
|
|
32431
|
-
);
|
|
32432
|
-
lines.push("");
|
|
32433
|
-
lines.push(
|
|
32434
|
-
` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
|
|
32435
|
-
);
|
|
32436
|
-
lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
|
|
32437
32673
|
Vt2(lines.join("\n"), "Next steps");
|
|
32438
32674
|
capture("scaffold_completed", {
|
|
32439
32675
|
total_duration_ms: Date.now() - overallStartedAt,
|