create-tamagui 1.35.7 → 1.35.11
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/helpers/cloneStarter.js +155 -29
- package/dist/helpers/cloneStarter.js.map +3 -3
- package/dist/helpers/getProjectName.js +3 -2
- package/dist/helpers/getProjectName.js.map +1 -1
- package/dist/helpers/getTemplateInfo.js +214 -69
- package/dist/helpers/getTemplateInfo.js.map +3 -3
- package/dist/index.js +750 -513
- package/dist/index.js.map +3 -3
- package/dist/templates.js +4828 -46
- package/dist/templates.js.map +3 -3
- package/package.json +3 -2
|
@@ -1497,18 +1497,18 @@ var require_source = __commonJS({
|
|
|
1497
1497
|
}
|
|
1498
1498
|
}
|
|
1499
1499
|
});
|
|
1500
|
-
var createStyler2 = (
|
|
1500
|
+
var createStyler2 = (open2, close, parent) => {
|
|
1501
1501
|
let openAll;
|
|
1502
1502
|
let closeAll;
|
|
1503
1503
|
if (parent === void 0) {
|
|
1504
|
-
openAll =
|
|
1504
|
+
openAll = open2;
|
|
1505
1505
|
closeAll = close;
|
|
1506
1506
|
} else {
|
|
1507
|
-
openAll = parent.openAll +
|
|
1507
|
+
openAll = parent.openAll + open2;
|
|
1508
1508
|
closeAll = close + parent.closeAll;
|
|
1509
1509
|
}
|
|
1510
1510
|
return {
|
|
1511
|
-
open,
|
|
1511
|
+
open: open2,
|
|
1512
1512
|
close,
|
|
1513
1513
|
openAll,
|
|
1514
1514
|
closeAll,
|
|
@@ -2308,7 +2308,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2308
2308
|
}
|
|
2309
2309
|
function ReadStream$open() {
|
|
2310
2310
|
var that = this;
|
|
2311
|
-
|
|
2311
|
+
open2(that.path, that.flags, that.mode, function(err, fd) {
|
|
2312
2312
|
if (err) {
|
|
2313
2313
|
if (that.autoClose)
|
|
2314
2314
|
that.destroy();
|
|
@@ -2328,7 +2328,7 @@ var require_graceful_fs = __commonJS({
|
|
|
2328
2328
|
}
|
|
2329
2329
|
function WriteStream$open() {
|
|
2330
2330
|
var that = this;
|
|
2331
|
-
|
|
2331
|
+
open2(that.path, that.flags, that.mode, function(err, fd) {
|
|
2332
2332
|
if (err) {
|
|
2333
2333
|
that.destroy();
|
|
2334
2334
|
that.emit("error", err);
|
|
@@ -2345,8 +2345,8 @@ var require_graceful_fs = __commonJS({
|
|
|
2345
2345
|
return new fs4.WriteStream(path2, options);
|
|
2346
2346
|
}
|
|
2347
2347
|
var fs$open = fs4.open;
|
|
2348
|
-
fs4.open =
|
|
2349
|
-
function
|
|
2348
|
+
fs4.open = open2;
|
|
2349
|
+
function open2(path2, flags, mode, cb) {
|
|
2350
2350
|
if (typeof mode === "function")
|
|
2351
2351
|
cb = mode, mode = null;
|
|
2352
2352
|
return go$open(path2, flags, mode, cb);
|
|
@@ -5206,9 +5206,9 @@ var require_is_glob = __commonJS({
|
|
|
5206
5206
|
}
|
|
5207
5207
|
}
|
|
5208
5208
|
if (str[index] === "\\") {
|
|
5209
|
-
var
|
|
5209
|
+
var open2 = str[index + 1];
|
|
5210
5210
|
index += 2;
|
|
5211
|
-
var close = chars[
|
|
5211
|
+
var close = chars[open2];
|
|
5212
5212
|
if (close) {
|
|
5213
5213
|
var n = str.indexOf(close, index);
|
|
5214
5214
|
if (n !== -1) {
|
|
@@ -5234,9 +5234,9 @@ var require_is_glob = __commonJS({
|
|
|
5234
5234
|
return true;
|
|
5235
5235
|
}
|
|
5236
5236
|
if (str[index] === "\\") {
|
|
5237
|
-
var
|
|
5237
|
+
var open2 = str[index + 1];
|
|
5238
5238
|
index += 2;
|
|
5239
|
-
var close = chars[
|
|
5239
|
+
var close = chars[open2];
|
|
5240
5240
|
if (close) {
|
|
5241
5241
|
var n = str.indexOf(close, index);
|
|
5242
5242
|
if (n !== -1) {
|
|
@@ -6219,7 +6219,7 @@ var require_parse = __commonJS({
|
|
|
6219
6219
|
continue;
|
|
6220
6220
|
}
|
|
6221
6221
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
6222
|
-
let
|
|
6222
|
+
let open2 = value;
|
|
6223
6223
|
let next;
|
|
6224
6224
|
if (options.keepQuotes !== true) {
|
|
6225
6225
|
value = "";
|
|
@@ -6229,7 +6229,7 @@ var require_parse = __commonJS({
|
|
|
6229
6229
|
value += next + advance();
|
|
6230
6230
|
continue;
|
|
6231
6231
|
}
|
|
6232
|
-
if (next ===
|
|
6232
|
+
if (next === open2) {
|
|
6233
6233
|
if (options.keepQuotes === true)
|
|
6234
6234
|
value += next;
|
|
6235
6235
|
break;
|
|
@@ -6273,8 +6273,8 @@ var require_parse = __commonJS({
|
|
|
6273
6273
|
if (value === CHAR_COMMA && depth > 0) {
|
|
6274
6274
|
if (block.ranges > 0) {
|
|
6275
6275
|
block.ranges = 0;
|
|
6276
|
-
let
|
|
6277
|
-
block.nodes = [
|
|
6276
|
+
let open2 = block.nodes.shift();
|
|
6277
|
+
block.nodes = [open2, { type: "text", value: stringify(block) }];
|
|
6278
6278
|
}
|
|
6279
6279
|
push({ type: "comma", value });
|
|
6280
6280
|
block.commas++;
|
|
@@ -7377,15 +7377,15 @@ var require_parse2 = __commonJS({
|
|
|
7377
7377
|
}
|
|
7378
7378
|
if (value === "{" && opts.nobrace !== true) {
|
|
7379
7379
|
increment("braces");
|
|
7380
|
-
const
|
|
7380
|
+
const open2 = {
|
|
7381
7381
|
type: "brace",
|
|
7382
7382
|
value,
|
|
7383
7383
|
output: "(",
|
|
7384
7384
|
outputIndex: state.output.length,
|
|
7385
7385
|
tokensIndex: state.tokens.length
|
|
7386
7386
|
};
|
|
7387
|
-
braces.push(
|
|
7388
|
-
push(
|
|
7387
|
+
braces.push(open2);
|
|
7388
|
+
push(open2);
|
|
7389
7389
|
continue;
|
|
7390
7390
|
}
|
|
7391
7391
|
if (value === "}") {
|
|
@@ -18119,6 +18119,125 @@ var require_dist = __commonJS({
|
|
|
18119
18119
|
}
|
|
18120
18120
|
});
|
|
18121
18121
|
|
|
18122
|
+
// ../../node_modules/opn/node_modules/is-wsl/index.js
|
|
18123
|
+
var require_is_wsl = __commonJS({
|
|
18124
|
+
"../../node_modules/opn/node_modules/is-wsl/index.js"(exports, module2) {
|
|
18125
|
+
"use strict";
|
|
18126
|
+
var os2 = require("os");
|
|
18127
|
+
var fs3 = require("fs");
|
|
18128
|
+
var isWsl = () => {
|
|
18129
|
+
if (process.platform !== "linux") {
|
|
18130
|
+
return false;
|
|
18131
|
+
}
|
|
18132
|
+
if (os2.release().includes("Microsoft")) {
|
|
18133
|
+
return true;
|
|
18134
|
+
}
|
|
18135
|
+
try {
|
|
18136
|
+
return fs3.readFileSync("/proc/version", "utf8").includes("Microsoft");
|
|
18137
|
+
} catch (err) {
|
|
18138
|
+
return false;
|
|
18139
|
+
}
|
|
18140
|
+
};
|
|
18141
|
+
if (process.env.__IS_WSL_TEST__) {
|
|
18142
|
+
module2.exports = isWsl;
|
|
18143
|
+
} else {
|
|
18144
|
+
module2.exports = isWsl();
|
|
18145
|
+
}
|
|
18146
|
+
}
|
|
18147
|
+
});
|
|
18148
|
+
|
|
18149
|
+
// ../../node_modules/opn/index.js
|
|
18150
|
+
var require_opn = __commonJS({
|
|
18151
|
+
"../../node_modules/opn/index.js"(exports, module2) {
|
|
18152
|
+
"use strict";
|
|
18153
|
+
var { promisify: promisify2 } = require("util");
|
|
18154
|
+
var path2 = require("path");
|
|
18155
|
+
var childProcess = require("child_process");
|
|
18156
|
+
var isWsl = require_is_wsl();
|
|
18157
|
+
var pExecFile = promisify2(childProcess.execFile);
|
|
18158
|
+
var wslToWindowsPath = async (path3) => {
|
|
18159
|
+
const { stdout } = await pExecFile("wslpath", ["-w", path3]);
|
|
18160
|
+
return stdout.trim();
|
|
18161
|
+
};
|
|
18162
|
+
module2.exports = async (target, options) => {
|
|
18163
|
+
if (typeof target !== "string") {
|
|
18164
|
+
throw new TypeError("Expected a `target`");
|
|
18165
|
+
}
|
|
18166
|
+
options = {
|
|
18167
|
+
wait: false,
|
|
18168
|
+
...options
|
|
18169
|
+
};
|
|
18170
|
+
let command;
|
|
18171
|
+
let appArguments = [];
|
|
18172
|
+
const cliArguments = [];
|
|
18173
|
+
const childProcessOptions = {};
|
|
18174
|
+
if (Array.isArray(options.app)) {
|
|
18175
|
+
appArguments = options.app.slice(1);
|
|
18176
|
+
options.app = options.app[0];
|
|
18177
|
+
}
|
|
18178
|
+
if (process.platform === "darwin") {
|
|
18179
|
+
command = "open";
|
|
18180
|
+
if (options.wait) {
|
|
18181
|
+
cliArguments.push("-W");
|
|
18182
|
+
}
|
|
18183
|
+
if (options.app) {
|
|
18184
|
+
cliArguments.push("-a", options.app);
|
|
18185
|
+
}
|
|
18186
|
+
} else if (process.platform === "win32" || isWsl) {
|
|
18187
|
+
command = "cmd" + (isWsl ? ".exe" : "");
|
|
18188
|
+
cliArguments.push("/c", "start", '""', "/b");
|
|
18189
|
+
target = target.replace(/&/g, "^&");
|
|
18190
|
+
if (options.wait) {
|
|
18191
|
+
cliArguments.push("/wait");
|
|
18192
|
+
}
|
|
18193
|
+
if (options.app) {
|
|
18194
|
+
if (isWsl && options.app.startsWith("/mnt/")) {
|
|
18195
|
+
const windowsPath = await wslToWindowsPath(options.app);
|
|
18196
|
+
options.app = windowsPath;
|
|
18197
|
+
}
|
|
18198
|
+
cliArguments.push(options.app);
|
|
18199
|
+
}
|
|
18200
|
+
if (appArguments.length > 0) {
|
|
18201
|
+
cliArguments.push(...appArguments);
|
|
18202
|
+
}
|
|
18203
|
+
} else {
|
|
18204
|
+
if (options.app) {
|
|
18205
|
+
command = options.app;
|
|
18206
|
+
} else {
|
|
18207
|
+
const useSystemXdgOpen = process.versions.electron || process.platform === "android";
|
|
18208
|
+
command = useSystemXdgOpen ? "xdg-open" : path2.join(__dirname, "xdg-open");
|
|
18209
|
+
}
|
|
18210
|
+
if (appArguments.length > 0) {
|
|
18211
|
+
cliArguments.push(...appArguments);
|
|
18212
|
+
}
|
|
18213
|
+
if (!options.wait) {
|
|
18214
|
+
childProcessOptions.stdio = "ignore";
|
|
18215
|
+
childProcessOptions.detached = true;
|
|
18216
|
+
}
|
|
18217
|
+
}
|
|
18218
|
+
cliArguments.push(target);
|
|
18219
|
+
if (process.platform === "darwin" && appArguments.length > 0) {
|
|
18220
|
+
cliArguments.push("--args", ...appArguments);
|
|
18221
|
+
}
|
|
18222
|
+
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
18223
|
+
if (options.wait) {
|
|
18224
|
+
return new Promise((resolve, reject) => {
|
|
18225
|
+
subprocess.once("error", reject);
|
|
18226
|
+
subprocess.once("close", (exitCode) => {
|
|
18227
|
+
if (exitCode > 0) {
|
|
18228
|
+
reject(new Error(`Exited with code ${exitCode}`));
|
|
18229
|
+
return;
|
|
18230
|
+
}
|
|
18231
|
+
resolve(subprocess);
|
|
18232
|
+
});
|
|
18233
|
+
});
|
|
18234
|
+
}
|
|
18235
|
+
subprocess.unref();
|
|
18236
|
+
return subprocess;
|
|
18237
|
+
};
|
|
18238
|
+
}
|
|
18239
|
+
});
|
|
18240
|
+
|
|
18122
18241
|
// src/helpers/cloneStarter.ts
|
|
18123
18242
|
var cloneStarter_exports = {};
|
|
18124
18243
|
__export(cloneStarter_exports, {
|
|
@@ -18574,18 +18693,18 @@ var proto = Object.defineProperties(() => {
|
|
|
18574
18693
|
}
|
|
18575
18694
|
}
|
|
18576
18695
|
});
|
|
18577
|
-
var createStyler = (
|
|
18696
|
+
var createStyler = (open2, close, parent) => {
|
|
18578
18697
|
let openAll;
|
|
18579
18698
|
let closeAll;
|
|
18580
18699
|
if (parent === void 0) {
|
|
18581
|
-
openAll =
|
|
18700
|
+
openAll = open2;
|
|
18582
18701
|
closeAll = close;
|
|
18583
18702
|
} else {
|
|
18584
|
-
openAll = parent.openAll +
|
|
18703
|
+
openAll = parent.openAll + open2;
|
|
18585
18704
|
closeAll = close + parent.closeAll;
|
|
18586
18705
|
}
|
|
18587
18706
|
return {
|
|
18588
|
-
open,
|
|
18707
|
+
open: open2,
|
|
18589
18708
|
close,
|
|
18590
18709
|
openAll,
|
|
18591
18710
|
closeAll,
|
|
@@ -19578,6 +19697,7 @@ var globby2 = Object.assign(function globby3(patterns, options) {
|
|
|
19578
19697
|
var IS_TEST = process.env.NODE_ENV === "test";
|
|
19579
19698
|
|
|
19580
19699
|
// src/helpers/cloneStarter.ts
|
|
19700
|
+
var open = require_opn();
|
|
19581
19701
|
var home = (0, import_os.homedir)();
|
|
19582
19702
|
var tamaguiDir = (0, import_path.join)(home, ".tamagui");
|
|
19583
19703
|
var targetGitDir = "";
|
|
@@ -19630,12 +19750,18 @@ async function setupTamaguiDotDir(template, isRetry = false) {
|
|
|
19630
19750
|
try {
|
|
19631
19751
|
(0, import_child_process.execSync)(cmd);
|
|
19632
19752
|
} catch (error) {
|
|
19633
|
-
if (
|
|
19634
|
-
|
|
19635
|
-
|
|
19636
|
-
|
|
19637
|
-
|
|
19638
|
-
|
|
19753
|
+
if (error instanceof Error) {
|
|
19754
|
+
if (template.value === "takeout-starter") {
|
|
19755
|
+
if (error == null ? void 0 : error.stderr.includes("Repository not found")) {
|
|
19756
|
+
console.log(
|
|
19757
|
+
import_chalk5.default.yellow(
|
|
19758
|
+
`You don't have access to this starter. Check \u{1F961} Tamagui Takeout (https://tamagui.dev/takeout) for more info.`
|
|
19759
|
+
)
|
|
19760
|
+
);
|
|
19761
|
+
open("https://tamagui.dev/takeout");
|
|
19762
|
+
process.exit(0);
|
|
19763
|
+
}
|
|
19764
|
+
}
|
|
19639
19765
|
}
|
|
19640
19766
|
throw error;
|
|
19641
19767
|
}
|