@wix/create-new 0.0.18 → 0.0.19
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/build/index.js +132 -55
- package/build/index.js.map +1 -1
- package/package.json +2 -2
package/build/index.js
CHANGED
|
@@ -7962,8 +7962,8 @@ var require_follow_redirects = __commonJS({
|
|
|
7962
7962
|
}
|
|
7963
7963
|
return parsed;
|
|
7964
7964
|
}
|
|
7965
|
-
function resolveUrl2(
|
|
7966
|
-
return useNativeURL ? new URL2(
|
|
7965
|
+
function resolveUrl2(relative5, base) {
|
|
7966
|
+
return useNativeURL ? new URL2(relative5, base) : parseUrl2(url2.resolve(base, relative5));
|
|
7967
7967
|
}
|
|
7968
7968
|
function validateUrl(input) {
|
|
7969
7969
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -37642,15 +37642,15 @@ var require_pattern = __commonJS({
|
|
|
37642
37642
|
exports.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
37643
37643
|
function partitionAbsoluteAndRelative(patterns) {
|
|
37644
37644
|
const absolute = [];
|
|
37645
|
-
const
|
|
37645
|
+
const relative5 = [];
|
|
37646
37646
|
for (const pattern of patterns) {
|
|
37647
37647
|
if (isAbsolute2(pattern)) {
|
|
37648
37648
|
absolute.push(pattern);
|
|
37649
37649
|
} else {
|
|
37650
|
-
|
|
37650
|
+
relative5.push(pattern);
|
|
37651
37651
|
}
|
|
37652
37652
|
}
|
|
37653
|
-
return [absolute,
|
|
37653
|
+
return [absolute, relative5];
|
|
37654
37654
|
}
|
|
37655
37655
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
37656
37656
|
function isAbsolute2(pattern) {
|
|
@@ -41315,10 +41315,10 @@ var require_ejs = __commonJS({
|
|
|
41315
41315
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
41316
41316
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
41317
41317
|
exports.resolveInclude = function(name, filename, isDir) {
|
|
41318
|
-
var
|
|
41318
|
+
var dirname7 = path8.dirname;
|
|
41319
41319
|
var extname2 = path8.extname;
|
|
41320
41320
|
var resolve6 = path8.resolve;
|
|
41321
|
-
var includePath = resolve6(isDir ? filename :
|
|
41321
|
+
var includePath = resolve6(isDir ? filename : dirname7(filename), name);
|
|
41322
41322
|
var ext = extname2(name);
|
|
41323
41323
|
if (!ext) {
|
|
41324
41324
|
includePath += ".ejs";
|
|
@@ -44966,7 +44966,7 @@ var require_util3 = __commonJS({
|
|
|
44966
44966
|
return path8;
|
|
44967
44967
|
});
|
|
44968
44968
|
exports.normalize = normalize4;
|
|
44969
|
-
function
|
|
44969
|
+
function join28(aRoot, aPath) {
|
|
44970
44970
|
if (aRoot === "") {
|
|
44971
44971
|
aRoot = ".";
|
|
44972
44972
|
}
|
|
@@ -44998,11 +44998,11 @@ var require_util3 = __commonJS({
|
|
|
44998
44998
|
}
|
|
44999
44999
|
return joined;
|
|
45000
45000
|
}
|
|
45001
|
-
exports.join =
|
|
45001
|
+
exports.join = join28;
|
|
45002
45002
|
exports.isAbsolute = function(aPath) {
|
|
45003
45003
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
45004
45004
|
};
|
|
45005
|
-
function
|
|
45005
|
+
function relative5(aRoot, aPath) {
|
|
45006
45006
|
if (aRoot === "") {
|
|
45007
45007
|
aRoot = ".";
|
|
45008
45008
|
}
|
|
@@ -45021,7 +45021,7 @@ var require_util3 = __commonJS({
|
|
|
45021
45021
|
}
|
|
45022
45022
|
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
45023
45023
|
}
|
|
45024
|
-
exports.relative =
|
|
45024
|
+
exports.relative = relative5;
|
|
45025
45025
|
var supportsNullProto = function() {
|
|
45026
45026
|
var obj = /* @__PURE__ */ Object.create(null);
|
|
45027
45027
|
return !("__proto__" in obj);
|
|
@@ -45212,7 +45212,7 @@ var require_util3 = __commonJS({
|
|
|
45212
45212
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
45213
45213
|
}
|
|
45214
45214
|
}
|
|
45215
|
-
sourceURL =
|
|
45215
|
+
sourceURL = join28(urlGenerate(parsed), sourceURL);
|
|
45216
45216
|
}
|
|
45217
45217
|
return normalize4(sourceURL);
|
|
45218
45218
|
}
|
|
@@ -100288,7 +100288,71 @@ var Questions = ({
|
|
|
100288
100288
|
init_esm_shims();
|
|
100289
100289
|
var import_variant44 = __toESM(require_lib(), 1);
|
|
100290
100290
|
import { mkdir as mkdir3 } from "node:fs/promises";
|
|
100291
|
-
import { join as
|
|
100291
|
+
import { join as join19 } from "node:path";
|
|
100292
|
+
|
|
100293
|
+
// ../create-new-packages/agent-configs/src/index.ts
|
|
100294
|
+
init_esm_shims();
|
|
100295
|
+
import { createRequire } from "node:module";
|
|
100296
|
+
import { dirname as dirname5, join as join14, relative as relative4 } from "node:path";
|
|
100297
|
+
|
|
100298
|
+
// ../create-new-packages/agent-configs/src/extensions-docs.ts
|
|
100299
|
+
init_esm_shims();
|
|
100300
|
+
var extensionsDocs = defaultOutdent`
|
|
100301
|
+
## Extensions
|
|
100302
|
+
|
|
100303
|
+
General reference: [About Extensions](https://dev.wix.com/docs/wix-cli/guides/extensions/about-extensions)
|
|
100304
|
+
|
|
100305
|
+
Base URL: \`https://dev.wix.com/docs/wix-cli/guides/extensions\`
|
|
100306
|
+
|
|
100307
|
+
### Dashboard Extensions
|
|
100308
|
+
- **Dashboard Pages**: \`/dashboard-extensions/dashboard-pages/\` → \`add-dashboard-page-extensions\` | \`dashboard-page-extension-files-and-code\`
|
|
100309
|
+
- **Dashboard Plugins**: \`/dashboard-extensions/dashboard-plugins/\` → \`add-dashboard-plugin-extensions\` | \`dashboard-plugin-extension-files-and-code\`
|
|
100310
|
+
- **Dashboard Modals**: \`/dashboard-extensions/dashboard-modals/\` → \`add-dashboard-modal-extensions\` | \`dashboard-modal-extension-files-and-code\`
|
|
100311
|
+
- **Dashboard Menu Plugins**: \`/dashboard-extensions/dashboard-menu-plugins/\` → \`add-dashboard-menu-plugin-extensions\` | \`dashboard-menu-plugin-extension-files-and-code\`
|
|
100312
|
+
|
|
100313
|
+
### Backend Extensions
|
|
100314
|
+
- **Events**: \`/backend-extensions/events/\` → \`add-event-extensions\` | \`event-extension-files-and-code\`
|
|
100315
|
+
- **Service Plugins**: \`/backend-extensions/service-plugins/\` → \`add-service-plugin-extensions\` | \`service-plugin-extension-files-and-code\`
|
|
100316
|
+
|
|
100317
|
+
### Site Extensions
|
|
100318
|
+
- **Site Widgets**: \`/site-extensions/site-widgets/\` → \`add-site-widget-extensions\` | \`site-widget-extension-files-and-code\`
|
|
100319
|
+
- **Site Plugins**: \`/site-extensions/site-plugins/\` → \`add-site-plugin-extensions\` | \`site-plugin-extension-files-and-code\`
|
|
100320
|
+
- **Embedded Scripts**: \`/site-extensions/embedded-scripts/\` → \`add-embedded-script-extensions\` | \`embedded-script-extension-files-and-code\`
|
|
100321
|
+
`;
|
|
100322
|
+
|
|
100323
|
+
// ../create-new-packages/agent-configs/src/index.ts
|
|
100324
|
+
var agentConfigsTaskText = {
|
|
100325
|
+
loadingText: "Generating agent configuration files...",
|
|
100326
|
+
successText: "Agent configuration files generated!"
|
|
100327
|
+
};
|
|
100328
|
+
async function generateAgentConfigs(packageFolder) {
|
|
100329
|
+
try {
|
|
100330
|
+
const require2 = createRequire(join14(packageFolder, "package.json"));
|
|
100331
|
+
const cliPackagePath = require2.resolve("@wix/cli/package.json");
|
|
100332
|
+
const cliAgentsAbsolutePath = join14(
|
|
100333
|
+
dirname5(cliPackagePath),
|
|
100334
|
+
"agents",
|
|
100335
|
+
"instructions.md"
|
|
100336
|
+
);
|
|
100337
|
+
const cliAgentsPath = relative4(packageFolder, cliAgentsAbsolutePath);
|
|
100338
|
+
const agentsMdContent = defaultOutdent`
|
|
100339
|
+
## CLI Commands
|
|
100340
|
+
|
|
100341
|
+
All CLI instructions can be found at:
|
|
100342
|
+
${cliAgentsPath}
|
|
100343
|
+
|
|
100344
|
+
${extensionsDocs}
|
|
100345
|
+
`;
|
|
100346
|
+
await outputFile(join14(packageFolder, "AGENTS.md"), agentsMdContent);
|
|
100347
|
+
await writeJson(
|
|
100348
|
+
join14(packageFolder, ".gemini", "settings.json"),
|
|
100349
|
+
{ contextFileName: "AGENTS.md" },
|
|
100350
|
+
{ spaces: 2 }
|
|
100351
|
+
);
|
|
100352
|
+
await outputFile(join14(packageFolder, "CLAUDE.md"), "@AGENTS.md");
|
|
100353
|
+
} catch {
|
|
100354
|
+
}
|
|
100355
|
+
}
|
|
100292
100356
|
|
|
100293
100357
|
// ../create-new-packages/app-command/src/services/generator/index.ts
|
|
100294
100358
|
init_esm_shims();
|
|
@@ -100305,7 +100369,7 @@ init_esm_shims();
|
|
|
100305
100369
|
init_esm_shims();
|
|
100306
100370
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
100307
100371
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
100308
|
-
import { resolve as resolve4, dirname as
|
|
100372
|
+
import { resolve as resolve4, dirname as dirname6, extname } from "node:path";
|
|
100309
100373
|
import { readFile as readFile3, copyFile } from "node:fs/promises";
|
|
100310
100374
|
|
|
100311
100375
|
// ../gena/src/fs-extra.ts
|
|
@@ -100327,7 +100391,7 @@ async function justCopy({
|
|
|
100327
100391
|
path: path8
|
|
100328
100392
|
}) {
|
|
100329
100393
|
const to = resolve4(cwd3, template);
|
|
100330
|
-
await outputDir(
|
|
100394
|
+
await outputDir(dirname6(to));
|
|
100331
100395
|
await copyFile(path8, to);
|
|
100332
100396
|
return to;
|
|
100333
100397
|
}
|
|
@@ -100356,7 +100420,7 @@ async function generator(opts) {
|
|
|
100356
100420
|
|
|
100357
100421
|
// ../gena/src/component-generator.ts
|
|
100358
100422
|
init_esm_shims();
|
|
100359
|
-
import { join as
|
|
100423
|
+
import { join as join16 } from "node:path";
|
|
100360
100424
|
|
|
100361
100425
|
// ../gena/src/dependencies-updater.ts
|
|
100362
100426
|
init_esm_shims();
|
|
@@ -100437,13 +100501,13 @@ async function dependenciesUpdater(opts) {
|
|
|
100437
100501
|
|
|
100438
100502
|
// ../gena/src/assets-generator.ts
|
|
100439
100503
|
init_esm_shims();
|
|
100440
|
-
import { resolve as resolve5, join as
|
|
100504
|
+
import { resolve as resolve5, join as join15 } from "node:path";
|
|
100441
100505
|
import { copyFile as copyFile2, mkdir as mkdir2 } from "node:fs/promises";
|
|
100442
100506
|
async function assetsGenerator(opts) {
|
|
100443
100507
|
const { templateRoot, projectFolder, outputPath, assetsPrefix } = opts;
|
|
100444
|
-
const assets =
|
|
100508
|
+
const assets = join15(templateRoot, "assets");
|
|
100445
100509
|
if (await pathExists(assets)) {
|
|
100446
|
-
const publicDir =
|
|
100510
|
+
const publicDir = join15(projectFolder, outputPath ?? "");
|
|
100447
100511
|
const publicFiles = await getFiles(assets);
|
|
100448
100512
|
await mkdir2(publicDir, { recursive: true });
|
|
100449
100513
|
await Promise.all(
|
|
@@ -100468,7 +100532,7 @@ async function componentGenerator(opts) {
|
|
|
100468
100532
|
} = opts;
|
|
100469
100533
|
const newFiles = await generator({
|
|
100470
100534
|
...generatorOpts,
|
|
100471
|
-
template:
|
|
100535
|
+
template: join16(template, "files")
|
|
100472
100536
|
});
|
|
100473
100537
|
await assetsGenerator({
|
|
100474
100538
|
templateRoot: template,
|
|
@@ -100478,7 +100542,7 @@ async function componentGenerator(opts) {
|
|
|
100478
100542
|
});
|
|
100479
100543
|
const newDependencies = await dependenciesUpdater({
|
|
100480
100544
|
projectFolder,
|
|
100481
|
-
dependenciesJsonPath:
|
|
100545
|
+
dependenciesJsonPath: join16(template, "dependencies.json"),
|
|
100482
100546
|
...opts.importData?.packageName ? {
|
|
100483
100547
|
dynamicPackages: { [opts.importData.packageName]: "^1.0.0" }
|
|
100484
100548
|
} : {}
|
|
@@ -100488,7 +100552,7 @@ async function componentGenerator(opts) {
|
|
|
100488
100552
|
|
|
100489
100553
|
// ../cli-astro-definitions/src/definitions.ts
|
|
100490
100554
|
init_esm_shims();
|
|
100491
|
-
import { join as
|
|
100555
|
+
import { join as join17 } from "node:path";
|
|
100492
100556
|
var import_variant42 = __toESM(require_lib(), 1);
|
|
100493
100557
|
var wixAstroSiteConfigSchema = zod_default.object({
|
|
100494
100558
|
$schema: zod_default.string().optional(),
|
|
@@ -100541,10 +100605,10 @@ var deploymentTopologySchema = zod_default.record(
|
|
|
100541
100605
|
deploymentTopologyEnvironmentSchema
|
|
100542
100606
|
);
|
|
100543
100607
|
function getEnvFilePath(projectFolder) {
|
|
100544
|
-
return
|
|
100608
|
+
return join17(projectFolder, ENV_FILE_NAME);
|
|
100545
100609
|
}
|
|
100546
100610
|
function getExtensionDir(projectFolder) {
|
|
100547
|
-
return
|
|
100611
|
+
return join17(projectFolder, "src", "extensions");
|
|
100548
100612
|
}
|
|
100549
100613
|
var PlatformType = (0, import_variant42.variant)({
|
|
100550
100614
|
Site: {},
|
|
@@ -100554,7 +100618,7 @@ var PlatformType = (0, import_variant42.variant)({
|
|
|
100554
100618
|
|
|
100555
100619
|
// ../create-new-packages/app-command/src/services/generator/template-fetcher.ts
|
|
100556
100620
|
init_esm_shims();
|
|
100557
|
-
import { join as
|
|
100621
|
+
import { join as join18 } from "node:path";
|
|
100558
100622
|
import { rm as rm2 } from "node:fs/promises";
|
|
100559
100623
|
|
|
100560
100624
|
// ../../node_modules/tempy/index.js
|
|
@@ -100710,7 +100774,7 @@ async function downloadAndExtractRepo(url2, branch) {
|
|
|
100710
100774
|
const repoDir = temporaryDirectory2({ prefix: "wix-create-app" });
|
|
100711
100775
|
try {
|
|
100712
100776
|
await gitClone(url2, repoDir, branch);
|
|
100713
|
-
await rm2(
|
|
100777
|
+
await rm2(join18(repoDir, ".git"), { recursive: true, force: true });
|
|
100714
100778
|
return repoDir;
|
|
100715
100779
|
} catch (e2) {
|
|
100716
100780
|
throw new CliError({
|
|
@@ -100728,7 +100792,7 @@ async function fetchTemplate(url2, path8 = ".", branch) {
|
|
|
100728
100792
|
});
|
|
100729
100793
|
}
|
|
100730
100794
|
const repoDir = await downloadAndExtractRepo(url2, branch);
|
|
100731
|
-
const templateDirInRepo =
|
|
100795
|
+
const templateDirInRepo = join18(repoDir, path8);
|
|
100732
100796
|
if (!await pathExists(templateDirInRepo)) {
|
|
100733
100797
|
throw new CliError({
|
|
100734
100798
|
code: CliErrorCode.TemplatePathNotFound({ templatePath: path8 }),
|
|
@@ -100801,7 +100865,7 @@ function getTasks({
|
|
|
100801
100865
|
mcpConfigResult,
|
|
100802
100866
|
environmentVariables
|
|
100803
100867
|
}, t3) {
|
|
100804
|
-
const packageFolder =
|
|
100868
|
+
const packageFolder = join19(targetParentFolder2, packageName);
|
|
100805
100869
|
const generateProject = async () => {
|
|
100806
100870
|
try {
|
|
100807
100871
|
await mkdir3(packageFolder, { recursive: true });
|
|
@@ -100883,16 +100947,21 @@ function getTasks({
|
|
|
100883
100947
|
loadingText: t3("create_app.generate_project.git_commit.loading"),
|
|
100884
100948
|
successText: t3("create_app.generate_project.git_commit.done")
|
|
100885
100949
|
};
|
|
100886
|
-
const
|
|
100950
|
+
const generateAgentConfigsTask = {
|
|
100951
|
+
action: () => generateAgentConfigs(packageFolder),
|
|
100952
|
+
loadingText: agentConfigsTaskText.loadingText,
|
|
100953
|
+
successText: agentConfigsTaskText.successText
|
|
100954
|
+
};
|
|
100955
|
+
const optionalInstallAndAgentsTask = skipInstall ? [] : [installDependenciesTask, generateAgentConfigsTask];
|
|
100887
100956
|
return (0, import_variant44.match)(repoType2, {
|
|
100888
100957
|
None: () => [
|
|
100889
100958
|
generateProjectTask,
|
|
100890
100959
|
...skipGit ? [] : [initializeGitTask],
|
|
100891
|
-
...
|
|
100960
|
+
...optionalInstallAndAgentsTask,
|
|
100892
100961
|
...skipGit ? [] : [commitToGitTask]
|
|
100893
100962
|
],
|
|
100894
|
-
Polyrepo: () => [generateProjectTask, ...
|
|
100895
|
-
Monorepo: () => [generateProjectTask, ...
|
|
100963
|
+
Polyrepo: () => [generateProjectTask, ...optionalInstallAndAgentsTask],
|
|
100964
|
+
Monorepo: () => [generateProjectTask, ...optionalInstallAndAgentsTask]
|
|
100896
100965
|
});
|
|
100897
100966
|
}
|
|
100898
100967
|
|
|
@@ -101163,6 +101232,8 @@ var messages_default3 = {
|
|
|
101163
101232
|
"create_app.generate_project.installing_dependencies.done": "Dependencies installed!",
|
|
101164
101233
|
"create_app.generate_project.git_commit.loading": "Committing changes...",
|
|
101165
101234
|
"create_app.generate_project.git_commit.done": "Changes committed!",
|
|
101235
|
+
"create_app.generate_project.generating_agent_configs.loading": "Generating agent configuration files...",
|
|
101236
|
+
"create_app.generate_project.generating_agent_configs.done": "Agent configuration files generated!",
|
|
101166
101237
|
"create_app.generate_project.finished.ready_to_start": "You are ready to start developing <0>{appName}</0>!",
|
|
101167
101238
|
"create_app.generate_project.finished.next_steps": "Next Steps:",
|
|
101168
101239
|
"create_app.generate_project.finished.run_local_development": "Run the local development environment",
|
|
@@ -101887,7 +101958,7 @@ function addMissingDependenciesOfType(packageJson, type, options) {
|
|
|
101887
101958
|
|
|
101888
101959
|
// ../cli-project-extender/src/modify-astro-config.ts
|
|
101889
101960
|
init_esm_shims();
|
|
101890
|
-
import { join as
|
|
101961
|
+
import { join as join20 } from "node:path";
|
|
101891
101962
|
|
|
101892
101963
|
// ../../node_modules/magicast/dist/index.mjs
|
|
101893
101964
|
init_esm_shims();
|
|
@@ -110755,7 +110826,7 @@ async function modifyAstroConfig(projectFolder) {
|
|
|
110755
110826
|
cause: void 0
|
|
110756
110827
|
});
|
|
110757
110828
|
}
|
|
110758
|
-
const file =
|
|
110829
|
+
const file = join20(projectFolder, configFilesFound[0]);
|
|
110759
110830
|
const loadedFile = await loadFile(file, {});
|
|
110760
110831
|
const react = setImport(loadedFile, "@astrojs/react", "react");
|
|
110761
110832
|
addIntegration2(loadedFile, react);
|
|
@@ -110848,19 +110919,19 @@ async function extend2(projectFolder) {
|
|
|
110848
110919
|
|
|
110849
110920
|
// ../cli-project-extender/src/add-files-from-template.ts
|
|
110850
110921
|
init_esm_shims();
|
|
110851
|
-
import { join as
|
|
110922
|
+
import { join as join22 } from "node:path";
|
|
110852
110923
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
110853
110924
|
var import_variant49 = __toESM(require_lib(), 1);
|
|
110854
110925
|
|
|
110855
110926
|
// ../cli-project-extender/src/clone-templates-repo.ts
|
|
110856
110927
|
init_esm_shims();
|
|
110857
|
-
import { join as
|
|
110928
|
+
import { join as join21 } from "node:path";
|
|
110858
110929
|
import { rm as rm3 } from "node:fs/promises";
|
|
110859
110930
|
async function cloneTemplatesRepo(url2) {
|
|
110860
110931
|
const repoDir = temporaryDirectory2({ prefix: "wix-cli-project-extender" });
|
|
110861
110932
|
try {
|
|
110862
110933
|
await gitClone(url2, repoDir);
|
|
110863
|
-
await rm3(
|
|
110934
|
+
await rm3(join21(repoDir, ".git"), { recursive: true, force: true });
|
|
110864
110935
|
} catch (e2) {
|
|
110865
110936
|
throw new CliError({
|
|
110866
110937
|
code: CliErrorCode.FailedToCloneRepo(),
|
|
@@ -110874,8 +110945,8 @@ async function cloneTemplatesRepo(url2) {
|
|
|
110874
110945
|
var TEMPLATE_REPO = "git@github.com:wix-incubator/headless-cli-templates.git";
|
|
110875
110946
|
async function addFilesFromTemplate(projectFolder, templateId, packageManager2, repoType2) {
|
|
110876
110947
|
const repoRoot = await cloneTemplatesRepo(TEMPLATE_REPO);
|
|
110877
|
-
const templateExtensionRoot =
|
|
110878
|
-
const sharedTemplate =
|
|
110948
|
+
const templateExtensionRoot = join22(repoRoot, "templates", templateId);
|
|
110949
|
+
const sharedTemplate = join22(repoRoot, "templates-shared");
|
|
110879
110950
|
if (await pathExists(sharedTemplate)) {
|
|
110880
110951
|
await componentGenerator({
|
|
110881
110952
|
template: sharedTemplate,
|
|
@@ -110899,9 +110970,9 @@ async function addFilesFromTemplate(projectFolder, templateId, packageManager2,
|
|
|
110899
110970
|
for (const template of extensionTemplates) {
|
|
110900
110971
|
const uniqueDir = await getUniqueExtensionPath(projectFolder, template, 0);
|
|
110901
110972
|
await componentGenerator({
|
|
110902
|
-
template:
|
|
110973
|
+
template: join22(templateExtensionRoot, template),
|
|
110903
110974
|
projectFolder,
|
|
110904
|
-
cwd:
|
|
110975
|
+
cwd: join22(getExtensionDir(projectFolder), uniqueDir),
|
|
110905
110976
|
data: {
|
|
110906
110977
|
randomUUID: () => randomUUID4(),
|
|
110907
110978
|
dir: uniqueDir
|
|
@@ -110911,7 +110982,7 @@ async function addFilesFromTemplate(projectFolder, templateId, packageManager2,
|
|
|
110911
110982
|
}
|
|
110912
110983
|
async function getUniqueExtensionPath(projectFolder, extensionPath, suffix) {
|
|
110913
110984
|
const uniqueExtensionPath = suffix ? `${extensionPath}${suffix}` : extensionPath;
|
|
110914
|
-
const path8 =
|
|
110985
|
+
const path8 = join22(getExtensionDir(projectFolder), uniqueExtensionPath);
|
|
110915
110986
|
if (!await pathExists(path8)) {
|
|
110916
110987
|
return uniqueExtensionPath;
|
|
110917
110988
|
}
|
|
@@ -111208,7 +111279,7 @@ var import_variant60 = __toESM(require_lib(), 1);
|
|
|
111208
111279
|
// ../create-new-packages/headless-command/src/parse-command-options.ts
|
|
111209
111280
|
init_esm_shims();
|
|
111210
111281
|
var import_variant54 = __toESM(require_lib(), 1);
|
|
111211
|
-
import { join as
|
|
111282
|
+
import { join as join23 } from "node:path";
|
|
111212
111283
|
|
|
111213
111284
|
// ../create-new-packages/headless-command/src/validations/index.ts
|
|
111214
111285
|
init_esm_shims();
|
|
@@ -111332,7 +111403,7 @@ async function parseTemplateOptions2(options) {
|
|
|
111332
111403
|
async function parseProjectNameOptions(targetParentFolder2, options) {
|
|
111333
111404
|
const projectName = options.projectName;
|
|
111334
111405
|
if (projectName) {
|
|
111335
|
-
if (!await validateDirectory2(
|
|
111406
|
+
if (!await validateDirectory2(join23(targetParentFolder2, projectName))) {
|
|
111336
111407
|
throw new CliError({
|
|
111337
111408
|
code: CliErrorCode.ProjectNameArgumentIsInvalid({
|
|
111338
111409
|
errorMessage: `"${projectName}" directory is not empty`
|
|
@@ -111403,9 +111474,9 @@ var import_variant59 = __toESM(require_lib(), 1);
|
|
|
111403
111474
|
init_esm_shims();
|
|
111404
111475
|
var import_react136 = __toESM(require_react(), 1);
|
|
111405
111476
|
var import_variant55 = __toESM(require_lib(), 1);
|
|
111406
|
-
import { join as
|
|
111477
|
+
import { join as join24 } from "node:path";
|
|
111407
111478
|
var validateAppDirectory = async (targetParentFolder2, packageName) => {
|
|
111408
|
-
if (!await validateDirectory2(
|
|
111479
|
+
if (!await validateDirectory2(join24(targetParentFolder2, packageName))) {
|
|
111409
111480
|
return `Provided directory "${packageName}" is not empty`;
|
|
111410
111481
|
}
|
|
111411
111482
|
const npmValidationErrors = await validatePackageName2(packageName);
|
|
@@ -111436,18 +111507,18 @@ init_esm_shims();
|
|
|
111436
111507
|
import { mkdir as mkdir4 } from "node:fs/promises";
|
|
111437
111508
|
var import_react137 = __toESM(require_react(), 1);
|
|
111438
111509
|
var import_variant56 = __toESM(require_lib(), 1);
|
|
111439
|
-
import { join as
|
|
111510
|
+
import { join as join26 } from "node:path";
|
|
111440
111511
|
|
|
111441
111512
|
// ../create-new-packages/headless-command/src/services/generator/template-fetcher.ts
|
|
111442
111513
|
init_esm_shims();
|
|
111443
|
-
import { join as
|
|
111514
|
+
import { join as join25 } from "node:path";
|
|
111444
111515
|
import { rm as rm4 } from "node:fs/promises";
|
|
111445
111516
|
var import_is_git_url4 = __toESM(require_is_git_url(), 1);
|
|
111446
111517
|
async function downloadAndExtractRepo2(url2) {
|
|
111447
111518
|
const repoDir = temporaryDirectory2({ prefix: "wix-create-headless-site" });
|
|
111448
111519
|
try {
|
|
111449
111520
|
await gitClone(url2, repoDir);
|
|
111450
|
-
await rm4(
|
|
111521
|
+
await rm4(join25(repoDir, ".git"), { recursive: true, force: true });
|
|
111451
111522
|
return repoDir;
|
|
111452
111523
|
} catch (e2) {
|
|
111453
111524
|
throw new CliError({
|
|
@@ -111465,7 +111536,7 @@ async function fetchTemplate2(url2, path8 = ".") {
|
|
|
111465
111536
|
});
|
|
111466
111537
|
}
|
|
111467
111538
|
const repoDir = await downloadAndExtractRepo2(url2);
|
|
111468
|
-
const templateDirInRepo =
|
|
111539
|
+
const templateDirInRepo = join25(repoDir, path8);
|
|
111469
111540
|
if (!await pathExists(templateDirInRepo)) {
|
|
111470
111541
|
throw new CliError({
|
|
111471
111542
|
code: CliErrorCode.TemplatePathNotFound({ templatePath: path8 }),
|
|
@@ -111495,7 +111566,7 @@ var GenerateProject2 = ({
|
|
|
111495
111566
|
const { reportError: reportError2 } = useErrorReporter();
|
|
111496
111567
|
const { execute: executeTaskRunner, status: taskRunnerStatus } = useTaskRunner2();
|
|
111497
111568
|
const packageFolder = (0, import_react137.useMemo)(
|
|
111498
|
-
() =>
|
|
111569
|
+
() => join26(targetParentFolder2, folderName),
|
|
111499
111570
|
[folderName, targetParentFolder2]
|
|
111500
111571
|
);
|
|
111501
111572
|
const generateProject = (0, import_react137.useCallback)(async () => {
|
|
@@ -111614,6 +111685,11 @@ var GenerateProject2 = ({
|
|
|
111614
111685
|
loadingText: "Installing dependencies...",
|
|
111615
111686
|
successText: "Installed dependencies successfully"
|
|
111616
111687
|
});
|
|
111688
|
+
result.push({
|
|
111689
|
+
action: () => generateAgentConfigs(packageFolder),
|
|
111690
|
+
loadingText: agentConfigsTaskText.loadingText,
|
|
111691
|
+
successText: agentConfigsTaskText.successText
|
|
111692
|
+
});
|
|
111617
111693
|
}
|
|
111618
111694
|
if (!commandOptions.skipGit) {
|
|
111619
111695
|
result.push({
|
|
@@ -111630,7 +111706,8 @@ var GenerateProject2 = ({
|
|
|
111630
111706
|
generateProject,
|
|
111631
111707
|
initializeGit,
|
|
111632
111708
|
installDependencies,
|
|
111633
|
-
extendProject
|
|
111709
|
+
extendProject,
|
|
111710
|
+
packageFolder
|
|
111634
111711
|
]);
|
|
111635
111712
|
useAsync2(async () => {
|
|
111636
111713
|
await executeTaskRunner(tasks);
|
|
@@ -111695,7 +111772,7 @@ var FinishedSuccessfullyMessage3 = ({ packageManager: packageManager2, folderNam
|
|
|
111695
111772
|
// ../create-new-packages/headless-command/src/hooks/release-project.ts
|
|
111696
111773
|
init_esm_shims();
|
|
111697
111774
|
var import_variant57 = __toESM(require_lib(), 1);
|
|
111698
|
-
import { join as
|
|
111775
|
+
import { join as join27 } from "node:path";
|
|
111699
111776
|
var ReleaseStateVariant = (0, import_variant57.variant)({
|
|
111700
111777
|
Success: {},
|
|
111701
111778
|
Skipped: {},
|
|
@@ -111712,7 +111789,7 @@ var useReleaseProject = () => {
|
|
|
111712
111789
|
if (!confirmed) {
|
|
111713
111790
|
return ReleaseStateVariant.Skipped();
|
|
111714
111791
|
}
|
|
111715
|
-
const packageFolder =
|
|
111792
|
+
const packageFolder = join27(targetParentFolder2, folderName);
|
|
111716
111793
|
try {
|
|
111717
111794
|
const buildCommand = packageManager2.getRunBinaryCmd(["wix", "build"]);
|
|
111718
111795
|
const releaseCommand = packageManager2.getRunBinaryCmd([
|
|
@@ -112120,7 +112197,7 @@ var getHeadlessCommand = ({
|
|
|
112120
112197
|
var package_default = {
|
|
112121
112198
|
name: "@wix/create-new",
|
|
112122
112199
|
description: "General entry point for creating Wix projects",
|
|
112123
|
-
version: "0.0.
|
|
112200
|
+
version: "0.0.19",
|
|
112124
112201
|
bin: "bin/index.cjs",
|
|
112125
112202
|
devDependencies: {
|
|
112126
112203
|
"@commander-js/extra-typings": "^13.0.0",
|