@wix/create-new 0.0.17 → 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 +143 -56
- 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
|
}
|
|
@@ -62497,7 +62497,8 @@ var CliUserErrorCode = (0, import_variant.variant)({
|
|
|
62497
62497
|
AppInstallerSiteNotFound: (0, import_variant.fields)(),
|
|
62498
62498
|
EAccessPermissionDenied: {},
|
|
62499
62499
|
InvalidSiteComponentElementItem: (0, import_variant.fields)(),
|
|
62500
|
-
TrustedAppIsNotMarkedAsInternal: {}
|
|
62500
|
+
TrustedAppIsNotMarkedAsInternal: {},
|
|
62501
|
+
DevCommandFailed: {}
|
|
62501
62502
|
});
|
|
62502
62503
|
var CliErrorCode = (0, import_variant.variant)({
|
|
62503
62504
|
...CliSystemErrorCode,
|
|
@@ -83112,6 +83113,15 @@ ${errorMessage2}`
|
|
|
83112
83113
|
hint: "To resolve this, please visit your app dashboard in Dev Center and ensure the 'Wix App' toggle is enabled."
|
|
83113
83114
|
}
|
|
83114
83115
|
);
|
|
83116
|
+
},
|
|
83117
|
+
DevCommandFailed: () => {
|
|
83118
|
+
return () => /* @__PURE__ */ import_react78.default.createElement(
|
|
83119
|
+
ErrorMessage,
|
|
83120
|
+
{
|
|
83121
|
+
cause,
|
|
83122
|
+
message: "The development command failed to execute. Please review the output log above for details."
|
|
83123
|
+
}
|
|
83124
|
+
);
|
|
83115
83125
|
}
|
|
83116
83126
|
});
|
|
83117
83127
|
}
|
|
@@ -100278,7 +100288,71 @@ var Questions = ({
|
|
|
100278
100288
|
init_esm_shims();
|
|
100279
100289
|
var import_variant44 = __toESM(require_lib(), 1);
|
|
100280
100290
|
import { mkdir as mkdir3 } from "node:fs/promises";
|
|
100281
|
-
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
|
+
}
|
|
100282
100356
|
|
|
100283
100357
|
// ../create-new-packages/app-command/src/services/generator/index.ts
|
|
100284
100358
|
init_esm_shims();
|
|
@@ -100295,7 +100369,7 @@ init_esm_shims();
|
|
|
100295
100369
|
init_esm_shims();
|
|
100296
100370
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
100297
100371
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
100298
|
-
import { resolve as resolve4, dirname as
|
|
100372
|
+
import { resolve as resolve4, dirname as dirname6, extname } from "node:path";
|
|
100299
100373
|
import { readFile as readFile3, copyFile } from "node:fs/promises";
|
|
100300
100374
|
|
|
100301
100375
|
// ../gena/src/fs-extra.ts
|
|
@@ -100317,7 +100391,7 @@ async function justCopy({
|
|
|
100317
100391
|
path: path8
|
|
100318
100392
|
}) {
|
|
100319
100393
|
const to = resolve4(cwd3, template);
|
|
100320
|
-
await outputDir(
|
|
100394
|
+
await outputDir(dirname6(to));
|
|
100321
100395
|
await copyFile(path8, to);
|
|
100322
100396
|
return to;
|
|
100323
100397
|
}
|
|
@@ -100346,7 +100420,7 @@ async function generator(opts) {
|
|
|
100346
100420
|
|
|
100347
100421
|
// ../gena/src/component-generator.ts
|
|
100348
100422
|
init_esm_shims();
|
|
100349
|
-
import { join as
|
|
100423
|
+
import { join as join16 } from "node:path";
|
|
100350
100424
|
|
|
100351
100425
|
// ../gena/src/dependencies-updater.ts
|
|
100352
100426
|
init_esm_shims();
|
|
@@ -100427,13 +100501,13 @@ async function dependenciesUpdater(opts) {
|
|
|
100427
100501
|
|
|
100428
100502
|
// ../gena/src/assets-generator.ts
|
|
100429
100503
|
init_esm_shims();
|
|
100430
|
-
import { resolve as resolve5, join as
|
|
100504
|
+
import { resolve as resolve5, join as join15 } from "node:path";
|
|
100431
100505
|
import { copyFile as copyFile2, mkdir as mkdir2 } from "node:fs/promises";
|
|
100432
100506
|
async function assetsGenerator(opts) {
|
|
100433
100507
|
const { templateRoot, projectFolder, outputPath, assetsPrefix } = opts;
|
|
100434
|
-
const assets =
|
|
100508
|
+
const assets = join15(templateRoot, "assets");
|
|
100435
100509
|
if (await pathExists(assets)) {
|
|
100436
|
-
const publicDir =
|
|
100510
|
+
const publicDir = join15(projectFolder, outputPath ?? "");
|
|
100437
100511
|
const publicFiles = await getFiles(assets);
|
|
100438
100512
|
await mkdir2(publicDir, { recursive: true });
|
|
100439
100513
|
await Promise.all(
|
|
@@ -100458,7 +100532,7 @@ async function componentGenerator(opts) {
|
|
|
100458
100532
|
} = opts;
|
|
100459
100533
|
const newFiles = await generator({
|
|
100460
100534
|
...generatorOpts,
|
|
100461
|
-
template:
|
|
100535
|
+
template: join16(template, "files")
|
|
100462
100536
|
});
|
|
100463
100537
|
await assetsGenerator({
|
|
100464
100538
|
templateRoot: template,
|
|
@@ -100468,7 +100542,7 @@ async function componentGenerator(opts) {
|
|
|
100468
100542
|
});
|
|
100469
100543
|
const newDependencies = await dependenciesUpdater({
|
|
100470
100544
|
projectFolder,
|
|
100471
|
-
dependenciesJsonPath:
|
|
100545
|
+
dependenciesJsonPath: join16(template, "dependencies.json"),
|
|
100472
100546
|
...opts.importData?.packageName ? {
|
|
100473
100547
|
dynamicPackages: { [opts.importData.packageName]: "^1.0.0" }
|
|
100474
100548
|
} : {}
|
|
@@ -100478,7 +100552,7 @@ async function componentGenerator(opts) {
|
|
|
100478
100552
|
|
|
100479
100553
|
// ../cli-astro-definitions/src/definitions.ts
|
|
100480
100554
|
init_esm_shims();
|
|
100481
|
-
import { join as
|
|
100555
|
+
import { join as join17 } from "node:path";
|
|
100482
100556
|
var import_variant42 = __toESM(require_lib(), 1);
|
|
100483
100557
|
var wixAstroSiteConfigSchema = zod_default.object({
|
|
100484
100558
|
$schema: zod_default.string().optional(),
|
|
@@ -100531,10 +100605,10 @@ var deploymentTopologySchema = zod_default.record(
|
|
|
100531
100605
|
deploymentTopologyEnvironmentSchema
|
|
100532
100606
|
);
|
|
100533
100607
|
function getEnvFilePath(projectFolder) {
|
|
100534
|
-
return
|
|
100608
|
+
return join17(projectFolder, ENV_FILE_NAME);
|
|
100535
100609
|
}
|
|
100536
100610
|
function getExtensionDir(projectFolder) {
|
|
100537
|
-
return
|
|
100611
|
+
return join17(projectFolder, "src", "extensions");
|
|
100538
100612
|
}
|
|
100539
100613
|
var PlatformType = (0, import_variant42.variant)({
|
|
100540
100614
|
Site: {},
|
|
@@ -100544,7 +100618,7 @@ var PlatformType = (0, import_variant42.variant)({
|
|
|
100544
100618
|
|
|
100545
100619
|
// ../create-new-packages/app-command/src/services/generator/template-fetcher.ts
|
|
100546
100620
|
init_esm_shims();
|
|
100547
|
-
import { join as
|
|
100621
|
+
import { join as join18 } from "node:path";
|
|
100548
100622
|
import { rm as rm2 } from "node:fs/promises";
|
|
100549
100623
|
|
|
100550
100624
|
// ../../node_modules/tempy/index.js
|
|
@@ -100700,7 +100774,7 @@ async function downloadAndExtractRepo(url2, branch) {
|
|
|
100700
100774
|
const repoDir = temporaryDirectory2({ prefix: "wix-create-app" });
|
|
100701
100775
|
try {
|
|
100702
100776
|
await gitClone(url2, repoDir, branch);
|
|
100703
|
-
await rm2(
|
|
100777
|
+
await rm2(join18(repoDir, ".git"), { recursive: true, force: true });
|
|
100704
100778
|
return repoDir;
|
|
100705
100779
|
} catch (e2) {
|
|
100706
100780
|
throw new CliError({
|
|
@@ -100718,7 +100792,7 @@ async function fetchTemplate(url2, path8 = ".", branch) {
|
|
|
100718
100792
|
});
|
|
100719
100793
|
}
|
|
100720
100794
|
const repoDir = await downloadAndExtractRepo(url2, branch);
|
|
100721
|
-
const templateDirInRepo =
|
|
100795
|
+
const templateDirInRepo = join18(repoDir, path8);
|
|
100722
100796
|
if (!await pathExists(templateDirInRepo)) {
|
|
100723
100797
|
throw new CliError({
|
|
100724
100798
|
code: CliErrorCode.TemplatePathNotFound({ templatePath: path8 }),
|
|
@@ -100791,7 +100865,7 @@ function getTasks({
|
|
|
100791
100865
|
mcpConfigResult,
|
|
100792
100866
|
environmentVariables
|
|
100793
100867
|
}, t3) {
|
|
100794
|
-
const packageFolder =
|
|
100868
|
+
const packageFolder = join19(targetParentFolder2, packageName);
|
|
100795
100869
|
const generateProject = async () => {
|
|
100796
100870
|
try {
|
|
100797
100871
|
await mkdir3(packageFolder, { recursive: true });
|
|
@@ -100873,16 +100947,21 @@ function getTasks({
|
|
|
100873
100947
|
loadingText: t3("create_app.generate_project.git_commit.loading"),
|
|
100874
100948
|
successText: t3("create_app.generate_project.git_commit.done")
|
|
100875
100949
|
};
|
|
100876
|
-
const
|
|
100950
|
+
const generateAgentConfigsTask = {
|
|
100951
|
+
action: () => generateAgentConfigs(packageFolder),
|
|
100952
|
+
loadingText: agentConfigsTaskText.loadingText,
|
|
100953
|
+
successText: agentConfigsTaskText.successText
|
|
100954
|
+
};
|
|
100955
|
+
const optionalInstallAndAgentsTask = skipInstall ? [] : [installDependenciesTask, generateAgentConfigsTask];
|
|
100877
100956
|
return (0, import_variant44.match)(repoType2, {
|
|
100878
100957
|
None: () => [
|
|
100879
100958
|
generateProjectTask,
|
|
100880
100959
|
...skipGit ? [] : [initializeGitTask],
|
|
100881
|
-
...
|
|
100960
|
+
...optionalInstallAndAgentsTask,
|
|
100882
100961
|
...skipGit ? [] : [commitToGitTask]
|
|
100883
100962
|
],
|
|
100884
|
-
Polyrepo: () => [generateProjectTask, ...
|
|
100885
|
-
Monorepo: () => [generateProjectTask, ...
|
|
100963
|
+
Polyrepo: () => [generateProjectTask, ...optionalInstallAndAgentsTask],
|
|
100964
|
+
Monorepo: () => [generateProjectTask, ...optionalInstallAndAgentsTask]
|
|
100886
100965
|
});
|
|
100887
100966
|
}
|
|
100888
100967
|
|
|
@@ -101153,6 +101232,8 @@ var messages_default3 = {
|
|
|
101153
101232
|
"create_app.generate_project.installing_dependencies.done": "Dependencies installed!",
|
|
101154
101233
|
"create_app.generate_project.git_commit.loading": "Committing changes...",
|
|
101155
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!",
|
|
101156
101237
|
"create_app.generate_project.finished.ready_to_start": "You are ready to start developing <0>{appName}</0>!",
|
|
101157
101238
|
"create_app.generate_project.finished.next_steps": "Next Steps:",
|
|
101158
101239
|
"create_app.generate_project.finished.run_local_development": "Run the local development environment",
|
|
@@ -101877,7 +101958,7 @@ function addMissingDependenciesOfType(packageJson, type, options) {
|
|
|
101877
101958
|
|
|
101878
101959
|
// ../cli-project-extender/src/modify-astro-config.ts
|
|
101879
101960
|
init_esm_shims();
|
|
101880
|
-
import { join as
|
|
101961
|
+
import { join as join20 } from "node:path";
|
|
101881
101962
|
|
|
101882
101963
|
// ../../node_modules/magicast/dist/index.mjs
|
|
101883
101964
|
init_esm_shims();
|
|
@@ -110745,7 +110826,7 @@ async function modifyAstroConfig(projectFolder) {
|
|
|
110745
110826
|
cause: void 0
|
|
110746
110827
|
});
|
|
110747
110828
|
}
|
|
110748
|
-
const file =
|
|
110829
|
+
const file = join20(projectFolder, configFilesFound[0]);
|
|
110749
110830
|
const loadedFile = await loadFile(file, {});
|
|
110750
110831
|
const react = setImport(loadedFile, "@astrojs/react", "react");
|
|
110751
110832
|
addIntegration2(loadedFile, react);
|
|
@@ -110838,19 +110919,19 @@ async function extend2(projectFolder) {
|
|
|
110838
110919
|
|
|
110839
110920
|
// ../cli-project-extender/src/add-files-from-template.ts
|
|
110840
110921
|
init_esm_shims();
|
|
110841
|
-
import { join as
|
|
110922
|
+
import { join as join22 } from "node:path";
|
|
110842
110923
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
110843
110924
|
var import_variant49 = __toESM(require_lib(), 1);
|
|
110844
110925
|
|
|
110845
110926
|
// ../cli-project-extender/src/clone-templates-repo.ts
|
|
110846
110927
|
init_esm_shims();
|
|
110847
|
-
import { join as
|
|
110928
|
+
import { join as join21 } from "node:path";
|
|
110848
110929
|
import { rm as rm3 } from "node:fs/promises";
|
|
110849
110930
|
async function cloneTemplatesRepo(url2) {
|
|
110850
110931
|
const repoDir = temporaryDirectory2({ prefix: "wix-cli-project-extender" });
|
|
110851
110932
|
try {
|
|
110852
110933
|
await gitClone(url2, repoDir);
|
|
110853
|
-
await rm3(
|
|
110934
|
+
await rm3(join21(repoDir, ".git"), { recursive: true, force: true });
|
|
110854
110935
|
} catch (e2) {
|
|
110855
110936
|
throw new CliError({
|
|
110856
110937
|
code: CliErrorCode.FailedToCloneRepo(),
|
|
@@ -110864,8 +110945,8 @@ async function cloneTemplatesRepo(url2) {
|
|
|
110864
110945
|
var TEMPLATE_REPO = "git@github.com:wix-incubator/headless-cli-templates.git";
|
|
110865
110946
|
async function addFilesFromTemplate(projectFolder, templateId, packageManager2, repoType2) {
|
|
110866
110947
|
const repoRoot = await cloneTemplatesRepo(TEMPLATE_REPO);
|
|
110867
|
-
const templateExtensionRoot =
|
|
110868
|
-
const sharedTemplate =
|
|
110948
|
+
const templateExtensionRoot = join22(repoRoot, "templates", templateId);
|
|
110949
|
+
const sharedTemplate = join22(repoRoot, "templates-shared");
|
|
110869
110950
|
if (await pathExists(sharedTemplate)) {
|
|
110870
110951
|
await componentGenerator({
|
|
110871
110952
|
template: sharedTemplate,
|
|
@@ -110889,9 +110970,9 @@ async function addFilesFromTemplate(projectFolder, templateId, packageManager2,
|
|
|
110889
110970
|
for (const template of extensionTemplates) {
|
|
110890
110971
|
const uniqueDir = await getUniqueExtensionPath(projectFolder, template, 0);
|
|
110891
110972
|
await componentGenerator({
|
|
110892
|
-
template:
|
|
110973
|
+
template: join22(templateExtensionRoot, template),
|
|
110893
110974
|
projectFolder,
|
|
110894
|
-
cwd:
|
|
110975
|
+
cwd: join22(getExtensionDir(projectFolder), uniqueDir),
|
|
110895
110976
|
data: {
|
|
110896
110977
|
randomUUID: () => randomUUID4(),
|
|
110897
110978
|
dir: uniqueDir
|
|
@@ -110901,7 +110982,7 @@ async function addFilesFromTemplate(projectFolder, templateId, packageManager2,
|
|
|
110901
110982
|
}
|
|
110902
110983
|
async function getUniqueExtensionPath(projectFolder, extensionPath, suffix) {
|
|
110903
110984
|
const uniqueExtensionPath = suffix ? `${extensionPath}${suffix}` : extensionPath;
|
|
110904
|
-
const path8 =
|
|
110985
|
+
const path8 = join22(getExtensionDir(projectFolder), uniqueExtensionPath);
|
|
110905
110986
|
if (!await pathExists(path8)) {
|
|
110906
110987
|
return uniqueExtensionPath;
|
|
110907
110988
|
}
|
|
@@ -111198,7 +111279,7 @@ var import_variant60 = __toESM(require_lib(), 1);
|
|
|
111198
111279
|
// ../create-new-packages/headless-command/src/parse-command-options.ts
|
|
111199
111280
|
init_esm_shims();
|
|
111200
111281
|
var import_variant54 = __toESM(require_lib(), 1);
|
|
111201
|
-
import { join as
|
|
111282
|
+
import { join as join23 } from "node:path";
|
|
111202
111283
|
|
|
111203
111284
|
// ../create-new-packages/headless-command/src/validations/index.ts
|
|
111204
111285
|
init_esm_shims();
|
|
@@ -111322,7 +111403,7 @@ async function parseTemplateOptions2(options) {
|
|
|
111322
111403
|
async function parseProjectNameOptions(targetParentFolder2, options) {
|
|
111323
111404
|
const projectName = options.projectName;
|
|
111324
111405
|
if (projectName) {
|
|
111325
|
-
if (!await validateDirectory2(
|
|
111406
|
+
if (!await validateDirectory2(join23(targetParentFolder2, projectName))) {
|
|
111326
111407
|
throw new CliError({
|
|
111327
111408
|
code: CliErrorCode.ProjectNameArgumentIsInvalid({
|
|
111328
111409
|
errorMessage: `"${projectName}" directory is not empty`
|
|
@@ -111393,9 +111474,9 @@ var import_variant59 = __toESM(require_lib(), 1);
|
|
|
111393
111474
|
init_esm_shims();
|
|
111394
111475
|
var import_react136 = __toESM(require_react(), 1);
|
|
111395
111476
|
var import_variant55 = __toESM(require_lib(), 1);
|
|
111396
|
-
import { join as
|
|
111477
|
+
import { join as join24 } from "node:path";
|
|
111397
111478
|
var validateAppDirectory = async (targetParentFolder2, packageName) => {
|
|
111398
|
-
if (!await validateDirectory2(
|
|
111479
|
+
if (!await validateDirectory2(join24(targetParentFolder2, packageName))) {
|
|
111399
111480
|
return `Provided directory "${packageName}" is not empty`;
|
|
111400
111481
|
}
|
|
111401
111482
|
const npmValidationErrors = await validatePackageName2(packageName);
|
|
@@ -111426,18 +111507,18 @@ init_esm_shims();
|
|
|
111426
111507
|
import { mkdir as mkdir4 } from "node:fs/promises";
|
|
111427
111508
|
var import_react137 = __toESM(require_react(), 1);
|
|
111428
111509
|
var import_variant56 = __toESM(require_lib(), 1);
|
|
111429
|
-
import { join as
|
|
111510
|
+
import { join as join26 } from "node:path";
|
|
111430
111511
|
|
|
111431
111512
|
// ../create-new-packages/headless-command/src/services/generator/template-fetcher.ts
|
|
111432
111513
|
init_esm_shims();
|
|
111433
|
-
import { join as
|
|
111514
|
+
import { join as join25 } from "node:path";
|
|
111434
111515
|
import { rm as rm4 } from "node:fs/promises";
|
|
111435
111516
|
var import_is_git_url4 = __toESM(require_is_git_url(), 1);
|
|
111436
111517
|
async function downloadAndExtractRepo2(url2) {
|
|
111437
111518
|
const repoDir = temporaryDirectory2({ prefix: "wix-create-headless-site" });
|
|
111438
111519
|
try {
|
|
111439
111520
|
await gitClone(url2, repoDir);
|
|
111440
|
-
await rm4(
|
|
111521
|
+
await rm4(join25(repoDir, ".git"), { recursive: true, force: true });
|
|
111441
111522
|
return repoDir;
|
|
111442
111523
|
} catch (e2) {
|
|
111443
111524
|
throw new CliError({
|
|
@@ -111455,7 +111536,7 @@ async function fetchTemplate2(url2, path8 = ".") {
|
|
|
111455
111536
|
});
|
|
111456
111537
|
}
|
|
111457
111538
|
const repoDir = await downloadAndExtractRepo2(url2);
|
|
111458
|
-
const templateDirInRepo =
|
|
111539
|
+
const templateDirInRepo = join25(repoDir, path8);
|
|
111459
111540
|
if (!await pathExists(templateDirInRepo)) {
|
|
111460
111541
|
throw new CliError({
|
|
111461
111542
|
code: CliErrorCode.TemplatePathNotFound({ templatePath: path8 }),
|
|
@@ -111485,7 +111566,7 @@ var GenerateProject2 = ({
|
|
|
111485
111566
|
const { reportError: reportError2 } = useErrorReporter();
|
|
111486
111567
|
const { execute: executeTaskRunner, status: taskRunnerStatus } = useTaskRunner2();
|
|
111487
111568
|
const packageFolder = (0, import_react137.useMemo)(
|
|
111488
|
-
() =>
|
|
111569
|
+
() => join26(targetParentFolder2, folderName),
|
|
111489
111570
|
[folderName, targetParentFolder2]
|
|
111490
111571
|
);
|
|
111491
111572
|
const generateProject = (0, import_react137.useCallback)(async () => {
|
|
@@ -111604,6 +111685,11 @@ var GenerateProject2 = ({
|
|
|
111604
111685
|
loadingText: "Installing dependencies...",
|
|
111605
111686
|
successText: "Installed dependencies successfully"
|
|
111606
111687
|
});
|
|
111688
|
+
result.push({
|
|
111689
|
+
action: () => generateAgentConfigs(packageFolder),
|
|
111690
|
+
loadingText: agentConfigsTaskText.loadingText,
|
|
111691
|
+
successText: agentConfigsTaskText.successText
|
|
111692
|
+
});
|
|
111607
111693
|
}
|
|
111608
111694
|
if (!commandOptions.skipGit) {
|
|
111609
111695
|
result.push({
|
|
@@ -111620,7 +111706,8 @@ var GenerateProject2 = ({
|
|
|
111620
111706
|
generateProject,
|
|
111621
111707
|
initializeGit,
|
|
111622
111708
|
installDependencies,
|
|
111623
|
-
extendProject
|
|
111709
|
+
extendProject,
|
|
111710
|
+
packageFolder
|
|
111624
111711
|
]);
|
|
111625
111712
|
useAsync2(async () => {
|
|
111626
111713
|
await executeTaskRunner(tasks);
|
|
@@ -111685,7 +111772,7 @@ var FinishedSuccessfullyMessage3 = ({ packageManager: packageManager2, folderNam
|
|
|
111685
111772
|
// ../create-new-packages/headless-command/src/hooks/release-project.ts
|
|
111686
111773
|
init_esm_shims();
|
|
111687
111774
|
var import_variant57 = __toESM(require_lib(), 1);
|
|
111688
|
-
import { join as
|
|
111775
|
+
import { join as join27 } from "node:path";
|
|
111689
111776
|
var ReleaseStateVariant = (0, import_variant57.variant)({
|
|
111690
111777
|
Success: {},
|
|
111691
111778
|
Skipped: {},
|
|
@@ -111702,7 +111789,7 @@ var useReleaseProject = () => {
|
|
|
111702
111789
|
if (!confirmed) {
|
|
111703
111790
|
return ReleaseStateVariant.Skipped();
|
|
111704
111791
|
}
|
|
111705
|
-
const packageFolder =
|
|
111792
|
+
const packageFolder = join27(targetParentFolder2, folderName);
|
|
111706
111793
|
try {
|
|
111707
111794
|
const buildCommand = packageManager2.getRunBinaryCmd(["wix", "build"]);
|
|
111708
111795
|
const releaseCommand = packageManager2.getRunBinaryCmd([
|
|
@@ -112110,7 +112197,7 @@ var getHeadlessCommand = ({
|
|
|
112110
112197
|
var package_default = {
|
|
112111
112198
|
name: "@wix/create-new",
|
|
112112
112199
|
description: "General entry point for creating Wix projects",
|
|
112113
|
-
version: "0.0.
|
|
112200
|
+
version: "0.0.19",
|
|
112114
112201
|
bin: "bin/index.cjs",
|
|
112115
112202
|
devDependencies: {
|
|
112116
112203
|
"@commander-js/extra-typings": "^13.0.0",
|