create-nextly-app 0.0.2-alpha.27 → 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'module';
|
|
2
|
-
import
|
|
2
|
+
import path15, { win32, posix, dirname, sep, basename, parse, join } from 'path';
|
|
3
3
|
import fs, { createReadStream, appendFileSync, writeFileSync as writeFileSync$1, statSync, readFileSync, createWriteStream, existsSync } from 'fs';
|
|
4
4
|
import * as k from 'readline';
|
|
5
5
|
import k__default, { createInterface } from 'readline';
|
|
@@ -10212,7 +10212,7 @@ var require_dist = __commonJS2({
|
|
|
10212
10212
|
}
|
|
10213
10213
|
});
|
|
10214
10214
|
var require_constants = __commonJS2({
|
|
10215
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10215
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/constants.js"(exports$1, module) {
|
|
10216
10216
|
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
10217
10217
|
var MAX_LENGTH = 256;
|
|
10218
10218
|
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
@@ -10241,14 +10241,14 @@ var require_constants = __commonJS2({
|
|
|
10241
10241
|
}
|
|
10242
10242
|
});
|
|
10243
10243
|
var require_debug = __commonJS2({
|
|
10244
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10244
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/debug.js"(exports$1, module) {
|
|
10245
10245
|
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
10246
10246
|
};
|
|
10247
10247
|
module.exports = debug;
|
|
10248
10248
|
}
|
|
10249
10249
|
});
|
|
10250
10250
|
var require_re = __commonJS2({
|
|
10251
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10251
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/re.js"(exports$1, module) {
|
|
10252
10252
|
var {
|
|
10253
10253
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
10254
10254
|
MAX_SAFE_BUILD_LENGTH,
|
|
@@ -10333,7 +10333,7 @@ var require_re = __commonJS2({
|
|
|
10333
10333
|
}
|
|
10334
10334
|
});
|
|
10335
10335
|
var require_parse_options = __commonJS2({
|
|
10336
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10336
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/parse-options.js"(exports$1, module) {
|
|
10337
10337
|
var looseOption = Object.freeze({ loose: true });
|
|
10338
10338
|
var emptyOpts = Object.freeze({});
|
|
10339
10339
|
var parseOptions = (options) => {
|
|
@@ -10349,9 +10349,12 @@ var require_parse_options = __commonJS2({
|
|
|
10349
10349
|
}
|
|
10350
10350
|
});
|
|
10351
10351
|
var require_identifiers = __commonJS2({
|
|
10352
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10352
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/identifiers.js"(exports$1, module) {
|
|
10353
10353
|
var numeric = /^[0-9]+$/;
|
|
10354
10354
|
var compareIdentifiers = (a2, b2) => {
|
|
10355
|
+
if (typeof a2 === "number" && typeof b2 === "number") {
|
|
10356
|
+
return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;
|
|
10357
|
+
}
|
|
10355
10358
|
const anum = numeric.test(a2);
|
|
10356
10359
|
const bnum = numeric.test(b2);
|
|
10357
10360
|
if (anum && bnum) {
|
|
@@ -10368,7 +10371,7 @@ var require_identifiers = __commonJS2({
|
|
|
10368
10371
|
}
|
|
10369
10372
|
});
|
|
10370
10373
|
var require_semver = __commonJS2({
|
|
10371
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10374
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/semver.js"(exports$1, module) {
|
|
10372
10375
|
var debug = require_debug();
|
|
10373
10376
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
10374
10377
|
var { safeRe: re3, t: t2 } = require_re();
|
|
@@ -10455,7 +10458,25 @@ var require_semver = __commonJS2({
|
|
|
10455
10458
|
if (!(other instanceof _SemVer)) {
|
|
10456
10459
|
other = new _SemVer(other, this.options);
|
|
10457
10460
|
}
|
|
10458
|
-
|
|
10461
|
+
if (this.major < other.major) {
|
|
10462
|
+
return -1;
|
|
10463
|
+
}
|
|
10464
|
+
if (this.major > other.major) {
|
|
10465
|
+
return 1;
|
|
10466
|
+
}
|
|
10467
|
+
if (this.minor < other.minor) {
|
|
10468
|
+
return -1;
|
|
10469
|
+
}
|
|
10470
|
+
if (this.minor > other.minor) {
|
|
10471
|
+
return 1;
|
|
10472
|
+
}
|
|
10473
|
+
if (this.patch < other.patch) {
|
|
10474
|
+
return -1;
|
|
10475
|
+
}
|
|
10476
|
+
if (this.patch > other.patch) {
|
|
10477
|
+
return 1;
|
|
10478
|
+
}
|
|
10479
|
+
return 0;
|
|
10459
10480
|
}
|
|
10460
10481
|
comparePre(other) {
|
|
10461
10482
|
if (!(other instanceof _SemVer)) {
|
|
@@ -10626,7 +10647,7 @@ var require_semver = __commonJS2({
|
|
|
10626
10647
|
}
|
|
10627
10648
|
});
|
|
10628
10649
|
var require_parse = __commonJS2({
|
|
10629
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10650
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/parse.js"(exports$1, module) {
|
|
10630
10651
|
var SemVer = require_semver();
|
|
10631
10652
|
var parse = (version2, options, throwErrors = false) => {
|
|
10632
10653
|
if (version2 instanceof SemVer) {
|
|
@@ -10645,7 +10666,7 @@ var require_parse = __commonJS2({
|
|
|
10645
10666
|
}
|
|
10646
10667
|
});
|
|
10647
10668
|
var require_valid = __commonJS2({
|
|
10648
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10669
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/valid.js"(exports$1, module) {
|
|
10649
10670
|
var parse = require_parse();
|
|
10650
10671
|
var valid = (version2, options) => {
|
|
10651
10672
|
const v2 = parse(version2, options);
|
|
@@ -10655,7 +10676,7 @@ var require_valid = __commonJS2({
|
|
|
10655
10676
|
}
|
|
10656
10677
|
});
|
|
10657
10678
|
var require_clean = __commonJS2({
|
|
10658
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10679
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/clean.js"(exports$1, module) {
|
|
10659
10680
|
var parse = require_parse();
|
|
10660
10681
|
var clean = (version2, options) => {
|
|
10661
10682
|
const s3 = parse(version2.trim().replace(/^[=v]+/, ""), options);
|
|
@@ -10665,7 +10686,7 @@ var require_clean = __commonJS2({
|
|
|
10665
10686
|
}
|
|
10666
10687
|
});
|
|
10667
10688
|
var require_inc = __commonJS2({
|
|
10668
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10689
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/inc.js"(exports$1, module) {
|
|
10669
10690
|
var SemVer = require_semver();
|
|
10670
10691
|
var inc = (version2, release, options, identifier, identifierBase) => {
|
|
10671
10692
|
if (typeof options === "string") {
|
|
@@ -10686,7 +10707,7 @@ var require_inc = __commonJS2({
|
|
|
10686
10707
|
}
|
|
10687
10708
|
});
|
|
10688
10709
|
var require_diff = __commonJS2({
|
|
10689
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10710
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/diff.js"(exports$1, module) {
|
|
10690
10711
|
var parse = require_parse();
|
|
10691
10712
|
var diff = (version1, version2) => {
|
|
10692
10713
|
const v1 = parse(version1, null, true);
|
|
@@ -10727,28 +10748,28 @@ var require_diff = __commonJS2({
|
|
|
10727
10748
|
}
|
|
10728
10749
|
});
|
|
10729
10750
|
var require_major = __commonJS2({
|
|
10730
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10751
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/major.js"(exports$1, module) {
|
|
10731
10752
|
var SemVer = require_semver();
|
|
10732
10753
|
var major = (a2, loose) => new SemVer(a2, loose).major;
|
|
10733
10754
|
module.exports = major;
|
|
10734
10755
|
}
|
|
10735
10756
|
});
|
|
10736
10757
|
var require_minor = __commonJS2({
|
|
10737
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10758
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/minor.js"(exports$1, module) {
|
|
10738
10759
|
var SemVer = require_semver();
|
|
10739
10760
|
var minor = (a2, loose) => new SemVer(a2, loose).minor;
|
|
10740
10761
|
module.exports = minor;
|
|
10741
10762
|
}
|
|
10742
10763
|
});
|
|
10743
10764
|
var require_patch = __commonJS2({
|
|
10744
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10765
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/patch.js"(exports$1, module) {
|
|
10745
10766
|
var SemVer = require_semver();
|
|
10746
10767
|
var patch = (a2, loose) => new SemVer(a2, loose).patch;
|
|
10747
10768
|
module.exports = patch;
|
|
10748
10769
|
}
|
|
10749
10770
|
});
|
|
10750
10771
|
var require_prerelease = __commonJS2({
|
|
10751
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10772
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/prerelease.js"(exports$1, module) {
|
|
10752
10773
|
var parse = require_parse();
|
|
10753
10774
|
var prerelease = (version2, options) => {
|
|
10754
10775
|
const parsed = parse(version2, options);
|
|
@@ -10758,28 +10779,28 @@ var require_prerelease = __commonJS2({
|
|
|
10758
10779
|
}
|
|
10759
10780
|
});
|
|
10760
10781
|
var require_compare = __commonJS2({
|
|
10761
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10782
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare.js"(exports$1, module) {
|
|
10762
10783
|
var SemVer = require_semver();
|
|
10763
10784
|
var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose));
|
|
10764
10785
|
module.exports = compare;
|
|
10765
10786
|
}
|
|
10766
10787
|
});
|
|
10767
10788
|
var require_rcompare = __commonJS2({
|
|
10768
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10789
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rcompare.js"(exports$1, module) {
|
|
10769
10790
|
var compare = require_compare();
|
|
10770
10791
|
var rcompare = (a2, b2, loose) => compare(b2, a2, loose);
|
|
10771
10792
|
module.exports = rcompare;
|
|
10772
10793
|
}
|
|
10773
10794
|
});
|
|
10774
10795
|
var require_compare_loose = __commonJS2({
|
|
10775
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10796
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-loose.js"(exports$1, module) {
|
|
10776
10797
|
var compare = require_compare();
|
|
10777
10798
|
var compareLoose = (a2, b2) => compare(a2, b2, true);
|
|
10778
10799
|
module.exports = compareLoose;
|
|
10779
10800
|
}
|
|
10780
10801
|
});
|
|
10781
10802
|
var require_compare_build = __commonJS2({
|
|
10782
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10803
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-build.js"(exports$1, module) {
|
|
10783
10804
|
var SemVer = require_semver();
|
|
10784
10805
|
var compareBuild = (a2, b2, loose) => {
|
|
10785
10806
|
const versionA = new SemVer(a2, loose);
|
|
@@ -10790,63 +10811,63 @@ var require_compare_build = __commonJS2({
|
|
|
10790
10811
|
}
|
|
10791
10812
|
});
|
|
10792
10813
|
var require_sort = __commonJS2({
|
|
10793
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10814
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/sort.js"(exports$1, module) {
|
|
10794
10815
|
var compareBuild = require_compare_build();
|
|
10795
10816
|
var sort = (list, loose) => list.sort((a2, b2) => compareBuild(a2, b2, loose));
|
|
10796
10817
|
module.exports = sort;
|
|
10797
10818
|
}
|
|
10798
10819
|
});
|
|
10799
10820
|
var require_rsort = __commonJS2({
|
|
10800
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10821
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rsort.js"(exports$1, module) {
|
|
10801
10822
|
var compareBuild = require_compare_build();
|
|
10802
10823
|
var rsort = (list, loose) => list.sort((a2, b2) => compareBuild(b2, a2, loose));
|
|
10803
10824
|
module.exports = rsort;
|
|
10804
10825
|
}
|
|
10805
10826
|
});
|
|
10806
10827
|
var require_gt = __commonJS2({
|
|
10807
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10828
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gt.js"(exports$1, module) {
|
|
10808
10829
|
var compare = require_compare();
|
|
10809
10830
|
var gt4 = (a2, b2, loose) => compare(a2, b2, loose) > 0;
|
|
10810
10831
|
module.exports = gt4;
|
|
10811
10832
|
}
|
|
10812
10833
|
});
|
|
10813
10834
|
var require_lt = __commonJS2({
|
|
10814
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10835
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lt.js"(exports$1, module) {
|
|
10815
10836
|
var compare = require_compare();
|
|
10816
10837
|
var lt3 = (a2, b2, loose) => compare(a2, b2, loose) < 0;
|
|
10817
10838
|
module.exports = lt3;
|
|
10818
10839
|
}
|
|
10819
10840
|
});
|
|
10820
10841
|
var require_eq = __commonJS2({
|
|
10821
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10842
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/eq.js"(exports$1, module) {
|
|
10822
10843
|
var compare = require_compare();
|
|
10823
10844
|
var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0;
|
|
10824
10845
|
module.exports = eq;
|
|
10825
10846
|
}
|
|
10826
10847
|
});
|
|
10827
10848
|
var require_neq = __commonJS2({
|
|
10828
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10849
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/neq.js"(exports$1, module) {
|
|
10829
10850
|
var compare = require_compare();
|
|
10830
10851
|
var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0;
|
|
10831
10852
|
module.exports = neq;
|
|
10832
10853
|
}
|
|
10833
10854
|
});
|
|
10834
10855
|
var require_gte = __commonJS2({
|
|
10835
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10856
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gte.js"(exports$1, module) {
|
|
10836
10857
|
var compare = require_compare();
|
|
10837
10858
|
var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0;
|
|
10838
10859
|
module.exports = gte;
|
|
10839
10860
|
}
|
|
10840
10861
|
});
|
|
10841
10862
|
var require_lte = __commonJS2({
|
|
10842
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10863
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lte.js"(exports$1, module) {
|
|
10843
10864
|
var compare = require_compare();
|
|
10844
10865
|
var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0;
|
|
10845
10866
|
module.exports = lte;
|
|
10846
10867
|
}
|
|
10847
10868
|
});
|
|
10848
10869
|
var require_cmp = __commonJS2({
|
|
10849
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10870
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/cmp.js"(exports$1, module) {
|
|
10850
10871
|
var eq = require_eq();
|
|
10851
10872
|
var neq = require_neq();
|
|
10852
10873
|
var gt4 = require_gt();
|
|
@@ -10893,7 +10914,7 @@ var require_cmp = __commonJS2({
|
|
|
10893
10914
|
}
|
|
10894
10915
|
});
|
|
10895
10916
|
var require_coerce = __commonJS2({
|
|
10896
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10917
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/coerce.js"(exports$1, module) {
|
|
10897
10918
|
var SemVer = require_semver();
|
|
10898
10919
|
var parse = require_parse();
|
|
10899
10920
|
var { safeRe: re3, t: t2 } = require_re();
|
|
@@ -10935,8 +10956,46 @@ var require_coerce = __commonJS2({
|
|
|
10935
10956
|
module.exports = coerce;
|
|
10936
10957
|
}
|
|
10937
10958
|
});
|
|
10959
|
+
var require_truncate = __commonJS2({
|
|
10960
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/truncate.js"(exports$1, module) {
|
|
10961
|
+
var parse = require_parse();
|
|
10962
|
+
var constants4 = require_constants();
|
|
10963
|
+
var SemVer = require_semver();
|
|
10964
|
+
var truncate = (version2, truncation, options) => {
|
|
10965
|
+
if (!constants4.RELEASE_TYPES.includes(truncation)) {
|
|
10966
|
+
return null;
|
|
10967
|
+
}
|
|
10968
|
+
const clonedVersion = cloneInputVersion(version2, options);
|
|
10969
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
10970
|
+
};
|
|
10971
|
+
var cloneInputVersion = (version2, options) => {
|
|
10972
|
+
const versionStringToParse = version2 instanceof SemVer ? version2.version : version2;
|
|
10973
|
+
return parse(versionStringToParse, options);
|
|
10974
|
+
};
|
|
10975
|
+
var doTruncation = (version2, truncation) => {
|
|
10976
|
+
if (isPrerelease(truncation)) {
|
|
10977
|
+
return version2.version;
|
|
10978
|
+
}
|
|
10979
|
+
version2.prerelease = [];
|
|
10980
|
+
switch (truncation) {
|
|
10981
|
+
case "major":
|
|
10982
|
+
version2.minor = 0;
|
|
10983
|
+
version2.patch = 0;
|
|
10984
|
+
break;
|
|
10985
|
+
case "minor":
|
|
10986
|
+
version2.patch = 0;
|
|
10987
|
+
break;
|
|
10988
|
+
}
|
|
10989
|
+
return version2.format();
|
|
10990
|
+
};
|
|
10991
|
+
var isPrerelease = (type) => {
|
|
10992
|
+
return type.startsWith("pre");
|
|
10993
|
+
};
|
|
10994
|
+
module.exports = truncate;
|
|
10995
|
+
}
|
|
10996
|
+
});
|
|
10938
10997
|
var require_lrucache = __commonJS2({
|
|
10939
|
-
"../../node_modules/.pnpm/semver@7.
|
|
10998
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/lrucache.js"(exports$1, module) {
|
|
10940
10999
|
var LRUCache = class {
|
|
10941
11000
|
constructor() {
|
|
10942
11001
|
this.max = 1e3;
|
|
@@ -10971,7 +11030,7 @@ var require_lrucache = __commonJS2({
|
|
|
10971
11030
|
}
|
|
10972
11031
|
});
|
|
10973
11032
|
var require_range = __commonJS2({
|
|
10974
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11033
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/range.js"(exports$1, module) {
|
|
10975
11034
|
var SPACE_CHARACTERS = /\s+/g;
|
|
10976
11035
|
var Range = class _Range {
|
|
10977
11036
|
constructor(range, options) {
|
|
@@ -11141,6 +11200,7 @@ var require_range = __commonJS2({
|
|
|
11141
11200
|
return result;
|
|
11142
11201
|
};
|
|
11143
11202
|
var parseComparator = (comp, options) => {
|
|
11203
|
+
comp = comp.replace(re3[t2.BUILD], "");
|
|
11144
11204
|
debug("comp", comp, options);
|
|
11145
11205
|
comp = replaceCarets(comp, options);
|
|
11146
11206
|
debug("caret", comp);
|
|
@@ -11344,7 +11404,7 @@ var require_range = __commonJS2({
|
|
|
11344
11404
|
}
|
|
11345
11405
|
});
|
|
11346
11406
|
var require_comparator = __commonJS2({
|
|
11347
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11407
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/comparator.js"(exports$1, module) {
|
|
11348
11408
|
var ANY = Symbol("SemVer ANY");
|
|
11349
11409
|
var Comparator = class _Comparator {
|
|
11350
11410
|
static get ANY() {
|
|
@@ -11454,7 +11514,7 @@ var require_comparator = __commonJS2({
|
|
|
11454
11514
|
}
|
|
11455
11515
|
});
|
|
11456
11516
|
var require_satisfies = __commonJS2({
|
|
11457
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11517
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/satisfies.js"(exports$1, module) {
|
|
11458
11518
|
var Range = require_range();
|
|
11459
11519
|
var satisfies = (version2, range, options) => {
|
|
11460
11520
|
try {
|
|
@@ -11468,14 +11528,14 @@ var require_satisfies = __commonJS2({
|
|
|
11468
11528
|
}
|
|
11469
11529
|
});
|
|
11470
11530
|
var require_to_comparators = __commonJS2({
|
|
11471
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11531
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/to-comparators.js"(exports$1, module) {
|
|
11472
11532
|
var Range = require_range();
|
|
11473
11533
|
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c3) => c3.value).join(" ").trim().split(" "));
|
|
11474
11534
|
module.exports = toComparators;
|
|
11475
11535
|
}
|
|
11476
11536
|
});
|
|
11477
11537
|
var require_max_satisfying = __commonJS2({
|
|
11478
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11538
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/max-satisfying.js"(exports$1, module) {
|
|
11479
11539
|
var SemVer = require_semver();
|
|
11480
11540
|
var Range = require_range();
|
|
11481
11541
|
var maxSatisfying = (versions, range, options) => {
|
|
@@ -11501,7 +11561,7 @@ var require_max_satisfying = __commonJS2({
|
|
|
11501
11561
|
}
|
|
11502
11562
|
});
|
|
11503
11563
|
var require_min_satisfying = __commonJS2({
|
|
11504
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11564
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-satisfying.js"(exports$1, module) {
|
|
11505
11565
|
var SemVer = require_semver();
|
|
11506
11566
|
var Range = require_range();
|
|
11507
11567
|
var minSatisfying = (versions, range, options) => {
|
|
@@ -11527,7 +11587,7 @@ var require_min_satisfying = __commonJS2({
|
|
|
11527
11587
|
}
|
|
11528
11588
|
});
|
|
11529
11589
|
var require_min_version = __commonJS2({
|
|
11530
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11590
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-version.js"(exports$1, module) {
|
|
11531
11591
|
var SemVer = require_semver();
|
|
11532
11592
|
var Range = require_range();
|
|
11533
11593
|
var gt4 = require_gt();
|
|
@@ -11583,7 +11643,7 @@ var require_min_version = __commonJS2({
|
|
|
11583
11643
|
}
|
|
11584
11644
|
});
|
|
11585
11645
|
var require_valid2 = __commonJS2({
|
|
11586
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11646
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/valid.js"(exports$1, module) {
|
|
11587
11647
|
var Range = require_range();
|
|
11588
11648
|
var validRange = (range, options) => {
|
|
11589
11649
|
try {
|
|
@@ -11596,7 +11656,7 @@ var require_valid2 = __commonJS2({
|
|
|
11596
11656
|
}
|
|
11597
11657
|
});
|
|
11598
11658
|
var require_outside = __commonJS2({
|
|
11599
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11659
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/outside.js"(exports$1, module) {
|
|
11600
11660
|
var SemVer = require_semver();
|
|
11601
11661
|
var Comparator = require_comparator();
|
|
11602
11662
|
var { ANY } = Comparator;
|
|
@@ -11662,21 +11722,21 @@ var require_outside = __commonJS2({
|
|
|
11662
11722
|
}
|
|
11663
11723
|
});
|
|
11664
11724
|
var require_gtr = __commonJS2({
|
|
11665
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11725
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/gtr.js"(exports$1, module) {
|
|
11666
11726
|
var outside = require_outside();
|
|
11667
11727
|
var gtr = (version2, range, options) => outside(version2, range, ">", options);
|
|
11668
11728
|
module.exports = gtr;
|
|
11669
11729
|
}
|
|
11670
11730
|
});
|
|
11671
11731
|
var require_ltr = __commonJS2({
|
|
11672
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11732
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/ltr.js"(exports$1, module) {
|
|
11673
11733
|
var outside = require_outside();
|
|
11674
11734
|
var ltr = (version2, range, options) => outside(version2, range, "<", options);
|
|
11675
11735
|
module.exports = ltr;
|
|
11676
11736
|
}
|
|
11677
11737
|
});
|
|
11678
11738
|
var require_intersects = __commonJS2({
|
|
11679
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11739
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/intersects.js"(exports$1, module) {
|
|
11680
11740
|
var Range = require_range();
|
|
11681
11741
|
var intersects = (r1, r2, options) => {
|
|
11682
11742
|
r1 = new Range(r1, options);
|
|
@@ -11687,7 +11747,7 @@ var require_intersects = __commonJS2({
|
|
|
11687
11747
|
}
|
|
11688
11748
|
});
|
|
11689
11749
|
var require_simplify = __commonJS2({
|
|
11690
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11750
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/simplify.js"(exports$1, module) {
|
|
11691
11751
|
var satisfies = require_satisfies();
|
|
11692
11752
|
var compare = require_compare();
|
|
11693
11753
|
module.exports = (versions, range, options) => {
|
|
@@ -11734,7 +11794,7 @@ var require_simplify = __commonJS2({
|
|
|
11734
11794
|
}
|
|
11735
11795
|
});
|
|
11736
11796
|
var require_subset = __commonJS2({
|
|
11737
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11797
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/subset.js"(exports$1, module) {
|
|
11738
11798
|
var Range = require_range();
|
|
11739
11799
|
var Comparator = require_comparator();
|
|
11740
11800
|
var { ANY } = Comparator;
|
|
@@ -11893,7 +11953,7 @@ var require_subset = __commonJS2({
|
|
|
11893
11953
|
}
|
|
11894
11954
|
});
|
|
11895
11955
|
var require_semver2 = __commonJS2({
|
|
11896
|
-
"../../node_modules/.pnpm/semver@7.
|
|
11956
|
+
"../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/index.js"(exports$1, module) {
|
|
11897
11957
|
var internalRe = require_re();
|
|
11898
11958
|
var constants4 = require_constants();
|
|
11899
11959
|
var SemVer = require_semver();
|
|
@@ -11921,6 +11981,7 @@ var require_semver2 = __commonJS2({
|
|
|
11921
11981
|
var lte = require_lte();
|
|
11922
11982
|
var cmp = require_cmp();
|
|
11923
11983
|
var coerce = require_coerce();
|
|
11984
|
+
var truncate = require_truncate();
|
|
11924
11985
|
var Comparator = require_comparator();
|
|
11925
11986
|
var Range = require_range();
|
|
11926
11987
|
var satisfies = require_satisfies();
|
|
@@ -11959,6 +12020,7 @@ var require_semver2 = __commonJS2({
|
|
|
11959
12020
|
lte,
|
|
11960
12021
|
cmp,
|
|
11961
12022
|
coerce,
|
|
12023
|
+
truncate,
|
|
11962
12024
|
Comparator,
|
|
11963
12025
|
Range,
|
|
11964
12026
|
satisfies,
|
|
@@ -15947,36 +16009,36 @@ var homedir = os.homedir();
|
|
|
15947
16009
|
var tmpdir = os.tmpdir();
|
|
15948
16010
|
var { env } = process4;
|
|
15949
16011
|
var macos = (name) => {
|
|
15950
|
-
const library =
|
|
16012
|
+
const library = path15.join(homedir, "Library");
|
|
15951
16013
|
return {
|
|
15952
|
-
data:
|
|
15953
|
-
config:
|
|
15954
|
-
cache:
|
|
15955
|
-
log:
|
|
15956
|
-
temp:
|
|
16014
|
+
data: path15.join(library, "Application Support", name),
|
|
16015
|
+
config: path15.join(library, "Preferences", name),
|
|
16016
|
+
cache: path15.join(library, "Caches", name),
|
|
16017
|
+
log: path15.join(library, "Logs", name),
|
|
16018
|
+
temp: path15.join(tmpdir, name)
|
|
15957
16019
|
};
|
|
15958
16020
|
};
|
|
15959
16021
|
var windows = (name) => {
|
|
15960
|
-
const appData = env.APPDATA ||
|
|
15961
|
-
const localAppData = env.LOCALAPPDATA ||
|
|
16022
|
+
const appData = env.APPDATA || path15.join(homedir, "AppData", "Roaming");
|
|
16023
|
+
const localAppData = env.LOCALAPPDATA || path15.join(homedir, "AppData", "Local");
|
|
15962
16024
|
return {
|
|
15963
16025
|
// Data/config/cache/log are invented by me as Windows isn't opinionated about this
|
|
15964
|
-
data:
|
|
15965
|
-
config:
|
|
15966
|
-
cache:
|
|
15967
|
-
log:
|
|
15968
|
-
temp:
|
|
16026
|
+
data: path15.join(localAppData, name, "Data"),
|
|
16027
|
+
config: path15.join(appData, name, "Config"),
|
|
16028
|
+
cache: path15.join(localAppData, name, "Cache"),
|
|
16029
|
+
log: path15.join(localAppData, name, "Log"),
|
|
16030
|
+
temp: path15.join(tmpdir, name)
|
|
15969
16031
|
};
|
|
15970
16032
|
};
|
|
15971
16033
|
var linux = (name) => {
|
|
15972
|
-
const username =
|
|
16034
|
+
const username = path15.basename(homedir);
|
|
15973
16035
|
return {
|
|
15974
|
-
data:
|
|
15975
|
-
config:
|
|
15976
|
-
cache:
|
|
16036
|
+
data: path15.join(env.XDG_DATA_HOME || path15.join(homedir, ".local", "share"), name),
|
|
16037
|
+
config: path15.join(env.XDG_CONFIG_HOME || path15.join(homedir, ".config"), name),
|
|
16038
|
+
cache: path15.join(env.XDG_CACHE_HOME || path15.join(homedir, ".cache"), name),
|
|
15977
16039
|
// https://wiki.debian.org/XDGBaseDirectorySpecification#state
|
|
15978
|
-
log:
|
|
15979
|
-
temp:
|
|
16040
|
+
log: path15.join(env.XDG_STATE_HOME || path15.join(homedir, ".local", "state"), name),
|
|
16041
|
+
temp: path15.join(tmpdir, username, name)
|
|
15980
16042
|
};
|
|
15981
16043
|
};
|
|
15982
16044
|
function envPaths(name, { suffix = "nodejs" } = {}) {
|
|
@@ -16253,7 +16315,7 @@ var Temp = {
|
|
|
16253
16315
|
}
|
|
16254
16316
|
},
|
|
16255
16317
|
truncate: (filePath) => {
|
|
16256
|
-
const basename =
|
|
16318
|
+
const basename = path15.basename(filePath);
|
|
16257
16319
|
if (basename.length <= LIMIT_BASENAME_LENGTH)
|
|
16258
16320
|
return filePath;
|
|
16259
16321
|
const truncable = /^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(basename);
|
|
@@ -16293,7 +16355,7 @@ function writeFileSync(filePath, data, options = DEFAULT_WRITE_OPTIONS) {
|
|
|
16293
16355
|
}
|
|
16294
16356
|
}
|
|
16295
16357
|
if (!filePathExists) {
|
|
16296
|
-
const parentPath =
|
|
16358
|
+
const parentPath = path15.dirname(filePath);
|
|
16297
16359
|
dist_default.attempt.mkdirSync(parentPath, {
|
|
16298
16360
|
mode: DEFAULT_FOLDER_MODE,
|
|
16299
16361
|
recursive: true
|
|
@@ -16596,7 +16658,7 @@ var Conf = class {
|
|
|
16596
16658
|
this.events = new EventTarget();
|
|
16597
16659
|
this.#encryptionKey = options.encryptionKey;
|
|
16598
16660
|
const fileExtension = options.fileExtension ? `.${options.fileExtension}` : "";
|
|
16599
|
-
this.path =
|
|
16661
|
+
this.path = path15.resolve(options.cwd, `${options.configName ?? "config"}${fileExtension}`);
|
|
16600
16662
|
const fileStore = this.store;
|
|
16601
16663
|
const store = Object.assign(createPlainObject(), options.defaults, fileStore);
|
|
16602
16664
|
if (options.migrations) {
|
|
@@ -16801,7 +16863,7 @@ var Conf = class {
|
|
|
16801
16863
|
throw new Error("Config schema violation: " + errors.join("; "));
|
|
16802
16864
|
}
|
|
16803
16865
|
_ensureDirectory() {
|
|
16804
|
-
fs.mkdirSync(
|
|
16866
|
+
fs.mkdirSync(path15.dirname(this.path), { recursive: true });
|
|
16805
16867
|
}
|
|
16806
16868
|
_write(value) {
|
|
16807
16869
|
let data = this._serialize(value);
|
|
@@ -17121,7 +17183,7 @@ function resolveProjectArg(directory) {
|
|
|
17121
17183
|
if (trimmed === "." || trimmed === "./") {
|
|
17122
17184
|
return { projectName: void 0, installInCwd: true };
|
|
17123
17185
|
}
|
|
17124
|
-
return { projectName:
|
|
17186
|
+
return { projectName: path15.basename(trimmed), installInCwd: false };
|
|
17125
17187
|
}
|
|
17126
17188
|
function validateProjectName(name) {
|
|
17127
17189
|
if (!/^[a-z0-9][a-z0-9._-]*$/.test(name)) {
|
|
@@ -17134,7 +17196,7 @@ function validateProjectNamePromptInput(value) {
|
|
|
17134
17196
|
if (trimmed === "") return void 0;
|
|
17135
17197
|
if (trimmed === "." || trimmed === "./") return void 0;
|
|
17136
17198
|
const candidate = trimmed.startsWith("./") ? trimmed.slice(2) : trimmed;
|
|
17137
|
-
return validateProjectName(
|
|
17199
|
+
return validateProjectName(path15.basename(candidate));
|
|
17138
17200
|
}
|
|
17139
17201
|
|
|
17140
17202
|
// ../../node_modules/.pnpm/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
|
|
@@ -18067,9 +18129,9 @@ export default function AdminLayout({
|
|
|
18067
18129
|
`;
|
|
18068
18130
|
}
|
|
18069
18131
|
async function generateAdminPage(cwd, projectInfo) {
|
|
18070
|
-
const adminDir =
|
|
18071
|
-
const pagePath =
|
|
18072
|
-
const layoutPath =
|
|
18132
|
+
const adminDir = path15.join(cwd, projectInfo.appDir, "admin", "[[...params]]");
|
|
18133
|
+
const pagePath = path15.join(adminDir, "page.tsx");
|
|
18134
|
+
const layoutPath = path15.join(adminDir, "layout.tsx");
|
|
18073
18135
|
if (await import_fs_extra.default.pathExists(pagePath)) {
|
|
18074
18136
|
throw new Error(
|
|
18075
18137
|
"Admin page already exists at admin/[[...params]]/page.tsx"
|
|
@@ -18122,7 +18184,7 @@ ${singlesLine}
|
|
|
18122
18184
|
return template;
|
|
18123
18185
|
}
|
|
18124
18186
|
async function generateConfig(cwd, projectType) {
|
|
18125
|
-
const configPath =
|
|
18187
|
+
const configPath = path15.join(cwd, "nextly.config.ts");
|
|
18126
18188
|
if (await import_fs_extra2.default.pathExists(configPath)) {
|
|
18127
18189
|
throw new Error(
|
|
18128
18190
|
"nextly.config.ts already exists. Please remove it first or run in a fresh project."
|
|
@@ -18153,8 +18215,8 @@ NEXT_PUBLIC_APP_URL=http://localhost:3000
|
|
|
18153
18215
|
`;
|
|
18154
18216
|
}
|
|
18155
18217
|
async function generateEnv(cwd, database) {
|
|
18156
|
-
const envPath =
|
|
18157
|
-
const envExamplePath =
|
|
18218
|
+
const envPath = path15.join(cwd, ".env");
|
|
18219
|
+
const envExamplePath = path15.join(cwd, ".env.example");
|
|
18158
18220
|
const envContent = getEnvTemplate(database);
|
|
18159
18221
|
await import_fs_extra3.default.writeFile(envExamplePath, envContent, "utf-8");
|
|
18160
18222
|
if (await import_fs_extra3.default.pathExists(envPath)) {
|
|
@@ -18218,25 +18280,25 @@ var HEALTH_ROUTE_TEMPLATE = `/**
|
|
|
18218
18280
|
export { GET, HEAD } from "nextly/api/health";
|
|
18219
18281
|
`;
|
|
18220
18282
|
async function generateMediaRoutes(cwd, projectInfo) {
|
|
18221
|
-
const apiDir =
|
|
18222
|
-
const mediaDir =
|
|
18283
|
+
const apiDir = path15.join(cwd, projectInfo.appDir, "api");
|
|
18284
|
+
const mediaDir = path15.join(apiDir, "media");
|
|
18223
18285
|
if (await import_fs_extra4.default.pathExists(mediaDir)) {
|
|
18224
18286
|
throw new Error(
|
|
18225
18287
|
"Media API routes already exist at api/media. Please remove them first."
|
|
18226
18288
|
);
|
|
18227
18289
|
}
|
|
18228
|
-
const mediaRoutePath =
|
|
18290
|
+
const mediaRoutePath = path15.join(apiDir, "media", "[[...path]]", "route.ts");
|
|
18229
18291
|
const configImportPath = getConfigImportPath(
|
|
18230
18292
|
projectInfo.appDir.startsWith("src")
|
|
18231
18293
|
);
|
|
18232
|
-
await import_fs_extra4.default.ensureDir(
|
|
18294
|
+
await import_fs_extra4.default.ensureDir(path15.dirname(mediaRoutePath));
|
|
18233
18295
|
await import_fs_extra4.default.writeFile(
|
|
18234
18296
|
mediaRoutePath,
|
|
18235
18297
|
MEDIA_CATCH_ALL_TEMPLATE(configImportPath),
|
|
18236
18298
|
"utf-8"
|
|
18237
18299
|
);
|
|
18238
|
-
const healthRoutePath =
|
|
18239
|
-
await import_fs_extra4.default.ensureDir(
|
|
18300
|
+
const healthRoutePath = path15.join(apiDir, "health", "route.ts");
|
|
18301
|
+
await import_fs_extra4.default.ensureDir(path15.dirname(healthRoutePath));
|
|
18240
18302
|
await import_fs_extra4.default.writeFile(healthRoutePath, HEALTH_ROUTE_TEMPLATE, "utf-8");
|
|
18241
18303
|
}
|
|
18242
18304
|
|
|
@@ -18281,7 +18343,7 @@ async function patchNextConfig(cwd, database) {
|
|
|
18281
18343
|
const candidates = ["next.config.ts", "next.config.mjs", "next.config.js"];
|
|
18282
18344
|
let configPath = null;
|
|
18283
18345
|
for (const name of candidates) {
|
|
18284
|
-
const full =
|
|
18346
|
+
const full = path15.join(cwd, name);
|
|
18285
18347
|
if (await import_fs_extra5.default.pathExists(full)) {
|
|
18286
18348
|
configPath = full;
|
|
18287
18349
|
break;
|
|
@@ -18338,7 +18400,7 @@ export const DELETE = handlers.DELETE;
|
|
|
18338
18400
|
export const OPTIONS = handlers.OPTIONS;
|
|
18339
18401
|
`;
|
|
18340
18402
|
async function generateRoutes(cwd, projectInfo) {
|
|
18341
|
-
const routePath =
|
|
18403
|
+
const routePath = path15.join(
|
|
18342
18404
|
cwd,
|
|
18343
18405
|
projectInfo.appDir,
|
|
18344
18406
|
"admin",
|
|
@@ -18351,7 +18413,7 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
18351
18413
|
"API route already exists at admin/api/[[...params]]/route.ts"
|
|
18352
18414
|
);
|
|
18353
18415
|
}
|
|
18354
|
-
await import_fs_extra6.default.ensureDir(
|
|
18416
|
+
await import_fs_extra6.default.ensureDir(path15.dirname(routePath));
|
|
18355
18417
|
await import_fs_extra6.default.writeFile(routePath, API_ROUTE_TEMPLATE, "utf-8");
|
|
18356
18418
|
}
|
|
18357
18419
|
|
|
@@ -18359,13 +18421,13 @@ async function generateRoutes(cwd, projectInfo) {
|
|
|
18359
18421
|
var import_fs_extra7 = __toESM(require_lib(), 1);
|
|
18360
18422
|
async function generateTypesDirectory(cwd, projectInfo) {
|
|
18361
18423
|
const baseDir = projectInfo.srcDir ? "src" : ".";
|
|
18362
|
-
const typesDir =
|
|
18424
|
+
const typesDir = path15.join(cwd, baseDir, "types", "generated");
|
|
18363
18425
|
await import_fs_extra7.default.ensureDir(typesDir);
|
|
18364
|
-
const gitkeepPath =
|
|
18426
|
+
const gitkeepPath = path15.join(typesDir, ".gitkeep");
|
|
18365
18427
|
if (!await import_fs_extra7.default.pathExists(gitkeepPath)) {
|
|
18366
18428
|
await import_fs_extra7.default.writeFile(gitkeepPath, "", "utf-8");
|
|
18367
18429
|
}
|
|
18368
|
-
const placeholderPath =
|
|
18430
|
+
const placeholderPath = path15.join(typesDir, "nextly-types.ts");
|
|
18369
18431
|
if (!await import_fs_extra7.default.pathExists(placeholderPath)) {
|
|
18370
18432
|
const placeholderContent = `/**
|
|
18371
18433
|
* Nextly Generated Types
|
|
@@ -19176,12 +19238,12 @@ function toPath(urlOrPath) {
|
|
|
19176
19238
|
function traversePathUp(startPath) {
|
|
19177
19239
|
return {
|
|
19178
19240
|
*[Symbol.iterator]() {
|
|
19179
|
-
let currentPath =
|
|
19241
|
+
let currentPath = path15.resolve(toPath(startPath));
|
|
19180
19242
|
let previousPath;
|
|
19181
19243
|
while (previousPath !== currentPath) {
|
|
19182
19244
|
yield currentPath;
|
|
19183
19245
|
previousPath = currentPath;
|
|
19184
|
-
currentPath =
|
|
19246
|
+
currentPath = path15.resolve(currentPath, "..");
|
|
19185
19247
|
}
|
|
19186
19248
|
}
|
|
19187
19249
|
};
|
|
@@ -19195,27 +19257,27 @@ var npmRunPath = ({
|
|
|
19195
19257
|
execPath: execPath2 = process4.execPath,
|
|
19196
19258
|
addExecPath = true
|
|
19197
19259
|
} = {}) => {
|
|
19198
|
-
const cwdPath =
|
|
19260
|
+
const cwdPath = path15.resolve(toPath(cwd));
|
|
19199
19261
|
const result = [];
|
|
19200
|
-
const pathParts = pathOption.split(
|
|
19262
|
+
const pathParts = pathOption.split(path15.delimiter);
|
|
19201
19263
|
if (preferLocal) {
|
|
19202
19264
|
applyPreferLocal(result, pathParts, cwdPath);
|
|
19203
19265
|
}
|
|
19204
19266
|
if (addExecPath) {
|
|
19205
19267
|
applyExecPath(result, pathParts, execPath2, cwdPath);
|
|
19206
19268
|
}
|
|
19207
|
-
return pathOption === "" || pathOption ===
|
|
19269
|
+
return pathOption === "" || pathOption === path15.delimiter ? `${result.join(path15.delimiter)}${pathOption}` : [...result, pathOption].join(path15.delimiter);
|
|
19208
19270
|
};
|
|
19209
19271
|
var applyPreferLocal = (result, pathParts, cwdPath) => {
|
|
19210
19272
|
for (const directory of traversePathUp(cwdPath)) {
|
|
19211
|
-
const pathPart =
|
|
19273
|
+
const pathPart = path15.join(directory, "node_modules/.bin");
|
|
19212
19274
|
if (!pathParts.includes(pathPart)) {
|
|
19213
19275
|
result.push(pathPart);
|
|
19214
19276
|
}
|
|
19215
19277
|
}
|
|
19216
19278
|
};
|
|
19217
19279
|
var applyExecPath = (result, pathParts, execPath2, cwdPath) => {
|
|
19218
|
-
const pathPart =
|
|
19280
|
+
const pathPart = path15.resolve(cwdPath, toPath(execPath2), "..");
|
|
19219
19281
|
if (!pathParts.includes(pathPart)) {
|
|
19220
19282
|
result.push(pathPart);
|
|
19221
19283
|
}
|
|
@@ -20348,7 +20410,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
20348
20410
|
throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');
|
|
20349
20411
|
}
|
|
20350
20412
|
const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option');
|
|
20351
|
-
const resolvedNodePath =
|
|
20413
|
+
const resolvedNodePath = path15.resolve(cwd, normalizedNodePath);
|
|
20352
20414
|
const newOptions = {
|
|
20353
20415
|
...options,
|
|
20354
20416
|
nodePath: resolvedNodePath,
|
|
@@ -20358,7 +20420,7 @@ var handleNodeOption = (file, commandArguments, {
|
|
|
20358
20420
|
if (!shouldHandleNode) {
|
|
20359
20421
|
return [file, commandArguments, newOptions];
|
|
20360
20422
|
}
|
|
20361
|
-
if (
|
|
20423
|
+
if (path15.basename(file, ".exe") === "node") {
|
|
20362
20424
|
throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');
|
|
20363
20425
|
}
|
|
20364
20426
|
return [
|
|
@@ -20444,7 +20506,7 @@ var ENCODING_ALIASES = {
|
|
|
20444
20506
|
var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding);
|
|
20445
20507
|
var normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
20446
20508
|
const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option');
|
|
20447
|
-
return
|
|
20509
|
+
return path15.resolve(cwdString);
|
|
20448
20510
|
};
|
|
20449
20511
|
var getDefaultCwd = () => {
|
|
20450
20512
|
try {
|
|
@@ -20491,7 +20553,7 @@ var normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
20491
20553
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
20492
20554
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
20493
20555
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
20494
|
-
if (process4.platform === "win32" &&
|
|
20556
|
+
if (process4.platform === "win32" && path15.basename(file, ".exe") === "cmd") {
|
|
20495
20557
|
commandArguments.unshift("/q");
|
|
20496
20558
|
}
|
|
20497
20559
|
return { file, commandArguments, options };
|
|
@@ -24923,12 +24985,12 @@ var TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
|
24923
24985
|
]);
|
|
24924
24986
|
var SKIP_FILES = /* @__PURE__ */ new Set([".DS_Store", "Thumbs.db", ".gitkeep"]);
|
|
24925
24987
|
function resolveTemplatePath(localTemplatePath) {
|
|
24926
|
-
const __dirname =
|
|
24927
|
-
const fromDist =
|
|
24988
|
+
const __dirname = path15.dirname(fileURLToPath(import.meta.url));
|
|
24989
|
+
const fromDist = path15.resolve(__dirname, "../templates");
|
|
24928
24990
|
if (import_fs_extra8.default.existsSync(fromDist)) {
|
|
24929
24991
|
return fromDist;
|
|
24930
24992
|
}
|
|
24931
|
-
const fromSrc =
|
|
24993
|
+
const fromSrc = path15.resolve(__dirname, "../../templates");
|
|
24932
24994
|
if (import_fs_extra8.default.existsSync(fromSrc)) {
|
|
24933
24995
|
return fromSrc;
|
|
24934
24996
|
}
|
|
@@ -24937,15 +24999,19 @@ function resolveTemplatePath(localTemplatePath) {
|
|
|
24937
24999
|
);
|
|
24938
25000
|
}
|
|
24939
25001
|
function buildPlaceholderMap(options) {
|
|
24940
|
-
const { database, databaseUrl } = options;
|
|
24941
|
-
|
|
24942
|
-
|
|
24943
|
-
"{{
|
|
24944
|
-
|
|
25002
|
+
const { database, databaseUrl, pluginName, nextlyRange } = options;
|
|
25003
|
+
const map = {};
|
|
25004
|
+
if (database) {
|
|
25005
|
+
map["{{databaseDialect}}"] = database.type;
|
|
25006
|
+
map["{{databaseUrl}}"] = databaseUrl || database.envExample;
|
|
25007
|
+
}
|
|
25008
|
+
if (pluginName) map["{{pluginName}}"] = pluginName;
|
|
25009
|
+
if (nextlyRange) map["{{nextlyRange}}"] = nextlyRange;
|
|
25010
|
+
return map;
|
|
24945
25011
|
}
|
|
24946
25012
|
async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
24947
|
-
const ext =
|
|
24948
|
-
const basename =
|
|
25013
|
+
const ext = path15.extname(filePath).toLowerCase();
|
|
25014
|
+
const basename = path15.basename(filePath);
|
|
24949
25015
|
const isTextFile = TEXT_EXTENSIONS.has(ext) || basename.startsWith(".env") || basename === ".gitignore";
|
|
24950
25016
|
if (!isTextFile) return;
|
|
24951
25017
|
let content = await import_fs_extra8.default.readFile(filePath, "utf-8");
|
|
@@ -24963,7 +25029,7 @@ async function replacePlaceholdersInFile(filePath, placeholders) {
|
|
|
24963
25029
|
async function replacePlaceholders(dir, placeholders) {
|
|
24964
25030
|
const entries = await import_fs_extra8.default.readdir(dir, { withFileTypes: true });
|
|
24965
25031
|
for (const entry of entries) {
|
|
24966
|
-
const fullPath =
|
|
25032
|
+
const fullPath = path15.join(dir, entry.name);
|
|
24967
25033
|
if (entry.isDirectory()) {
|
|
24968
25034
|
if (entry.name === "node_modules" || entry.name === ".git") continue;
|
|
24969
25035
|
await replacePlaceholders(fullPath, placeholders);
|
|
@@ -24995,7 +25061,8 @@ var NEXTLY_PACKAGES = [
|
|
|
24995
25061
|
"@nextlyhq/adapter-postgres",
|
|
24996
25062
|
"@nextlyhq/adapter-mysql",
|
|
24997
25063
|
"@nextlyhq/adapter-sqlite",
|
|
24998
|
-
"@nextlyhq/plugin-form-builder"
|
|
25064
|
+
"@nextlyhq/plugin-form-builder",
|
|
25065
|
+
"@nextlyhq/plugin-sdk"
|
|
24999
25066
|
];
|
|
25000
25067
|
var resolvedNextlyVersions = null;
|
|
25001
25068
|
async function fetchLatestVersion(pkg) {
|
|
@@ -25038,6 +25105,9 @@ async function resolveRuntimeVersions() {
|
|
|
25038
25105
|
return resolvedRuntimeVersions;
|
|
25039
25106
|
}
|
|
25040
25107
|
async function generatePackageJson(projectName, database, useYalc = false, projectType = "blank") {
|
|
25108
|
+
if (projectType === "plugin") {
|
|
25109
|
+
return generatePluginPackageJson(projectName, useYalc);
|
|
25110
|
+
}
|
|
25041
25111
|
const runtimeVersions = await resolveRuntimeVersions();
|
|
25042
25112
|
const dependencies = {
|
|
25043
25113
|
next: runtimeVersions.next,
|
|
@@ -25104,6 +25174,82 @@ async function generatePackageJson(projectName, database, useYalc = false, proje
|
|
|
25104
25174
|
};
|
|
25105
25175
|
return JSON.stringify(pkg, null, 2) + "\n";
|
|
25106
25176
|
}
|
|
25177
|
+
async function resolvePluginNextlyRange(useYalc) {
|
|
25178
|
+
if (useYalc) return ">=0.0.0";
|
|
25179
|
+
const versions = await resolveNextlyVersions();
|
|
25180
|
+
const v2 = versions["nextly"];
|
|
25181
|
+
return v2 && v2 !== "latest" ? v2 : ">=0.0.0";
|
|
25182
|
+
}
|
|
25183
|
+
async function generatePluginPackageJson(projectName, useYalc) {
|
|
25184
|
+
const versions = useYalc ? {} : await resolveNextlyVersions();
|
|
25185
|
+
const runtimeVersions = await resolveRuntimeVersions();
|
|
25186
|
+
const range = (pkg2) => versions[pkg2] ?? "latest";
|
|
25187
|
+
const peerDependencies = {
|
|
25188
|
+
nextly: range("nextly"),
|
|
25189
|
+
"@nextlyhq/admin": range("@nextlyhq/admin"),
|
|
25190
|
+
"@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
|
|
25191
|
+
react: PINNED_VERSIONS.react,
|
|
25192
|
+
"react-dom": PINNED_VERSIONS["react-dom"]
|
|
25193
|
+
};
|
|
25194
|
+
const devDependencies = {
|
|
25195
|
+
nextly: range("nextly"),
|
|
25196
|
+
"@nextlyhq/admin": range("@nextlyhq/admin"),
|
|
25197
|
+
"@nextlyhq/ui": range("@nextlyhq/ui"),
|
|
25198
|
+
"@nextlyhq/plugin-sdk": range("@nextlyhq/plugin-sdk"),
|
|
25199
|
+
"@nextlyhq/adapter-drizzle": range("@nextlyhq/adapter-drizzle"),
|
|
25200
|
+
"@nextlyhq/adapter-sqlite": range("@nextlyhq/adapter-sqlite"),
|
|
25201
|
+
next: runtimeVersions.next,
|
|
25202
|
+
react: PINNED_VERSIONS.react,
|
|
25203
|
+
"react-dom": PINNED_VERSIONS["react-dom"],
|
|
25204
|
+
"better-sqlite3": "^12.0.0",
|
|
25205
|
+
"@types/node": PINNED_VERSIONS["@types/node"],
|
|
25206
|
+
"@types/react": PINNED_VERSIONS["@types/react"],
|
|
25207
|
+
"@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
|
|
25208
|
+
typescript: PINNED_VERSIONS.typescript,
|
|
25209
|
+
tsup: "^8.5.0",
|
|
25210
|
+
vitest: "^4.0.8",
|
|
25211
|
+
eslint: PINNED_VERSIONS.eslint,
|
|
25212
|
+
"@eslint/js": PINNED_VERSIONS.eslint,
|
|
25213
|
+
"typescript-eslint": "^8.0.0"
|
|
25214
|
+
};
|
|
25215
|
+
const pkg = {
|
|
25216
|
+
name: projectName,
|
|
25217
|
+
version: "0.1.0",
|
|
25218
|
+
description: "A Nextly plugin.",
|
|
25219
|
+
type: "module",
|
|
25220
|
+
main: "./dist/index.mjs",
|
|
25221
|
+
module: "./dist/index.mjs",
|
|
25222
|
+
types: "./dist/index.d.ts",
|
|
25223
|
+
exports: {
|
|
25224
|
+
".": {
|
|
25225
|
+
types: "./dist/index.d.ts",
|
|
25226
|
+
import: "./dist/index.mjs"
|
|
25227
|
+
},
|
|
25228
|
+
"./admin": {
|
|
25229
|
+
types: "./dist/admin/index.d.ts",
|
|
25230
|
+
import: "./dist/admin/index.mjs"
|
|
25231
|
+
}
|
|
25232
|
+
},
|
|
25233
|
+
// Only the built library ships. The dev/ playground is never published.
|
|
25234
|
+
files: ["dist"],
|
|
25235
|
+
keywords: ["nextly", "nextly-plugin"],
|
|
25236
|
+
scripts: {
|
|
25237
|
+
build: "tsup",
|
|
25238
|
+
// Runs the embedded playground (next dev with dev/ as the project root).
|
|
25239
|
+
dev: "next dev dev --turbopack",
|
|
25240
|
+
"check-types": "tsc --noEmit",
|
|
25241
|
+
lint: "eslint .",
|
|
25242
|
+
test: "vitest run",
|
|
25243
|
+
"types:generate": "nextly generate:types"
|
|
25244
|
+
},
|
|
25245
|
+
peerDependencies,
|
|
25246
|
+
devDependencies
|
|
25247
|
+
// Native build-script allowlist is NOT emitted here: pnpm 11 ignores the
|
|
25248
|
+
// package.json `pnpm` field. It lives in pnpm-workspace.yaml instead (written
|
|
25249
|
+
// by copyPluginTemplate via generatePnpmWorkspaceYaml).
|
|
25250
|
+
};
|
|
25251
|
+
return JSON.stringify(pkg, null, 2) + "\n";
|
|
25252
|
+
}
|
|
25107
25253
|
var NATIVE_BUILD_DEPENDENCIES = [
|
|
25108
25254
|
"better-sqlite3",
|
|
25109
25255
|
"esbuild",
|
|
@@ -25143,7 +25289,7 @@ async function copyTemplate(options) {
|
|
|
25143
25289
|
} = options;
|
|
25144
25290
|
if (!allowExistingTarget && targetDir !== process.cwd() && await import_fs_extra8.default.pathExists(targetDir)) {
|
|
25145
25291
|
throw new Error(
|
|
25146
|
-
`Directory "${
|
|
25292
|
+
`Directory "${path15.basename(targetDir)}" already exists. Please choose a different name.`
|
|
25147
25293
|
);
|
|
25148
25294
|
}
|
|
25149
25295
|
let baseDir;
|
|
@@ -25153,8 +25299,12 @@ async function copyTemplate(options) {
|
|
|
25153
25299
|
typeDir = templateSource.templatePath;
|
|
25154
25300
|
} else {
|
|
25155
25301
|
const templatesRoot = resolveTemplatePath();
|
|
25156
|
-
baseDir =
|
|
25157
|
-
typeDir =
|
|
25302
|
+
baseDir = path15.join(templatesRoot, "base");
|
|
25303
|
+
typeDir = path15.join(templatesRoot, projectType);
|
|
25304
|
+
}
|
|
25305
|
+
if (projectType === "plugin") {
|
|
25306
|
+
await copyPluginTemplate({ projectName, typeDir, targetDir, useYalc });
|
|
25307
|
+
return;
|
|
25158
25308
|
}
|
|
25159
25309
|
if (!await import_fs_extra8.default.pathExists(baseDir)) {
|
|
25160
25310
|
throw new Error(
|
|
@@ -25168,52 +25318,52 @@ async function copyTemplate(options) {
|
|
|
25168
25318
|
}
|
|
25169
25319
|
await import_fs_extra8.default.copy(baseDir, targetDir, {
|
|
25170
25320
|
filter: (_src) => {
|
|
25171
|
-
const basename =
|
|
25321
|
+
const basename = path15.basename(_src);
|
|
25172
25322
|
return !SKIP_FILES.has(basename);
|
|
25173
25323
|
}
|
|
25174
25324
|
});
|
|
25175
|
-
const templateSrcDir =
|
|
25325
|
+
const templateSrcDir = path15.join(typeDir, "src");
|
|
25176
25326
|
if (await import_fs_extra8.default.pathExists(templateSrcDir)) {
|
|
25177
|
-
await import_fs_extra8.default.copy(templateSrcDir,
|
|
25327
|
+
await import_fs_extra8.default.copy(templateSrcDir, path15.join(targetDir, "src"), {
|
|
25178
25328
|
overwrite: true,
|
|
25179
25329
|
filter: (_src) => {
|
|
25180
|
-
const basename =
|
|
25330
|
+
const basename = path15.basename(_src);
|
|
25181
25331
|
return !SKIP_FILES.has(basename);
|
|
25182
25332
|
}
|
|
25183
25333
|
});
|
|
25184
25334
|
}
|
|
25185
|
-
const templateRootConfig =
|
|
25335
|
+
const templateRootConfig = path15.join(typeDir, "nextly.config.ts");
|
|
25186
25336
|
if (await import_fs_extra8.default.pathExists(templateRootConfig)) {
|
|
25187
25337
|
await import_fs_extra8.default.copy(
|
|
25188
25338
|
templateRootConfig,
|
|
25189
|
-
|
|
25339
|
+
path15.join(targetDir, "nextly.config.ts"),
|
|
25190
25340
|
{ overwrite: true }
|
|
25191
25341
|
);
|
|
25192
25342
|
}
|
|
25193
|
-
const configsDir =
|
|
25343
|
+
const configsDir = path15.join(typeDir, "configs");
|
|
25194
25344
|
if (approach && await import_fs_extra8.default.pathExists(configsDir)) {
|
|
25195
25345
|
const configFileName = approach === "code-first" ? "codefirst.config.ts" : `${approach}.config.ts`;
|
|
25196
|
-
const configSrc =
|
|
25346
|
+
const configSrc = path15.join(configsDir, configFileName);
|
|
25197
25347
|
if (await import_fs_extra8.default.pathExists(configSrc)) {
|
|
25198
|
-
await import_fs_extra8.default.copy(configSrc,
|
|
25348
|
+
await import_fs_extra8.default.copy(configSrc, path15.join(targetDir, "nextly.config.ts"), {
|
|
25199
25349
|
overwrite: true
|
|
25200
25350
|
});
|
|
25201
25351
|
}
|
|
25202
|
-
const sharedSrc =
|
|
25352
|
+
const sharedSrc = path15.join(configsDir, "shared.ts");
|
|
25203
25353
|
if (await import_fs_extra8.default.pathExists(sharedSrc)) {
|
|
25204
|
-
await import_fs_extra8.default.copy(sharedSrc,
|
|
25354
|
+
await import_fs_extra8.default.copy(sharedSrc, path15.join(targetDir, "shared.ts"), {
|
|
25205
25355
|
overwrite: true
|
|
25206
25356
|
});
|
|
25207
25357
|
}
|
|
25208
25358
|
}
|
|
25209
|
-
const frontendPagePath =
|
|
25359
|
+
const frontendPagePath = path15.join(
|
|
25210
25360
|
targetDir,
|
|
25211
25361
|
"src",
|
|
25212
25362
|
"app",
|
|
25213
25363
|
"(frontend)",
|
|
25214
25364
|
"page.tsx"
|
|
25215
25365
|
);
|
|
25216
|
-
const basePagePath =
|
|
25366
|
+
const basePagePath = path15.join(targetDir, "src", "app", "page.tsx");
|
|
25217
25367
|
if (await import_fs_extra8.default.pathExists(frontendPagePath) && await import_fs_extra8.default.pathExists(basePagePath)) {
|
|
25218
25368
|
await import_fs_extra8.default.remove(basePagePath);
|
|
25219
25369
|
}
|
|
@@ -25224,20 +25374,20 @@ async function copyTemplate(options) {
|
|
|
25224
25374
|
projectType
|
|
25225
25375
|
);
|
|
25226
25376
|
await import_fs_extra8.default.writeFile(
|
|
25227
|
-
|
|
25377
|
+
path15.join(targetDir, "package.json"),
|
|
25228
25378
|
packageJsonContent,
|
|
25229
25379
|
"utf-8"
|
|
25230
25380
|
);
|
|
25231
25381
|
await import_fs_extra8.default.writeFile(
|
|
25232
|
-
|
|
25382
|
+
path15.join(targetDir, "pnpm-workspace.yaml"),
|
|
25233
25383
|
generatePnpmWorkspaceYaml(),
|
|
25234
25384
|
"utf-8"
|
|
25235
25385
|
);
|
|
25236
25386
|
if (database.type === "sqlite") {
|
|
25237
|
-
await import_fs_extra8.default.ensureDir(
|
|
25387
|
+
await import_fs_extra8.default.ensureDir(path15.join(targetDir, "data"));
|
|
25238
25388
|
}
|
|
25239
25389
|
await import_fs_extra8.default.writeFile(
|
|
25240
|
-
|
|
25390
|
+
path15.join(targetDir, "next.config.ts"),
|
|
25241
25391
|
buildNextConfigTemplate(database),
|
|
25242
25392
|
"utf-8"
|
|
25243
25393
|
);
|
|
@@ -25247,6 +25397,42 @@ async function copyTemplate(options) {
|
|
|
25247
25397
|
}
|
|
25248
25398
|
await replacePlaceholders(targetDir, placeholders);
|
|
25249
25399
|
}
|
|
25400
|
+
async function copyPluginTemplate(opts) {
|
|
25401
|
+
const { projectName, typeDir, targetDir, useYalc } = opts;
|
|
25402
|
+
if (!await import_fs_extra8.default.pathExists(typeDir)) {
|
|
25403
|
+
throw new Error(
|
|
25404
|
+
`Plugin template not found at ${typeDir}. The package may be corrupted or the download failed.`
|
|
25405
|
+
);
|
|
25406
|
+
}
|
|
25407
|
+
await import_fs_extra8.default.copy(typeDir, targetDir, {
|
|
25408
|
+
overwrite: true,
|
|
25409
|
+
filter: (src) => {
|
|
25410
|
+
const basename = path15.basename(src);
|
|
25411
|
+
return !SKIP_FILES.has(basename) && basename !== "template.json";
|
|
25412
|
+
}
|
|
25413
|
+
});
|
|
25414
|
+
const packageJsonContent = await generatePackageJson(
|
|
25415
|
+
projectName,
|
|
25416
|
+
{ },
|
|
25417
|
+
useYalc,
|
|
25418
|
+
"plugin"
|
|
25419
|
+
);
|
|
25420
|
+
await import_fs_extra8.default.writeFile(
|
|
25421
|
+
path15.join(targetDir, "package.json"),
|
|
25422
|
+
packageJsonContent,
|
|
25423
|
+
"utf-8"
|
|
25424
|
+
);
|
|
25425
|
+
await import_fs_extra8.default.writeFile(
|
|
25426
|
+
path15.join(targetDir, "pnpm-workspace.yaml"),
|
|
25427
|
+
generatePnpmWorkspaceYaml(),
|
|
25428
|
+
"utf-8"
|
|
25429
|
+
);
|
|
25430
|
+
const nextlyRange = await resolvePluginNextlyRange(useYalc);
|
|
25431
|
+
await replacePlaceholders(
|
|
25432
|
+
targetDir,
|
|
25433
|
+
buildPlaceholderMap({ pluginName: projectName, nextlyRange })
|
|
25434
|
+
);
|
|
25435
|
+
}
|
|
25250
25436
|
|
|
25251
25437
|
// src/installers/dependencies.ts
|
|
25252
25438
|
var INSTALL_COMMANDS = {
|
|
@@ -26752,7 +26938,7 @@ var de2 = class extends D3 {
|
|
|
26752
26938
|
let [o2, h3] = ce2(this.path);
|
|
26753
26939
|
o2 && typeof h3 == "string" && (this.path = h3, r = o2);
|
|
26754
26940
|
}
|
|
26755
|
-
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 ||
|
|
26941
|
+
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.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 });
|
|
26756
26942
|
let n2 = this.statCache.get(this.absolute);
|
|
26757
26943
|
n2 ? this[ei](n2) : this[Qi]();
|
|
26758
26944
|
}
|
|
@@ -26811,7 +26997,7 @@ var de2 = class extends D3 {
|
|
|
26811
26997
|
}
|
|
26812
26998
|
[Qs](t2) {
|
|
26813
26999
|
if (!this.stat) throw new Error("cannot create link entry without stat");
|
|
26814
|
-
this.type = "Link", this.linkpath = f(
|
|
27000
|
+
this.type = "Link", this.linkpath = f(path15.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
|
|
26815
27001
|
}
|
|
26816
27002
|
[qs]() {
|
|
26817
27003
|
if (!this.stat) throw new Error("cannot create file entry without stat");
|
|
@@ -27222,7 +27408,7 @@ var Et3 = class extends D3 {
|
|
|
27222
27408
|
return t2 instanceof Yt ? this[er](t2) : this[hi](t2), this.flowing;
|
|
27223
27409
|
}
|
|
27224
27410
|
[er](t2) {
|
|
27225
|
-
let e = f(
|
|
27411
|
+
let e = f(path15.resolve(this.cwd, t2.path));
|
|
27226
27412
|
if (!this.filter(t2.path, t2)) t2.resume();
|
|
27227
27413
|
else {
|
|
27228
27414
|
let i2 = new di(t2.path, e);
|
|
@@ -27231,7 +27417,7 @@ var Et3 = class extends D3 {
|
|
|
27231
27417
|
this[Ft3]();
|
|
27232
27418
|
}
|
|
27233
27419
|
[hi](t2) {
|
|
27234
|
-
let e = f(
|
|
27420
|
+
let e = f(path15.resolve(this.cwd, t2));
|
|
27235
27421
|
this[W3].push(new di(t2, e)), this[Ft3]();
|
|
27236
27422
|
}
|
|
27237
27423
|
[as](t2) {
|
|
@@ -27369,11 +27555,11 @@ var Hn = (s3, t2) => {
|
|
|
27369
27555
|
};
|
|
27370
27556
|
var or = (s3, t2) => {
|
|
27371
27557
|
t2.forEach((e) => {
|
|
27372
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
27558
|
+
e.charAt(0) === "@" ? It3({ file: path15.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
|
|
27373
27559
|
}), s3.end();
|
|
27374
27560
|
};
|
|
27375
27561
|
var hr = async (s3, t2) => {
|
|
27376
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
27562
|
+
for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => {
|
|
27377
27563
|
s3.add(i2);
|
|
27378
27564
|
} }) : s3.add(e);
|
|
27379
27565
|
s3.end();
|
|
@@ -27411,13 +27597,13 @@ var ui = (s3, t2, e, i2) => {
|
|
|
27411
27597
|
});
|
|
27412
27598
|
};
|
|
27413
27599
|
var Xn = (s3, t2, e, i2, r) => {
|
|
27414
|
-
if (t2.isDirectory()) ds(
|
|
27600
|
+
if (t2.isDirectory()) ds(path15.resolve(s3, t2.name), e, i2, (n2) => {
|
|
27415
27601
|
if (n2) return r(n2);
|
|
27416
|
-
let o2 =
|
|
27602
|
+
let o2 = path15.resolve(s3, t2.name);
|
|
27417
27603
|
ui(o2, e, i2, r);
|
|
27418
27604
|
});
|
|
27419
27605
|
else {
|
|
27420
|
-
let n2 =
|
|
27606
|
+
let n2 = path15.resolve(s3, t2.name);
|
|
27421
27607
|
ui(n2, e, i2, r);
|
|
27422
27608
|
}
|
|
27423
27609
|
};
|
|
@@ -27438,7 +27624,7 @@ var ds = (s3, t2, e, i2) => {
|
|
|
27438
27624
|
});
|
|
27439
27625
|
};
|
|
27440
27626
|
var qn = (s3, t2, e, i2) => {
|
|
27441
|
-
t2.isDirectory() && us(
|
|
27627
|
+
t2.isDirectory() && us(path15.resolve(s3, t2.name), e, i2), fs10(path15.resolve(s3, t2.name), e, i2);
|
|
27442
27628
|
};
|
|
27443
27629
|
var us = (s3, t2, e) => {
|
|
27444
27630
|
let i2;
|
|
@@ -27488,12 +27674,12 @@ var Er = (s3, t2, e) => {
|
|
|
27488
27674
|
};
|
|
27489
27675
|
if (s3 === d) return Qn(s3, S2);
|
|
27490
27676
|
if (l) return jn.mkdir(s3, { mode: r, recursive: true }).then((E) => S2(null, E ?? void 0), S2);
|
|
27491
|
-
let N3 = f(
|
|
27677
|
+
let N3 = f(path15.relative(d, s3)).split("/");
|
|
27492
27678
|
ms(d, N3, r, c3, d, void 0, S2);
|
|
27493
27679
|
};
|
|
27494
27680
|
var ms = (s3, t2, e, i2, r, n2, o2) => {
|
|
27495
27681
|
if (t2.length === 0) return o2(null, n2);
|
|
27496
|
-
let h3 = t2.shift(), a2 = f(
|
|
27682
|
+
let h3 = t2.shift(), a2 = f(path15.resolve(s3 + "/" + h3));
|
|
27497
27683
|
fs.mkdir(a2, e, wr(a2, t2, e, i2, r, n2, o2));
|
|
27498
27684
|
};
|
|
27499
27685
|
var wr = (s3, t2, e, i2, r, n2, o2) => (h3) => {
|
|
@@ -27527,9 +27713,9 @@ var Sr = (s3, t2) => {
|
|
|
27527
27713
|
};
|
|
27528
27714
|
if (s3 === c3) return Jn(c3), d();
|
|
27529
27715
|
if (a2) return d(fs.mkdirSync(s3, { mode: i2, recursive: true }) ?? void 0);
|
|
27530
|
-
let T2 = f(
|
|
27716
|
+
let T2 = f(path15.relative(c3, s3)).split("/"), N3;
|
|
27531
27717
|
for (let E = T2.shift(), x3 = c3; E && (x3 += "/" + E); E = T2.shift()) {
|
|
27532
|
-
x3 = f(
|
|
27718
|
+
x3 = f(path15.resolve(x3));
|
|
27533
27719
|
try {
|
|
27534
27720
|
fs.mkdirSync(x3, i2), N3 = N3 || x3;
|
|
27535
27721
|
} catch {
|
|
@@ -27705,7 +27891,7 @@ var qt = class extends st2 {
|
|
|
27705
27891
|
if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
|
|
27706
27892
|
this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
|
|
27707
27893
|
} else this.uid = void 0, this.gid = void 0, this.setOwner = false;
|
|
27708
|
-
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(
|
|
27894
|
+
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.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));
|
|
27709
27895
|
}
|
|
27710
27896
|
warn(t2, e, i2 = {}) {
|
|
27711
27897
|
return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i2.recoverable = false), super.warn(t2, e, i2);
|
|
@@ -27719,7 +27905,7 @@ var qt = class extends st2 {
|
|
|
27719
27905
|
let [n2, o2] = ce2(i2), h3 = o2.replaceAll(/\\/g, "/").split("/");
|
|
27720
27906
|
if (h3.includes("..") || Oe2 && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
|
|
27721
27907
|
if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t2, [e]: i2 }), false;
|
|
27722
|
-
let a2 =
|
|
27908
|
+
let a2 = path15.posix.dirname(t2.path), l = path15.posix.normalize(path15.posix.join(a2, h3.join("/")));
|
|
27723
27909
|
if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i2 }), false;
|
|
27724
27910
|
}
|
|
27725
27911
|
return n2 && (t2[e] = String(o2), this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute ${e}`, { entry: t2, [e]: i2 })), true;
|
|
@@ -27737,12 +27923,12 @@ var qt = class extends st2 {
|
|
|
27737
27923
|
}
|
|
27738
27924
|
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;
|
|
27739
27925
|
if (!this[Es](t2, "path") || !this[Es](t2, "linkpath")) return false;
|
|
27740
|
-
if (t2.absolute =
|
|
27926
|
+
if (t2.absolute = path15.isAbsolute(t2.path) ? f(path15.resolve(t2.path)) : f(path15.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;
|
|
27741
27927
|
if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
|
|
27742
27928
|
if (this.win32) {
|
|
27743
|
-
let { root: r } =
|
|
27929
|
+
let { root: r } = path15.win32.parse(String(t2.absolute));
|
|
27744
27930
|
t2.absolute = r + Xi(String(t2.absolute).slice(r.length));
|
|
27745
|
-
let { root: n2 } =
|
|
27931
|
+
let { root: n2 } = path15.win32.parse(t2.path);
|
|
27746
27932
|
t2.path = n2 + Xi(t2.path.slice(n2.length));
|
|
27747
27933
|
}
|
|
27748
27934
|
return true;
|
|
@@ -27830,13 +28016,13 @@ var qt = class extends st2 {
|
|
|
27830
28016
|
t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
|
|
27831
28017
|
}
|
|
27832
28018
|
[Tr](t2, e) {
|
|
27833
|
-
let i2 = f(
|
|
28019
|
+
let i2 = f(path15.relative(this.cwd, path15.resolve(path15.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
|
|
27834
28020
|
this[ye2](t2, this.cwd, i2, () => this[Si](t2, String(t2.linkpath), "symlink", e), (r) => {
|
|
27835
28021
|
this[O2](r, t2), e();
|
|
27836
28022
|
});
|
|
27837
28023
|
}
|
|
27838
28024
|
[xr](t2, e) {
|
|
27839
|
-
let i2 = f(
|
|
28025
|
+
let i2 = f(path15.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
|
|
27840
28026
|
this[ye2](t2, this.cwd, r, () => this[Si](t2, i2, "link", e), (n2) => {
|
|
27841
28027
|
this[O2](n2, t2), e();
|
|
27842
28028
|
});
|
|
@@ -27844,10 +28030,10 @@ var qt = class extends st2 {
|
|
|
27844
28030
|
[ye2](t2, e, i2, r, n2) {
|
|
27845
28031
|
let o2 = i2.shift();
|
|
27846
28032
|
if (this.preservePaths || o2 === void 0) return r();
|
|
27847
|
-
let h3 =
|
|
28033
|
+
let h3 = path15.resolve(e, o2);
|
|
27848
28034
|
fs.lstat(h3, (a2, l) => {
|
|
27849
28035
|
if (a2) return r();
|
|
27850
|
-
if (l?.isSymbolicLink()) return n2(new wt2(h3,
|
|
28036
|
+
if (l?.isSymbolicLink()) return n2(new wt2(h3, path15.resolve(h3, i2.join("/"))));
|
|
27851
28037
|
this[ye2](t2, h3, i2, r, n2);
|
|
27852
28038
|
});
|
|
27853
28039
|
}
|
|
@@ -27881,7 +28067,7 @@ var qt = class extends st2 {
|
|
|
27881
28067
|
});
|
|
27882
28068
|
}, n2 = () => {
|
|
27883
28069
|
if (t2.absolute !== this.cwd) {
|
|
27884
|
-
let h3 = f(
|
|
28070
|
+
let h3 = f(path15.dirname(String(t2.absolute)));
|
|
27885
28071
|
if (h3 !== this.cwd) return this[St2](h3, this.dmode, (a2) => {
|
|
27886
28072
|
if (a2) {
|
|
27887
28073
|
this[O2](a2, t2), i2();
|
|
@@ -27956,7 +28142,7 @@ var Te2 = class extends qt {
|
|
|
27956
28142
|
this[ge2] = true;
|
|
27957
28143
|
}
|
|
27958
28144
|
if (t2.absolute !== this.cwd) {
|
|
27959
|
-
let n2 = f(
|
|
28145
|
+
let n2 = f(path15.dirname(String(t2.absolute)));
|
|
27960
28146
|
if (n2 !== this.cwd) {
|
|
27961
28147
|
let o2 = this[St2](n2, this.dmode);
|
|
27962
28148
|
if (o2) return this[O2](o2, t2);
|
|
@@ -28056,10 +28242,10 @@ var Te2 = class extends qt {
|
|
|
28056
28242
|
if (this.preservePaths || i2.length === 0) return r();
|
|
28057
28243
|
let o2 = e;
|
|
28058
28244
|
for (let h3 of i2) {
|
|
28059
|
-
o2 =
|
|
28245
|
+
o2 = path15.resolve(o2, h3);
|
|
28060
28246
|
let [a2, l] = Se2(() => fs.lstatSync(o2));
|
|
28061
28247
|
if (a2) return r();
|
|
28062
|
-
if (l.isSymbolicLink()) return n2(new wt2(o2,
|
|
28248
|
+
if (l.isSymbolicLink()) return n2(new wt2(o2, path15.resolve(e, i2.join("/"))));
|
|
28063
28249
|
}
|
|
28064
28250
|
r();
|
|
28065
28251
|
}
|
|
@@ -28163,11 +28349,11 @@ var mo = (s3, t2) => {
|
|
|
28163
28349
|
};
|
|
28164
28350
|
var po = (s3, t2) => {
|
|
28165
28351
|
t2.forEach((e) => {
|
|
28166
|
-
e.charAt(0) === "@" ? It3({ file:
|
|
28352
|
+
e.charAt(0) === "@" ? It3({ file: path15.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
|
|
28167
28353
|
}), s3.end();
|
|
28168
28354
|
};
|
|
28169
28355
|
var Eo = async (s3, t2) => {
|
|
28170
|
-
for (let e of t2) e.charAt(0) === "@" ? await It3({ file:
|
|
28356
|
+
for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
|
|
28171
28357
|
s3.end();
|
|
28172
28358
|
};
|
|
28173
28359
|
var vt3 = K2(fo, mo, () => {
|
|
@@ -28192,7 +28378,7 @@ var GITHUB_ORG = "nextlyhq";
|
|
|
28192
28378
|
var GITHUB_REPO = "nextly";
|
|
28193
28379
|
async function downloadTemplate(templateName, branch = "main") {
|
|
28194
28380
|
const url = `https://codeload.github.com/${GITHUB_ORG}/${GITHUB_REPO}/tar.gz/${branch}`;
|
|
28195
|
-
const tmpDir =
|
|
28381
|
+
const tmpDir = path15.join(
|
|
28196
28382
|
process.env.TMPDIR || "/tmp",
|
|
28197
28383
|
`nextly-template-${Date.now()}`
|
|
28198
28384
|
);
|
|
@@ -28234,8 +28420,8 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
28234
28420
|
}
|
|
28235
28421
|
throw error;
|
|
28236
28422
|
}
|
|
28237
|
-
const basePath =
|
|
28238
|
-
const templatePath =
|
|
28423
|
+
const basePath = path15.join(tmpDir, "templates", "base");
|
|
28424
|
+
const templatePath = path15.join(tmpDir, "templates", templateName);
|
|
28239
28425
|
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
28240
28426
|
await import_fs_extra9.default.remove(tmpDir).catch(() => {
|
|
28241
28427
|
});
|
|
@@ -28253,8 +28439,8 @@ async function downloadTemplate(templateName, branch = "main") {
|
|
|
28253
28439
|
return { basePath, templatePath };
|
|
28254
28440
|
}
|
|
28255
28441
|
async function resolveLocalTemplate(localPath, templateName) {
|
|
28256
|
-
const basePath =
|
|
28257
|
-
const templatePath =
|
|
28442
|
+
const basePath = path15.join(localPath, "base");
|
|
28443
|
+
const templatePath = path15.join(localPath, templateName);
|
|
28258
28444
|
if (!await import_fs_extra9.default.pathExists(basePath)) {
|
|
28259
28445
|
throw new Error(
|
|
28260
28446
|
`Base template not found at ${basePath}. Check the --local-template path points to the templates/ directory.`
|
|
@@ -28277,7 +28463,7 @@ async function resolveTemplateSource(templateName, options = {}) {
|
|
|
28277
28463
|
async function cleanupDownload(source) {
|
|
28278
28464
|
const tmpBase = process.env.TMPDIR || "/tmp";
|
|
28279
28465
|
if (source.basePath.startsWith(tmpBase)) {
|
|
28280
|
-
const extractionRoot =
|
|
28466
|
+
const extractionRoot = path15.resolve(source.basePath, "../..");
|
|
28281
28467
|
await import_fs_extra9.default.remove(extractionRoot).catch(() => {
|
|
28282
28468
|
});
|
|
28283
28469
|
}
|
|
@@ -28312,6 +28498,22 @@ var AVAILABLE_TEMPLATES = [
|
|
|
28312
28498
|
hasFrontendPages: true,
|
|
28313
28499
|
recommendedDatabase: "any",
|
|
28314
28500
|
release: "alpha"
|
|
28501
|
+
},
|
|
28502
|
+
{
|
|
28503
|
+
name: "plugin",
|
|
28504
|
+
label: "Plugin",
|
|
28505
|
+
description: "Build a reusable Nextly plugin (publishable npm package)",
|
|
28506
|
+
hint: "Plugin package + embedded /dev playground; no schema approach",
|
|
28507
|
+
// Plugins don't ask code-first vs visual, ship no app frontend, and bring
|
|
28508
|
+
// their own collections — they are a publishable library, not an app.
|
|
28509
|
+
approaches: [],
|
|
28510
|
+
defaultApproach: null,
|
|
28511
|
+
collections: [],
|
|
28512
|
+
singles: [],
|
|
28513
|
+
hasDemoData: false,
|
|
28514
|
+
hasFrontendPages: false,
|
|
28515
|
+
recommendedDatabase: "sqlite",
|
|
28516
|
+
release: "alpha"
|
|
28315
28517
|
}
|
|
28316
28518
|
];
|
|
28317
28519
|
function getTemplate(name) {
|
|
@@ -28382,7 +28584,7 @@ var DATABASE_LABELS = {
|
|
|
28382
28584
|
};
|
|
28383
28585
|
var import_fs_extra10 = __toESM(require_lib(), 1);
|
|
28384
28586
|
async function isExistingNextProject(cwd) {
|
|
28385
|
-
const packageJsonPath =
|
|
28587
|
+
const packageJsonPath = path15.join(cwd, "package.json");
|
|
28386
28588
|
if (!await import_fs_extra10.default.pathExists(packageJsonPath)) return false;
|
|
28387
28589
|
try {
|
|
28388
28590
|
const packageJson = await import_fs_extra10.default.readJson(packageJsonPath);
|
|
@@ -28446,6 +28648,11 @@ function getTemplatePromptOptions() {
|
|
|
28446
28648
|
label: "Blog",
|
|
28447
28649
|
hint: "Posts, authors, categories, clean design"
|
|
28448
28650
|
},
|
|
28651
|
+
{
|
|
28652
|
+
value: "plugin",
|
|
28653
|
+
label: "Plugin",
|
|
28654
|
+
hint: "Build a reusable Nextly plugin + embedded /dev playground"
|
|
28655
|
+
},
|
|
28449
28656
|
{
|
|
28450
28657
|
value: "_coming_soon",
|
|
28451
28658
|
label: import_picocolors2.default.dim("More templates coming soon"),
|
|
@@ -28474,13 +28681,13 @@ function detectPmFromUserAgent(userAgent) {
|
|
|
28474
28681
|
async function detectPackageManager2(cwd) {
|
|
28475
28682
|
const fromUa = detectPmFromUserAgent(process.env.npm_config_user_agent);
|
|
28476
28683
|
if (fromUa) return fromUa;
|
|
28477
|
-
if (await import_fs_extra11.default.pathExists(
|
|
28478
|
-
if (await import_fs_extra11.default.pathExists(
|
|
28479
|
-
if (await import_fs_extra11.default.pathExists(
|
|
28684
|
+
if (await import_fs_extra11.default.pathExists(path15.join(cwd, "pnpm-lock.yaml"))) return "pnpm";
|
|
28685
|
+
if (await import_fs_extra11.default.pathExists(path15.join(cwd, "yarn.lock"))) return "yarn";
|
|
28686
|
+
if (await import_fs_extra11.default.pathExists(path15.join(cwd, "bun.lockb"))) return "bun";
|
|
28480
28687
|
return "npm";
|
|
28481
28688
|
}
|
|
28482
28689
|
async function detectProject(cwd) {
|
|
28483
|
-
const packageJsonPath =
|
|
28690
|
+
const packageJsonPath = path15.join(cwd, "package.json");
|
|
28484
28691
|
if (!await import_fs_extra11.default.pathExists(packageJsonPath)) {
|
|
28485
28692
|
throw new Error(
|
|
28486
28693
|
"No package.json found. Please run this command in a Next.js project."
|
|
@@ -28498,8 +28705,8 @@ async function detectProject(cwd) {
|
|
|
28498
28705
|
);
|
|
28499
28706
|
}
|
|
28500
28707
|
const nextVersion = deps.next?.replace(/[\^~]/, "") || null;
|
|
28501
|
-
const srcDir = await import_fs_extra11.default.pathExists(
|
|
28502
|
-
const appDirPaths = srcDir ? [
|
|
28708
|
+
const srcDir = await import_fs_extra11.default.pathExists(path15.join(cwd, "src"));
|
|
28709
|
+
const appDirPaths = srcDir ? [path15.join(cwd, "src", "app")] : [path15.join(cwd, "app")];
|
|
28503
28710
|
let isAppRouter = false;
|
|
28504
28711
|
for (const appPath of appDirPaths) {
|
|
28505
28712
|
if (await import_fs_extra11.default.pathExists(appPath)) {
|
|
@@ -28512,7 +28719,7 @@ async function detectProject(cwd) {
|
|
|
28512
28719
|
"App Router not detected. Nextly requires Next.js App Router (app/ directory)."
|
|
28513
28720
|
);
|
|
28514
28721
|
}
|
|
28515
|
-
const hasTypescript = await import_fs_extra11.default.pathExists(
|
|
28722
|
+
const hasTypescript = await import_fs_extra11.default.pathExists(path15.join(cwd, "tsconfig.json"));
|
|
28516
28723
|
const packageManager = await detectPackageManager2(cwd);
|
|
28517
28724
|
const appDir = srcDir ? "src/app" : "app";
|
|
28518
28725
|
return {
|
|
@@ -28537,13 +28744,13 @@ async function emptyDirectory(dir) {
|
|
|
28537
28744
|
if (!await import_fs_extra12.default.pathExists(dir)) return;
|
|
28538
28745
|
for (const entry of await import_fs_extra12.default.readdir(dir)) {
|
|
28539
28746
|
if (entry === ".git") continue;
|
|
28540
|
-
await import_fs_extra12.default.remove(
|
|
28747
|
+
await import_fs_extra12.default.remove(path15.join(dir, entry));
|
|
28541
28748
|
}
|
|
28542
28749
|
}
|
|
28543
28750
|
|
|
28544
28751
|
// src/create-nextly.ts
|
|
28545
28752
|
function cwdProjectName(cwd) {
|
|
28546
|
-
const basename =
|
|
28753
|
+
const basename = path15.basename(cwd);
|
|
28547
28754
|
if (!/^[a-z0-9][a-z0-9._-]*$/.test(basename)) {
|
|
28548
28755
|
return DEFAULT_PROJECT_NAME;
|
|
28549
28756
|
}
|
|
@@ -28597,7 +28804,7 @@ async function createNextly(options = {}) {
|
|
|
28597
28804
|
}
|
|
28598
28805
|
let allowExistingTarget = false;
|
|
28599
28806
|
if (isFreshProject && projectName) {
|
|
28600
|
-
const conflictTargetDir = installInCwd ? cwd :
|
|
28807
|
+
const conflictTargetDir = installInCwd ? cwd : path15.join(cwd, projectName);
|
|
28601
28808
|
if (await isDirectoryNotEmpty(conflictTargetDir)) {
|
|
28602
28809
|
const targetLabel = installInCwd ? "the current directory" : `"${projectName}"`;
|
|
28603
28810
|
const choice = await promptDirectoryConflict(targetLabel);
|
|
@@ -28707,7 +28914,7 @@ async function createNextly(options = {}) {
|
|
|
28707
28914
|
databaseUrl = url?.trim() || database.connectionUrl;
|
|
28708
28915
|
}
|
|
28709
28916
|
if (isFreshProject && projectName) {
|
|
28710
|
-
const targetDir = installInCwd ? cwd :
|
|
28917
|
+
const targetDir = installInCwd ? cwd : path15.join(cwd, projectName);
|
|
28711
28918
|
const s3 = be();
|
|
28712
28919
|
let templateSource;
|
|
28713
28920
|
try {
|
|
@@ -28820,8 +29027,10 @@ async function createNextly(options = {}) {
|
|
|
28820
29027
|
await generateTypesDirectory(cwd, projectInfo);
|
|
28821
29028
|
await patchNextConfig(cwd, database);
|
|
28822
29029
|
}
|
|
28823
|
-
|
|
28824
|
-
|
|
29030
|
+
if (projectType !== "plugin") {
|
|
29031
|
+
const envDatabase = databaseUrl ? { ...database, connectionUrl: databaseUrl, envExample: databaseUrl } : database;
|
|
29032
|
+
await generateEnv(cwd, envDatabase);
|
|
29033
|
+
}
|
|
28825
29034
|
s3.stop("Environment configured");
|
|
28826
29035
|
} catch (error) {
|
|
28827
29036
|
s3.stop("Failed to generate configuration");
|
|
@@ -28840,31 +29049,58 @@ async function createNextly(options = {}) {
|
|
|
28840
29049
|
if (isFreshProject && projectName && !installInCwd) {
|
|
28841
29050
|
lines.push(` ${import_picocolors3.default.bold("cd")} ${projectName}`);
|
|
28842
29051
|
}
|
|
28843
|
-
|
|
28844
|
-
|
|
28845
|
-
|
|
29052
|
+
if (projectType === "plugin") {
|
|
29053
|
+
lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
|
|
29054
|
+
lines.push(
|
|
29055
|
+
` ${import_picocolors3.default.dim("\u2192 runs the embedded /dev playground (SQLite, hot-reload)")}`
|
|
29056
|
+
);
|
|
29057
|
+
lines.push("");
|
|
29058
|
+
lines.push(
|
|
29059
|
+
` Open ${import_picocolors3.default.cyan("http://localhost:3000/admin")} \u2014 your plugin is registered.`
|
|
29060
|
+
);
|
|
29061
|
+
lines.push(
|
|
29062
|
+
` Edit your plugin in ${import_picocolors3.default.dim("src/")}; the ${import_picocolors3.default.dim("dev/")} app is never published.`
|
|
29063
|
+
);
|
|
29064
|
+
lines.push("");
|
|
29065
|
+
lines.push(
|
|
29066
|
+
` ${import_picocolors3.default.bold(`${pm} test`)} runs the in-memory integration harness.`
|
|
29067
|
+
);
|
|
29068
|
+
lines.push(
|
|
29069
|
+
` ${import_picocolors3.default.bold(`${pm} run build`)}, then ${import_picocolors3.default.bold("npm publish")} to ship.`
|
|
29070
|
+
);
|
|
29071
|
+
lines.push("");
|
|
28846
29072
|
lines.push(
|
|
28847
|
-
`
|
|
29073
|
+
` Use it in an app: add ${import_picocolors3.default.dim("myPlugin()")} to ${import_picocolors3.default.dim("plugins")} in nextly.config.ts.`
|
|
28848
29074
|
);
|
|
28849
29075
|
} else {
|
|
29076
|
+
lines.push(` ${import_picocolors3.default.bold(devCommand)}`);
|
|
29077
|
+
lines.push("");
|
|
29078
|
+
if (databaseType === "sqlite") {
|
|
29079
|
+
lines.push(
|
|
29080
|
+
` Your database (SQLite) is stored at ${import_picocolors3.default.dim("./data/nextly.db")}`
|
|
29081
|
+
);
|
|
29082
|
+
} else {
|
|
29083
|
+
lines.push(
|
|
29084
|
+
` Make sure your ${DATABASE_LABELS[databaseType].label} server is running before starting.`
|
|
29085
|
+
);
|
|
29086
|
+
}
|
|
28850
29087
|
lines.push(
|
|
28851
|
-
`
|
|
29088
|
+
` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
|
|
28852
29089
|
);
|
|
29090
|
+
if (projectType === "blog") {
|
|
29091
|
+
lines.push(
|
|
29092
|
+
` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`
|
|
29093
|
+
);
|
|
29094
|
+
}
|
|
29095
|
+
lines.push(
|
|
29096
|
+
` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
|
|
29097
|
+
);
|
|
29098
|
+
lines.push("");
|
|
29099
|
+
lines.push(
|
|
29100
|
+
` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
|
|
29101
|
+
);
|
|
29102
|
+
lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
|
|
28853
29103
|
}
|
|
28854
|
-
lines.push(
|
|
28855
|
-
` ${import_picocolors3.default.bold(devCommand)} will create system tables on first run.`
|
|
28856
|
-
);
|
|
28857
|
-
if (projectType === "blog") {
|
|
28858
|
-
lines.push(` Visit ${import_picocolors3.default.cyan("http://localhost:3000")} to see your blog.`);
|
|
28859
|
-
}
|
|
28860
|
-
lines.push(
|
|
28861
|
-
` Visit ${import_picocolors3.default.cyan("http://localhost:3000/admin/setup")} to create your admin account.`
|
|
28862
|
-
);
|
|
28863
|
-
lines.push("");
|
|
28864
|
-
lines.push(
|
|
28865
|
-
` Storage: Using local disk ${import_picocolors3.default.dim("(./public/uploads)")} by default.`
|
|
28866
|
-
);
|
|
28867
|
-
lines.push(" See docs to configure S3, Vercel Blob, or other providers.");
|
|
28868
29104
|
Vt2(lines.join("\n"), "Next steps");
|
|
28869
29105
|
capture("scaffold_completed", {
|
|
28870
29106
|
total_duration_ms: Date.now() - overallStartedAt,
|
|
@@ -28888,5 +29124,5 @@ async function createNextly(options = {}) {
|
|
|
28888
29124
|
*/
|
|
28889
29125
|
|
|
28890
29126
|
export { __commonJS, __require, __toESM, capture, createNextly, init, resolveProjectArg, shutdown, validateProjectName };
|
|
28891
|
-
//# sourceMappingURL=chunk-
|
|
28892
|
-
//# sourceMappingURL=chunk-
|
|
29127
|
+
//# sourceMappingURL=chunk-C5CWOU22.mjs.map
|
|
29128
|
+
//# sourceMappingURL=chunk-C5CWOU22.mjs.map
|