@wix/create-new 0.0.50 → 0.0.52
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 +69 -52
- package/build/index.js.map +1 -1
- package/package.json +2 -2
- package/templates/app/blank/src/env.d.ts +1 -0
package/build/index.js
CHANGED
|
@@ -1259,7 +1259,7 @@ var require_command = __commonJS({
|
|
|
1259
1259
|
var childProcess2 = __require("node:child_process");
|
|
1260
1260
|
var path4 = __require("node:path");
|
|
1261
1261
|
var fs6 = __require("node:fs");
|
|
1262
|
-
var
|
|
1262
|
+
var process23 = __require("node:process");
|
|
1263
1263
|
var { Argument: Argument2, humanReadableArgName } = require_argument();
|
|
1264
1264
|
var { CommanderError: CommanderError2 } = require_error();
|
|
1265
1265
|
var { Help: Help2, stripColor } = require_help();
|
|
@@ -1306,13 +1306,13 @@ var require_command = __commonJS({
|
|
|
1306
1306
|
this._showSuggestionAfterError = true;
|
|
1307
1307
|
this._savedState = null;
|
|
1308
1308
|
this._outputConfiguration = {
|
|
1309
|
-
writeOut: (str) =>
|
|
1310
|
-
writeErr: (str) =>
|
|
1309
|
+
writeOut: (str) => process23.stdout.write(str),
|
|
1310
|
+
writeErr: (str) => process23.stderr.write(str),
|
|
1311
1311
|
outputError: (str, write) => write(str),
|
|
1312
|
-
getOutHelpWidth: () =>
|
|
1313
|
-
getErrHelpWidth: () =>
|
|
1314
|
-
getOutHasColors: () => useColor() ?? (
|
|
1315
|
-
getErrHasColors: () => useColor() ?? (
|
|
1312
|
+
getOutHelpWidth: () => process23.stdout.isTTY ? process23.stdout.columns : void 0,
|
|
1313
|
+
getErrHelpWidth: () => process23.stderr.isTTY ? process23.stderr.columns : void 0,
|
|
1314
|
+
getOutHasColors: () => useColor() ?? (process23.stdout.isTTY && process23.stdout.hasColors?.()),
|
|
1315
|
+
getErrHasColors: () => useColor() ?? (process23.stderr.isTTY && process23.stderr.hasColors?.()),
|
|
1316
1316
|
stripColor: (str) => stripColor(str)
|
|
1317
1317
|
};
|
|
1318
1318
|
this._hidden = false;
|
|
@@ -1695,7 +1695,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1695
1695
|
if (this._exitCallback) {
|
|
1696
1696
|
this._exitCallback(new CommanderError2(exitCode, code, message));
|
|
1697
1697
|
}
|
|
1698
|
-
|
|
1698
|
+
process23.exit(exitCode);
|
|
1699
1699
|
}
|
|
1700
1700
|
/**
|
|
1701
1701
|
* Register callback `fn` for the command.
|
|
@@ -2093,16 +2093,16 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2093
2093
|
}
|
|
2094
2094
|
parseOptions = parseOptions || {};
|
|
2095
2095
|
if (argv === void 0 && parseOptions.from === void 0) {
|
|
2096
|
-
if (
|
|
2096
|
+
if (process23.versions?.electron) {
|
|
2097
2097
|
parseOptions.from = "electron";
|
|
2098
2098
|
}
|
|
2099
|
-
const execArgv =
|
|
2099
|
+
const execArgv = process23.execArgv ?? [];
|
|
2100
2100
|
if (execArgv.includes("-e") || execArgv.includes("--eval") || execArgv.includes("-p") || execArgv.includes("--print")) {
|
|
2101
2101
|
parseOptions.from = "eval";
|
|
2102
2102
|
}
|
|
2103
2103
|
}
|
|
2104
2104
|
if (argv === void 0) {
|
|
2105
|
-
argv =
|
|
2105
|
+
argv = process23.argv;
|
|
2106
2106
|
}
|
|
2107
2107
|
this.rawArgs = argv.slice();
|
|
2108
2108
|
let userArgs;
|
|
@@ -2113,7 +2113,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2113
2113
|
userArgs = argv.slice(2);
|
|
2114
2114
|
break;
|
|
2115
2115
|
case "electron":
|
|
2116
|
-
if (
|
|
2116
|
+
if (process23.defaultApp) {
|
|
2117
2117
|
this._scriptPath = argv[1];
|
|
2118
2118
|
userArgs = argv.slice(2);
|
|
2119
2119
|
} else {
|
|
@@ -2300,11 +2300,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2300
2300
|
}
|
|
2301
2301
|
launchWithNode = sourceExt.includes(path4.extname(executableFile));
|
|
2302
2302
|
let proc;
|
|
2303
|
-
if (
|
|
2303
|
+
if (process23.platform !== "win32") {
|
|
2304
2304
|
if (launchWithNode) {
|
|
2305
2305
|
args.unshift(executableFile);
|
|
2306
|
-
args = incrementNodeInspectorPort(
|
|
2307
|
-
proc = childProcess2.spawn(
|
|
2306
|
+
args = incrementNodeInspectorPort(process23.execArgv).concat(args);
|
|
2307
|
+
proc = childProcess2.spawn(process23.argv[0], args, { stdio: "inherit" });
|
|
2308
2308
|
} else {
|
|
2309
2309
|
proc = childProcess2.spawn(executableFile, args, { stdio: "inherit" });
|
|
2310
2310
|
}
|
|
@@ -2315,13 +2315,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2315
2315
|
subcommand._name
|
|
2316
2316
|
);
|
|
2317
2317
|
args.unshift(executableFile);
|
|
2318
|
-
args = incrementNodeInspectorPort(
|
|
2319
|
-
proc = childProcess2.spawn(
|
|
2318
|
+
args = incrementNodeInspectorPort(process23.execArgv).concat(args);
|
|
2319
|
+
proc = childProcess2.spawn(process23.execPath, args, { stdio: "inherit" });
|
|
2320
2320
|
}
|
|
2321
2321
|
if (!proc.killed) {
|
|
2322
2322
|
const signals = ["SIGUSR1", "SIGUSR2", "SIGTERM", "SIGINT", "SIGHUP"];
|
|
2323
2323
|
signals.forEach((signal) => {
|
|
2324
|
-
|
|
2324
|
+
process23.on(signal, () => {
|
|
2325
2325
|
if (proc.killed === false && proc.exitCode === null) {
|
|
2326
2326
|
proc.kill(signal);
|
|
2327
2327
|
}
|
|
@@ -2332,7 +2332,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2332
2332
|
proc.on("close", (code) => {
|
|
2333
2333
|
code = code ?? 1;
|
|
2334
2334
|
if (!exitCallback) {
|
|
2335
|
-
|
|
2335
|
+
process23.exit(code);
|
|
2336
2336
|
} else {
|
|
2337
2337
|
exitCallback(
|
|
2338
2338
|
new CommanderError2(
|
|
@@ -2354,7 +2354,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2354
2354
|
throw new Error(`'${executableFile}' not executable`);
|
|
2355
2355
|
}
|
|
2356
2356
|
if (!exitCallback) {
|
|
2357
|
-
|
|
2357
|
+
process23.exit(1);
|
|
2358
2358
|
} else {
|
|
2359
2359
|
const wrappedError = new CommanderError2(
|
|
2360
2360
|
1,
|
|
@@ -2849,13 +2849,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2849
2849
|
*/
|
|
2850
2850
|
_parseOptionsEnv() {
|
|
2851
2851
|
this.options.forEach((option) => {
|
|
2852
|
-
if (option.envVar && option.envVar in
|
|
2852
|
+
if (option.envVar && option.envVar in process23.env) {
|
|
2853
2853
|
const optionKey = option.attributeName();
|
|
2854
2854
|
if (this.getOptionValue(optionKey) === void 0 || ["default", "config", "env"].includes(
|
|
2855
2855
|
this.getOptionValueSource(optionKey)
|
|
2856
2856
|
)) {
|
|
2857
2857
|
if (option.required || option.optional) {
|
|
2858
|
-
this.emit(`optionEnv:${option.name()}`,
|
|
2858
|
+
this.emit(`optionEnv:${option.name()}`, process23.env[option.envVar]);
|
|
2859
2859
|
} else {
|
|
2860
2860
|
this.emit(`optionEnv:${option.name()}`);
|
|
2861
2861
|
}
|
|
@@ -3310,7 +3310,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3310
3310
|
*/
|
|
3311
3311
|
help(contextOptions) {
|
|
3312
3312
|
this.outputHelp(contextOptions);
|
|
3313
|
-
let exitCode = Number(
|
|
3313
|
+
let exitCode = Number(process23.exitCode ?? 0);
|
|
3314
3314
|
if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) {
|
|
3315
3315
|
exitCode = 1;
|
|
3316
3316
|
}
|
|
@@ -3400,9 +3400,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
3400
3400
|
});
|
|
3401
3401
|
}
|
|
3402
3402
|
function useColor() {
|
|
3403
|
-
if (
|
|
3403
|
+
if (process23.env.NO_COLOR || process23.env.FORCE_COLOR === "0" || process23.env.FORCE_COLOR === "false")
|
|
3404
3404
|
return false;
|
|
3405
|
-
if (
|
|
3405
|
+
if (process23.env.FORCE_COLOR || process23.env.CLICOLOR_FORCE !== void 0)
|
|
3406
3406
|
return true;
|
|
3407
3407
|
return void 0;
|
|
3408
3408
|
}
|
|
@@ -9263,11 +9263,11 @@ var require_signal_exit = __commonJS({
|
|
|
9263
9263
|
"../../node_modules/ink/node_modules/signal-exit/index.js"(exports, module2) {
|
|
9264
9264
|
"use strict";
|
|
9265
9265
|
init_esm_shims();
|
|
9266
|
-
var
|
|
9267
|
-
var processOk = function(
|
|
9268
|
-
return
|
|
9266
|
+
var process23 = global.process;
|
|
9267
|
+
var processOk = function(process24) {
|
|
9268
|
+
return process24 && typeof process24 === "object" && typeof process24.removeListener === "function" && typeof process24.emit === "function" && typeof process24.reallyExit === "function" && typeof process24.listeners === "function" && typeof process24.kill === "function" && typeof process24.pid === "number" && typeof process24.on === "function";
|
|
9269
9269
|
};
|
|
9270
|
-
if (!processOk(
|
|
9270
|
+
if (!processOk(process23)) {
|
|
9271
9271
|
module2.exports = function() {
|
|
9272
9272
|
return function() {
|
|
9273
9273
|
};
|
|
@@ -9275,15 +9275,15 @@ var require_signal_exit = __commonJS({
|
|
|
9275
9275
|
} else {
|
|
9276
9276
|
assert = __require("assert");
|
|
9277
9277
|
signals = require_signals();
|
|
9278
|
-
isWin = /^win/i.test(
|
|
9278
|
+
isWin = /^win/i.test(process23.platform);
|
|
9279
9279
|
EE = __require("events");
|
|
9280
9280
|
if (typeof EE !== "function") {
|
|
9281
9281
|
EE = EE.EventEmitter;
|
|
9282
9282
|
}
|
|
9283
|
-
if (
|
|
9284
|
-
emitter =
|
|
9283
|
+
if (process23.__signal_exit_emitter__) {
|
|
9284
|
+
emitter = process23.__signal_exit_emitter__;
|
|
9285
9285
|
} else {
|
|
9286
|
-
emitter =
|
|
9286
|
+
emitter = process23.__signal_exit_emitter__ = new EE();
|
|
9287
9287
|
emitter.count = 0;
|
|
9288
9288
|
emitter.emitted = {};
|
|
9289
9289
|
}
|
|
@@ -9320,12 +9320,12 @@ var require_signal_exit = __commonJS({
|
|
|
9320
9320
|
loaded = false;
|
|
9321
9321
|
signals.forEach(function(sig) {
|
|
9322
9322
|
try {
|
|
9323
|
-
|
|
9323
|
+
process23.removeListener(sig, sigListeners[sig]);
|
|
9324
9324
|
} catch (er) {
|
|
9325
9325
|
}
|
|
9326
9326
|
});
|
|
9327
|
-
|
|
9328
|
-
|
|
9327
|
+
process23.emit = originalProcessEmit;
|
|
9328
|
+
process23.reallyExit = originalProcessReallyExit;
|
|
9329
9329
|
emitter.count -= 1;
|
|
9330
9330
|
};
|
|
9331
9331
|
module2.exports.unload = unload;
|
|
@@ -9342,7 +9342,7 @@ var require_signal_exit = __commonJS({
|
|
|
9342
9342
|
if (!processOk(global.process)) {
|
|
9343
9343
|
return;
|
|
9344
9344
|
}
|
|
9345
|
-
var listeners =
|
|
9345
|
+
var listeners = process23.listeners(sig);
|
|
9346
9346
|
if (listeners.length === emitter.count) {
|
|
9347
9347
|
unload();
|
|
9348
9348
|
emit("exit", null, sig);
|
|
@@ -9350,7 +9350,7 @@ var require_signal_exit = __commonJS({
|
|
|
9350
9350
|
if (isWin && sig === "SIGHUP") {
|
|
9351
9351
|
sig = "SIGINT";
|
|
9352
9352
|
}
|
|
9353
|
-
|
|
9353
|
+
process23.kill(process23.pid, sig);
|
|
9354
9354
|
}
|
|
9355
9355
|
};
|
|
9356
9356
|
});
|
|
@@ -9366,36 +9366,36 @@ var require_signal_exit = __commonJS({
|
|
|
9366
9366
|
emitter.count += 1;
|
|
9367
9367
|
signals = signals.filter(function(sig) {
|
|
9368
9368
|
try {
|
|
9369
|
-
|
|
9369
|
+
process23.on(sig, sigListeners[sig]);
|
|
9370
9370
|
return true;
|
|
9371
9371
|
} catch (er) {
|
|
9372
9372
|
return false;
|
|
9373
9373
|
}
|
|
9374
9374
|
});
|
|
9375
|
-
|
|
9376
|
-
|
|
9375
|
+
process23.emit = processEmit;
|
|
9376
|
+
process23.reallyExit = processReallyExit;
|
|
9377
9377
|
};
|
|
9378
9378
|
module2.exports.load = load;
|
|
9379
|
-
originalProcessReallyExit =
|
|
9379
|
+
originalProcessReallyExit = process23.reallyExit;
|
|
9380
9380
|
processReallyExit = function processReallyExit2(code) {
|
|
9381
9381
|
if (!processOk(global.process)) {
|
|
9382
9382
|
return;
|
|
9383
9383
|
}
|
|
9384
|
-
|
|
9384
|
+
process23.exitCode = code || /* istanbul ignore next */
|
|
9385
9385
|
0;
|
|
9386
|
-
emit("exit",
|
|
9387
|
-
emit("afterexit",
|
|
9388
|
-
originalProcessReallyExit.call(
|
|
9386
|
+
emit("exit", process23.exitCode, null);
|
|
9387
|
+
emit("afterexit", process23.exitCode, null);
|
|
9388
|
+
originalProcessReallyExit.call(process23, process23.exitCode);
|
|
9389
9389
|
};
|
|
9390
|
-
originalProcessEmit =
|
|
9390
|
+
originalProcessEmit = process23.emit;
|
|
9391
9391
|
processEmit = function processEmit2(ev, arg) {
|
|
9392
9392
|
if (ev === "exit" && processOk(global.process)) {
|
|
9393
9393
|
if (arg !== void 0) {
|
|
9394
|
-
|
|
9394
|
+
process23.exitCode = arg;
|
|
9395
9395
|
}
|
|
9396
9396
|
var ret = originalProcessEmit.apply(this, arguments);
|
|
9397
|
-
emit("exit",
|
|
9398
|
-
emit("afterexit",
|
|
9397
|
+
emit("exit", process23.exitCode, null);
|
|
9398
|
+
emit("afterexit", process23.exitCode, null);
|
|
9399
9399
|
return ret;
|
|
9400
9400
|
} else {
|
|
9401
9401
|
return originalProcessEmit.apply(this, arguments);
|
|
@@ -66621,7 +66621,7 @@ function getErrorComponent(code, cause) {
|
|
|
66621
66621
|
return () => /* @__PURE__ */ import_react82.default.createElement(ErrorMessage, { message: "Failed to generate a self-signed certificate for development." });
|
|
66622
66622
|
},
|
|
66623
66623
|
NonInteractiveTerminal: () => {
|
|
66624
|
-
return () => /* @__PURE__ */ import_react82.default.createElement(ErrorMessage, { message: "This command is not supported in non-interactive terminals.
|
|
66624
|
+
return () => /* @__PURE__ */ import_react82.default.createElement(ErrorMessage, { message: "This command is not supported in non-interactive terminals. Run with --help to see flags for non-interactive usage, or use an interactive terminal (TTY)." });
|
|
66625
66625
|
},
|
|
66626
66626
|
FailedToResolveViteOrigin: () => {
|
|
66627
66627
|
return () => /* @__PURE__ */ import_react82.default.createElement(ErrorMessage, { message: "Failed to resolve the base url for CSS asset urls" });
|
|
@@ -83541,6 +83541,7 @@ var getAppCommand = ({
|
|
|
83541
83541
|
// ../create-new-packages/headless-command/src/index.tsx
|
|
83542
83542
|
init_esm_shims();
|
|
83543
83543
|
var import_react156 = __toESM(require_react(), 1);
|
|
83544
|
+
import process22 from "node:process";
|
|
83544
83545
|
|
|
83545
83546
|
// ../create-new-packages/headless-command/src/validations/validate-business-name.ts
|
|
83546
83547
|
init_esm_shims();
|
|
@@ -95930,6 +95931,14 @@ function validateDirectoryExists(path4) {
|
|
|
95930
95931
|
}
|
|
95931
95932
|
|
|
95932
95933
|
// ../create-new-packages/headless-command/src/index.tsx
|
|
95934
|
+
function assertInteractiveTerminalIfNeeded(hasRequiredFlagsForNonInteractive) {
|
|
95935
|
+
if (!process22.stdin.isTTY && !hasRequiredFlagsForNonInteractive) {
|
|
95936
|
+
throw new CliError({
|
|
95937
|
+
code: CliErrorCode.NonInteractiveTerminal(),
|
|
95938
|
+
cause: null
|
|
95939
|
+
});
|
|
95940
|
+
}
|
|
95941
|
+
}
|
|
95933
95942
|
var getHeadlessCommand = ({
|
|
95934
95943
|
errorReporter: errorReporter2,
|
|
95935
95944
|
userInfo: userInfo2,
|
|
@@ -95955,6 +95964,9 @@ var getHeadlessCommand = ({
|
|
|
95955
95964
|
Arguments: command.args,
|
|
95956
95965
|
Options: command.opts()
|
|
95957
95966
|
});
|
|
95967
|
+
assertInteractiveTerminalIfNeeded(
|
|
95968
|
+
Boolean(options.businessName && options.projectName)
|
|
95969
|
+
);
|
|
95958
95970
|
const { biLogger, reportCommandStartEvent: reportCommandStartEvent2 } = await createBiLogger3({
|
|
95959
95971
|
errorReporter: errorReporter2,
|
|
95960
95972
|
cliVersion,
|
|
@@ -96042,6 +96054,11 @@ var getHeadlessCommand = ({
|
|
|
96042
96054
|
Arguments: command.args,
|
|
96043
96055
|
Options: command.opts()
|
|
96044
96056
|
});
|
|
96057
|
+
assertInteractiveTerminalIfNeeded(
|
|
96058
|
+
Boolean(
|
|
96059
|
+
options.siteTemplate && options.businessName && options.projectName
|
|
96060
|
+
)
|
|
96061
|
+
);
|
|
96045
96062
|
const { biLogger, reportCommandStartEvent: reportCommandStartEvent2 } = await createBiLogger3({
|
|
96046
96063
|
errorReporter: errorReporter2,
|
|
96047
96064
|
cliVersion,
|
|
@@ -96080,7 +96097,7 @@ import { randomUUID as randomUUID3 } from "node:crypto";
|
|
|
96080
96097
|
var package_default = {
|
|
96081
96098
|
name: "@wix/create-new",
|
|
96082
96099
|
description: "General entry point for creating Wix projects",
|
|
96083
|
-
version: "0.0.
|
|
96100
|
+
version: "0.0.52",
|
|
96084
96101
|
bin: "bin/index.cjs",
|
|
96085
96102
|
devDependencies: {
|
|
96086
96103
|
"@commander-js/extra-typings": "^13.0.0",
|