vibedgames 0.9.0 → 0.10.0
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/README.md +3 -2
- package/assets/align-framing.py +242 -0
- package/assets/render-model.py +406 -0
- package/assets/tilemap-editor.html +630 -0
- package/dist/THIRD_PARTY_NOTICES.txt +2 -2
- package/dist/chunk-2KVQJKIZ.js +6495 -0
- package/dist/{chunk-56OY4TEP.js → chunk-2SBBKY5C.js} +1361 -4493
- package/dist/{chunk-FC233UKH.js → chunk-2ZKS7V72.js} +16 -16
- package/dist/{chunk-BMTHAVMS.js → chunk-3HGBIUM5.js} +22 -19
- package/dist/chunk-3UGGMFJJ.js +22 -0
- package/dist/{chunk-3HUWAJQH.js → chunk-42K3BJJH.js} +93 -76
- package/dist/{chunk-ST5FC2W3.js → chunk-43P4U7CB.js} +20 -11
- package/dist/chunk-4FJXCS3K.js +741 -0
- package/dist/{chunk-WSRIF6K4.js → chunk-4UU622RK.js} +5 -4
- package/dist/chunk-5YPLKGY3.js +87 -0
- package/dist/chunk-6KXXZXSO.js +475 -0
- package/dist/chunk-7RPLQWR2.js +91 -0
- package/dist/{chunk-ZCYWDKYP.js → chunk-A556KALN.js} +14 -13
- package/dist/{chunk-UFR6G6BL.js → chunk-ABTUEIRC.js} +554 -254
- package/dist/{chunk-PEUP4MZR.js → chunk-AWJNAGPE.js} +6 -3
- package/dist/{chunk-HNRVSBRK.js → chunk-BN3Q7UEC.js} +20 -17
- package/dist/chunk-BZOMEG3X.js +412 -0
- package/dist/{chunk-ZYCSYJWX.js → chunk-COSLGSVO.js} +14 -24
- package/dist/{chunk-KZBZNTM4.js → chunk-CTY2WZQK.js} +9 -13
- package/dist/chunk-DB7WVFS7.js +80 -0
- package/dist/chunk-DOOQUFPG.js +73 -0
- package/dist/{chunk-K2U7L4RU.js → chunk-E3FJUPLT.js} +15 -21
- package/dist/chunk-E7NDOZ27.js +428 -0
- package/dist/{chunk-TBQ5BU3Q.js → chunk-F42QKWBB.js} +18 -18
- package/dist/chunk-FXXVXDTW.js +168 -0
- package/dist/{chunk-VFFOT7KD.js → chunk-G66HRVDW.js} +1 -1
- package/dist/chunk-GLEW7VJQ.js +45 -0
- package/dist/{chunk-AXTLPJ2F.js → chunk-H2C4QUTG.js} +8 -7
- package/dist/{chunk-H3IPLBXQ.js → chunk-HRKVAXNN.js} +17 -14
- package/dist/{chunk-UXCWSWWX.js → chunk-HSMG6U7J.js} +8 -7
- package/dist/chunk-HX5Q63UA.js +48 -0
- package/dist/chunk-HYOXGNWS.js +53 -0
- package/dist/chunk-I5LELJSK.js +22 -0
- package/dist/{chunk-7CXMMC5S.js → chunk-JN4WZCR7.js} +5 -4
- package/dist/{chunk-7QZSDU52.js → chunk-K36EOII3.js} +5 -4
- package/dist/chunk-KAGVI3CE.js +62 -0
- package/dist/chunk-KJK5CB6E.js +58 -0
- package/dist/chunk-KLFBAFXD.js +25 -0
- package/dist/{chunk-355VG7EO.js → chunk-LONQWRTR.js} +107 -77
- package/dist/{chunk-Z5TFZQ5U.js → chunk-LORGE2NB.js} +68 -62
- package/dist/{chunk-LY2GQ32S.js → chunk-MEAO33XW.js} +22 -20
- package/dist/{chunk-OD2MNYXD.js → chunk-MR5KIFI7.js} +23 -22
- package/dist/{chunk-2VUUMXAQ.js → chunk-N2UHAQXC.js} +18 -11
- package/dist/chunk-NCX6LYNJ.js +117 -0
- package/dist/chunk-OGX4DKIS.js +215 -0
- package/dist/chunk-OPUCUUID.js +41 -0
- package/dist/chunk-Q2QC6KAZ.js +132 -0
- package/dist/{chunk-NDHXM4PL.js → chunk-Q3XQPNF6.js} +12 -12
- package/dist/{chunk-RXHTGX7C.js → chunk-Q5NZNXJE.js} +6 -10
- package/dist/chunk-QLCVLCPM.js +126 -0
- package/dist/chunk-R2WVORGD.js +91 -0
- package/dist/chunk-RKS7SI5L.js +64 -0
- package/dist/{chunk-US6QZICZ.js → chunk-RPJR3S5S.js} +32 -18
- package/dist/chunk-RPSUFZAG.js +3307 -0
- package/dist/chunk-RRI23NK2.js +40 -0
- package/dist/chunk-S7HYWITX.js +57 -0
- package/dist/chunk-SBXCK2I2.js +48 -0
- package/dist/chunk-SUSX3QIA.js +62 -0
- package/dist/{chunk-6EWHKL7Z.js → chunk-SXYQL4GK.js} +7 -6
- package/dist/{chunk-ZI6PKVXG.js → chunk-TMPBGXT4.js} +6 -5
- package/dist/chunk-TXOE5UY5.js +72 -0
- package/dist/chunk-U6DTE5IX.js +124 -0
- package/dist/{chunk-UZM6OSW5.js → chunk-UPHB5HWO.js} +15 -13
- package/dist/chunk-UQ7VO6B3.js +91 -0
- package/dist/chunk-VB4WLJR2.js +47 -0
- package/dist/{chunk-25BAMW5X.js → chunk-VIEKOGKG.js} +18 -2
- package/dist/{chunk-LXS3NJYD.js → chunk-VZEJ2ZHE.js} +14 -15
- package/dist/{chunk-Z4Z24FWO.js → chunk-YNCYMWER.js} +8 -5
- package/dist/chunk-ZHLPE6LI.js +71 -0
- package/dist/index.js +39 -36
- package/package.json +31 -16
- package/templates/none/src/main.ts +4 -0
- package/templates/none/vite.config.ts +0 -2
- package/templates/phaser/src/main.ts +0 -1
- package/templates/phaser/src/scenes/game-scene.ts +10 -8
- package/templates/phaser/vite.config.ts +0 -2
- package/templates/react-r3f/src/app.tsx +3 -1
- package/templates/react-r3f/src/main.tsx +1 -0
- package/templates/react-r3f/vite.config.ts +0 -2
- package/templates/threejs/src/main.ts +10 -1
- package/templates/threejs/vite.config.ts +0 -2
- package/LICENSE +0 -21
- package/dist/chunk-J6PKNPI2.js +0 -26
|
@@ -4,35 +4,36 @@ import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
assertKnownFlags
|
|
9
|
+
} from "./chunk-RZ4DIJQW.js";
|
|
7
10
|
import {
|
|
8
11
|
authErrorCode,
|
|
9
12
|
createClient
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-Z4Z24FWO.js";
|
|
13
|
-
import "./chunk-PEUP4MZR.js";
|
|
13
|
+
} from "./chunk-CTY2WZQK.js";
|
|
14
|
+
import "./chunk-E3FJUPLT.js";
|
|
14
15
|
import {
|
|
15
16
|
getToken
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-Q5NZNXJE.js";
|
|
17
18
|
import {
|
|
18
19
|
outputArgs,
|
|
19
20
|
writeStructured
|
|
20
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-COSLGSVO.js";
|
|
21
22
|
import {
|
|
22
|
-
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
defineCommand
|
|
24
|
+
} from "./chunk-MBXCVCC4.js";
|
|
24
25
|
import {
|
|
25
26
|
consola
|
|
26
27
|
} from "./chunk-D2RF35HJ.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
import "./chunk-YNCYMWER.js";
|
|
29
|
+
import "./chunk-AWJNAGPE.js";
|
|
30
|
+
import "./chunk-RPSUFZAG.js";
|
|
31
|
+
import "./chunk-2SBBKY5C.js";
|
|
31
32
|
import "./chunk-GKDUYJ7R.js";
|
|
32
33
|
|
|
33
34
|
// src/commands/deployments.ts
|
|
34
35
|
var requireLogin = () => {
|
|
35
|
-
if (
|
|
36
|
+
if ((getToken() ?? "") === "") {
|
|
36
37
|
consola.warn("Not logged in. Run `vg login` to authenticate.");
|
|
37
38
|
process.exit(1);
|
|
38
39
|
}
|
|
@@ -123,7 +124,7 @@ var deleteCommand = defineCommand({
|
|
|
123
124
|
consola.error(`You have no game "${args.slug}". List yours with \`vg deployments\`.`);
|
|
124
125
|
process.exit(1);
|
|
125
126
|
}
|
|
126
|
-
if (
|
|
127
|
+
if (args.yes !== true) {
|
|
127
128
|
if (!process.stdin.isTTY) {
|
|
128
129
|
consola.error(`Deleting is permanent: pass --yes to delete ${args.slug}.`);
|
|
129
130
|
process.exit(2);
|
|
@@ -132,7 +133,7 @@ var deleteCommand = defineCommand({
|
|
|
132
133
|
`Permanently delete ${args.slug} and all of its files?`,
|
|
133
134
|
{ type: "confirm" }
|
|
134
135
|
);
|
|
135
|
-
if (confirmed
|
|
136
|
+
if (!confirmed) {
|
|
136
137
|
consola.info("Nothing deleted.");
|
|
137
138
|
return;
|
|
138
139
|
}
|
|
@@ -153,7 +154,6 @@ var deleteCommand = defineCommand({
|
|
|
153
154
|
}
|
|
154
155
|
});
|
|
155
156
|
var deploymentsCommand = defineCommand({
|
|
156
|
-
// Declared so citty skips `--field <value>` when looking for a subcommand.
|
|
157
157
|
args: outputArgs,
|
|
158
158
|
default: "list",
|
|
159
159
|
meta: {
|
|
@@ -4,32 +4,33 @@ import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import {
|
|
8
|
-
So
|
|
9
|
-
} from "./chunk-VFFOT7KD.js";
|
|
10
|
-
import {
|
|
11
|
-
PKG_NAME,
|
|
12
|
-
detectPackageManager,
|
|
13
|
-
globalInstallArgs,
|
|
14
|
-
globalInstallCommand
|
|
15
|
-
} from "./chunk-PEUP4MZR.js";
|
|
16
7
|
import {
|
|
17
8
|
isMissingCommand,
|
|
18
9
|
run
|
|
19
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-F42QKWBB.js";
|
|
11
|
+
import {
|
|
12
|
+
So
|
|
13
|
+
} from "./chunk-G66HRVDW.js";
|
|
20
14
|
import {
|
|
21
15
|
assertKnownFlags
|
|
22
16
|
} from "./chunk-RZ4DIJQW.js";
|
|
17
|
+
import {
|
|
18
|
+
defineCommand
|
|
19
|
+
} from "./chunk-MBXCVCC4.js";
|
|
23
20
|
import {
|
|
24
21
|
consola
|
|
25
22
|
} from "./chunk-D2RF35HJ.js";
|
|
26
23
|
import {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
PKG_NAME,
|
|
25
|
+
detectPackageManager,
|
|
26
|
+
globalInstallArgs,
|
|
27
|
+
globalInstallCommand
|
|
28
|
+
} from "./chunk-AWJNAGPE.js";
|
|
30
29
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
isJsonObject,
|
|
31
|
+
isJsonString,
|
|
32
|
+
parseJson
|
|
33
|
+
} from "./chunk-RPSUFZAG.js";
|
|
33
34
|
|
|
34
35
|
// src/commands/init.ts
|
|
35
36
|
import path2 from "node:path";
|
|
@@ -132,16 +133,18 @@ var SKILL_NAME = /^[a-z0-9][a-z0-9-]*$/u;
|
|
|
132
133
|
var SKIPPED_ENTRIES = /* @__PURE__ */ new Set([".DS_Store", ".git", "__pycache__", "node_modules"]);
|
|
133
134
|
var fetchSkillsSource = async (env = process.env) => {
|
|
134
135
|
const override = env.VG_SKILLS_SOURCE?.trim();
|
|
135
|
-
if (override && !/^https?:\/\//iu.test(override)) {
|
|
136
|
+
if (override !== void 0 && override !== "" && !/^https?:\/\//iu.test(override)) {
|
|
136
137
|
const root = path.resolve(override);
|
|
137
138
|
if (!existsSync(path.join(root, "plugins"))) {
|
|
138
139
|
throw new Error(`VG_SKILLS_SOURCE=${override} has no plugins/ directory.`);
|
|
139
140
|
}
|
|
140
141
|
return { origin: root, root };
|
|
141
142
|
}
|
|
142
|
-
const url = override || SKILLS_TARBALL;
|
|
143
|
+
const url = override === void 0 || override === "" ? SKILLS_TARBALL : override;
|
|
143
144
|
const work = mkdtempSync(path.join(tmpdir(), "vg-skills-"));
|
|
144
|
-
const cleanup = () =>
|
|
145
|
+
const cleanup = () => {
|
|
146
|
+
rmSync(work, { force: true, recursive: true });
|
|
147
|
+
};
|
|
145
148
|
try {
|
|
146
149
|
let res;
|
|
147
150
|
try {
|
|
@@ -192,7 +195,7 @@ var readJson = (file) => {
|
|
|
192
195
|
return null;
|
|
193
196
|
}
|
|
194
197
|
try {
|
|
195
|
-
const value =
|
|
198
|
+
const value = parseJson(readFileSync(file, "utf-8"));
|
|
196
199
|
return value;
|
|
197
200
|
} catch {
|
|
198
201
|
return null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from "node:module";
|
|
2
|
+
import { dirname as __pathDirname } from "node:path";
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
pythonScript
|
|
9
|
+
} from "./chunk-RRI23NK2.js";
|
|
10
|
+
import "./chunk-5535KDYI.js";
|
|
11
|
+
import "./chunk-D2RF35HJ.js";
|
|
12
|
+
import "./chunk-YNCYMWER.js";
|
|
13
|
+
import "./chunk-AWJNAGPE.js";
|
|
14
|
+
import "./chunk-RPSUFZAG.js";
|
|
15
|
+
import "./chunk-2SBBKY5C.js";
|
|
16
|
+
import "./chunk-GKDUYJ7R.js";
|
|
17
|
+
|
|
18
|
+
// src/commands/asset/align-framing.ts
|
|
19
|
+
var run = pythonScript("align-framing.py");
|
|
20
|
+
export {
|
|
21
|
+
run
|
|
22
|
+
};
|
|
@@ -7,19 +7,20 @@ var __dirname = __pathDirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
Qn,
|
|
9
9
|
So
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-G66HRVDW.js";
|
|
11
11
|
import {
|
|
12
12
|
isJsonObject,
|
|
13
|
-
isJsonString
|
|
14
|
-
|
|
13
|
+
isJsonString,
|
|
14
|
+
parseJson
|
|
15
|
+
} from "./chunk-RPSUFZAG.js";
|
|
15
16
|
import {
|
|
16
17
|
__commonJS,
|
|
17
18
|
__toESM
|
|
18
19
|
} from "./chunk-GKDUYJ7R.js";
|
|
19
20
|
|
|
20
|
-
// ../../node_modules/.pnpm/ignore@7.0.
|
|
21
|
+
// ../../node_modules/.pnpm/ignore@7.0.16/node_modules/ignore/index.js
|
|
21
22
|
var require_ignore = __commonJS({
|
|
22
|
-
"../../node_modules/.pnpm/ignore@7.0.
|
|
23
|
+
"../../node_modules/.pnpm/ignore@7.0.16/node_modules/ignore/index.js"(exports, module) {
|
|
23
24
|
function makeArray(subject) {
|
|
24
25
|
return Array.isArray(subject) ? subject : [subject];
|
|
25
26
|
}
|
|
@@ -29,7 +30,6 @@ var require_ignore = __commonJS({
|
|
|
29
30
|
var ESCAPE = "\\";
|
|
30
31
|
var REGEX_LITERAL_SPECIAL = /[.*+?()[\]{}^$|\\/]/;
|
|
31
32
|
var BOM = "\uFEFF";
|
|
32
|
-
var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
|
|
33
33
|
var REGEX_ANCHORED_GLOBSTAR = /^\/\*{2,}$/;
|
|
34
34
|
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
|
|
35
35
|
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
|
|
@@ -91,13 +91,9 @@ var require_ignore = __commonJS({
|
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
93
|
if (char === ESCAPE) {
|
|
94
|
-
const escaped = pattern[index
|
|
95
|
-
if (escaped === UNDEFINED) {
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
94
|
+
const escaped = pattern[++index];
|
|
98
95
|
body += escapeMember(escaped);
|
|
99
96
|
prev = escaped;
|
|
100
|
-
index++;
|
|
101
97
|
} else if (char === "-" && prev && index + 1 < length && pattern[index + 1] !== "]") {
|
|
102
98
|
index++;
|
|
103
99
|
let to = pattern[index];
|
|
@@ -162,7 +158,7 @@ var require_ignore = __commonJS({
|
|
|
162
158
|
const char = pattern[index];
|
|
163
159
|
if (char === ESCAPE) {
|
|
164
160
|
const escaped = pattern[index + 1];
|
|
165
|
-
if (escaped ===
|
|
161
|
+
if (escaped === SLASH && index + 2 === length) {
|
|
166
162
|
out += hold(NEVER_MATCH);
|
|
167
163
|
} else if (escaped === "*" || escaped === "[" || escaped === SPACE) {
|
|
168
164
|
out += pattern.slice(index, index + 2);
|
|
@@ -196,6 +192,7 @@ var require_ignore = __commonJS({
|
|
|
196
192
|
};
|
|
197
193
|
var DIRECT = null;
|
|
198
194
|
var REGEX_INNER_SLASH = /\/(?!$)/;
|
|
195
|
+
var WILDCARD = "[^\\/]*";
|
|
199
196
|
var REPLACERS = [
|
|
200
197
|
// Replace (\ ) with ' '
|
|
201
198
|
// Only a space: an escaped tab or other whitespace is already a literal by
|
|
@@ -276,7 +273,7 @@ var require_ignore = __commonJS({
|
|
|
276
273
|
// Notice that the '*'s have been replaced as '\\*'
|
|
277
274
|
/^\^*(?:\\\*\\\*\\\/)+/,
|
|
278
275
|
// '**/foo' <-> 'foo'
|
|
279
|
-
() => "
|
|
276
|
+
() => "(?:^|\\/)",
|
|
280
277
|
"*"
|
|
281
278
|
],
|
|
282
279
|
// starting
|
|
@@ -286,7 +283,7 @@ var require_ignore = __commonJS({
|
|
|
286
283
|
// If starts with '**', adding a '^' to the regular expression also works
|
|
287
284
|
DIRECT,
|
|
288
285
|
(source, pattern) => {
|
|
289
|
-
if (!source || source[0] === "^") {
|
|
286
|
+
if (!source || source[0] === "^" || source[0] === "(") {
|
|
290
287
|
return source;
|
|
291
288
|
}
|
|
292
289
|
const anchor = !REGEX_INNER_SLASH.test(pattern) ? "(?:^|\\/)" : "^";
|
|
@@ -310,13 +307,13 @@ var require_ignore = __commonJS({
|
|
|
310
307
|
// 'abc.*/' -> go
|
|
311
308
|
// 'abc.*' -> skip this rule,
|
|
312
309
|
// coz trailing single wildcard will be handed by [trailing wildcard]
|
|
313
|
-
/(^|[^\\]
|
|
310
|
+
/(^|[^\\])(?:\\\*)+(?!$)/g,
|
|
314
311
|
// '*.js' matches '.js'
|
|
315
312
|
// '*.js' doesn't match 'abc'
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
313
|
+
// 1. An asterisk "*" matches anything except a slash.
|
|
314
|
+
// 2. Other consecutive asterisks are considered regular asterisks
|
|
315
|
+
// and collapse into one non-slash wildcard run.
|
|
316
|
+
(_, p1) => p1 + WILDCARD,
|
|
320
317
|
"*"
|
|
321
318
|
],
|
|
322
319
|
// trailing wildcard, held apart from a literal star
|
|
@@ -393,8 +390,7 @@ var require_ignore = __commonJS({
|
|
|
393
390
|
return `${prefix}(?=$|\\/$)`;
|
|
394
391
|
};
|
|
395
392
|
var REGEX_REPLACE_TRAILING_DOUBLESTAR = /\uE001$/;
|
|
396
|
-
var replaceTrailingDoublestar = () => "
|
|
397
|
-
var WILDCARD = "[^\\/]*";
|
|
393
|
+
var replaceTrailingDoublestar = () => "[\\s\\S]";
|
|
398
394
|
var separatorAfter = (run, at) => {
|
|
399
395
|
let separator = EMPTY;
|
|
400
396
|
for (let index = at + 1; index < run.length && !run[index].wildcard; index++) {
|
|
@@ -518,7 +514,7 @@ var require_ignore = __commonJS({
|
|
|
518
514
|
}
|
|
519
515
|
const head = prefix.slice(0, -1);
|
|
520
516
|
const last = prefix[prefix.length - 1];
|
|
521
|
-
return last === TRAILING_WILDCARD ? `${head}$` : last === TRAILING_DOUBLESTAR ?
|
|
517
|
+
return last === TRAILING_WILDCARD ? `${head}$` : last === TRAILING_DOUBLESTAR ? head : NEVER_MATCH;
|
|
522
518
|
};
|
|
523
519
|
var matchesBasename = (body) => {
|
|
524
520
|
const index = body.indexOf(SLASH);
|
|
@@ -546,8 +542,8 @@ var require_ignore = __commonJS({
|
|
|
546
542
|
return cut < 0 ? EMPTY : path2.slice(0, cut + 1);
|
|
547
543
|
};
|
|
548
544
|
var isString = (subject) => typeof subject === "string";
|
|
549
|
-
var checkPattern = (pattern) => pattern && isString(pattern)
|
|
550
|
-
var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF).filter(Boolean);
|
|
545
|
+
var checkPattern = (pattern) => pattern && isString(pattern);
|
|
546
|
+
var splitPattern = (pattern) => (pattern[pattern.length - 1] === "\r" ? pattern.slice(0, -1) : pattern).split(REGEX_SPLITALL_CRLF).filter(Boolean);
|
|
551
547
|
var IgnoreRule = class {
|
|
552
548
|
constructor(pattern, mark, body, ignoreCase, negative, prefix) {
|
|
553
549
|
this.pattern = pattern;
|
|
@@ -587,30 +583,40 @@ var require_ignore = __commonJS({
|
|
|
587
583
|
return define(this, key, regex);
|
|
588
584
|
}
|
|
589
585
|
};
|
|
590
|
-
var
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
end--;
|
|
586
|
+
var hasTrailingBackslash = (str) => {
|
|
587
|
+
let count = 0;
|
|
588
|
+
while (str[str.length - count - 1] === ESCAPE) {
|
|
589
|
+
count++;
|
|
595
590
|
}
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
591
|
+
return count % 2 === 1;
|
|
592
|
+
};
|
|
593
|
+
var trimEnd = (body, stripLineEnd) => {
|
|
594
|
+
let lineEnd = body.length;
|
|
595
|
+
let end;
|
|
596
|
+
for (; ; ) {
|
|
597
|
+
if (stripLineEnd && body[lineEnd - 1] === "\r") {
|
|
598
|
+
lineEnd--;
|
|
599
|
+
}
|
|
600
|
+
end = lineEnd;
|
|
601
|
+
while (body[end - 1] === SPACE) {
|
|
602
|
+
end--;
|
|
603
|
+
}
|
|
604
|
+
if (!stripLineEnd || body[end - 1] !== "\n") {
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
lineEnd = end - 1;
|
|
599
608
|
}
|
|
600
609
|
if (end === lineEnd) {
|
|
601
|
-
return body.slice(0,
|
|
610
|
+
return body.slice(0, lineEnd);
|
|
602
611
|
}
|
|
603
612
|
let backslashes = 0;
|
|
604
|
-
while (
|
|
613
|
+
while (body[end - backslashes - 1] === ESCAPE) {
|
|
605
614
|
backslashes++;
|
|
606
615
|
}
|
|
607
616
|
return backslashes % 2 ? body.slice(0, end - 1) + SPACE : body.slice(0, end);
|
|
608
617
|
};
|
|
609
|
-
var createRule = ({
|
|
610
|
-
pattern
|
|
611
|
-
mark
|
|
612
|
-
}, ignoreCase) => {
|
|
613
|
-
let body = pattern[0] === BOM ? pattern.slice(1) : pattern;
|
|
618
|
+
var createRule = (pattern, mark, ignoreCase, stripLineEnd, stripBOM) => {
|
|
619
|
+
let body = stripBOM && pattern[0] === BOM ? pattern.slice(1) : pattern;
|
|
614
620
|
if (body[0] === "#") {
|
|
615
621
|
return;
|
|
616
622
|
}
|
|
@@ -620,10 +626,10 @@ var require_ignore = __commonJS({
|
|
|
620
626
|
body = body.slice(1);
|
|
621
627
|
}
|
|
622
628
|
const last = body[body.length - 1];
|
|
623
|
-
if (last === SPACE || last === "\r" || last === "\n") {
|
|
624
|
-
body = trimEnd(body);
|
|
629
|
+
if (last === SPACE || stripLineEnd && (last === "\r" || last === "\n")) {
|
|
630
|
+
body = trimEnd(body, stripLineEnd);
|
|
625
631
|
}
|
|
626
|
-
if (!body) {
|
|
632
|
+
if (!body || hasTrailingBackslash(body)) {
|
|
627
633
|
return;
|
|
628
634
|
}
|
|
629
635
|
body = body.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
|
|
@@ -643,19 +649,22 @@ var require_ignore = __commonJS({
|
|
|
643
649
|
this._rules = [];
|
|
644
650
|
this._basenameCount = 0;
|
|
645
651
|
}
|
|
646
|
-
_add(pattern) {
|
|
652
|
+
_add(pattern, index) {
|
|
647
653
|
if (pattern && pattern[KEY_IGNORE]) {
|
|
648
654
|
this._rules = this._rules.concat(pattern._rules._rules);
|
|
649
655
|
this._basenameCount += pattern._rules._basenameCount;
|
|
650
656
|
this._added = true;
|
|
651
657
|
return;
|
|
652
658
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
+
const isStr = isString(pattern);
|
|
660
|
+
const raw = isStr ? pattern : pattern.pattern;
|
|
661
|
+
const rule = checkPattern(raw) && createRule(
|
|
662
|
+
raw,
|
|
663
|
+
isStr ? UNDEFINED : pattern.mark,
|
|
664
|
+
this._ignoreCase,
|
|
665
|
+
!this._split,
|
|
666
|
+
this._stripBOM && !index
|
|
667
|
+
);
|
|
659
668
|
if (rule) {
|
|
660
669
|
this._added = true;
|
|
661
670
|
this._rules.push(rule);
|
|
@@ -667,8 +676,10 @@ var require_ignore = __commonJS({
|
|
|
667
676
|
// @param {Array<string> | string | Ignore} pattern
|
|
668
677
|
add(pattern) {
|
|
669
678
|
this._added = false;
|
|
679
|
+
this._split = isString(pattern);
|
|
680
|
+
this._stripBOM = !this._split || pattern[0] === BOM;
|
|
670
681
|
makeArray(
|
|
671
|
-
|
|
682
|
+
this._split ? splitPattern(pattern) : pattern
|
|
672
683
|
).forEach(this._add, this);
|
|
673
684
|
if (this._added) {
|
|
674
685
|
this._literalRules = UNDEFINED;
|
|
@@ -778,6 +789,7 @@ var require_ignore = __commonJS({
|
|
|
778
789
|
};
|
|
779
790
|
checkPath.isNotRelative = isNotRelative;
|
|
780
791
|
checkPath.convert = (p) => p;
|
|
792
|
+
var convertPath = (target) => isString(target) && checkPath.convert(target);
|
|
781
793
|
var Ignore = class {
|
|
782
794
|
constructor({
|
|
783
795
|
ignorecase = true,
|
|
@@ -804,18 +816,21 @@ var require_ignore = __commonJS({
|
|
|
804
816
|
return this.add(pattern);
|
|
805
817
|
}
|
|
806
818
|
// @returns {TestResult}
|
|
807
|
-
_test(originalPath, cache) {
|
|
808
|
-
const path2 = originalPath && checkPath.convert(originalPath);
|
|
819
|
+
_test(originalPath, cache, path2) {
|
|
809
820
|
checkPath(
|
|
810
821
|
path2,
|
|
811
822
|
originalPath,
|
|
812
823
|
this._strictPathCheck ? throwError : RETURN_FALSE
|
|
813
824
|
);
|
|
814
|
-
return this._t(path2, cache)
|
|
825
|
+
return path2 ? this._t(path2, cache) : {
|
|
826
|
+
ignored: false,
|
|
827
|
+
unignored: false
|
|
828
|
+
};
|
|
815
829
|
}
|
|
816
|
-
checkIgnore(
|
|
817
|
-
|
|
818
|
-
|
|
830
|
+
checkIgnore(target) {
|
|
831
|
+
const path2 = convertPath(target);
|
|
832
|
+
if (!path2 || path2.charCodeAt(path2.length - 1) !== SLASH_CODE) {
|
|
833
|
+
return this._test(target, this._testCache, path2);
|
|
819
834
|
}
|
|
820
835
|
const dir = this._t(path2, this._testCache);
|
|
821
836
|
if (dir.ignored) {
|
|
@@ -833,7 +848,7 @@ var require_ignore = __commonJS({
|
|
|
833
848
|
return cache[path2] = parent && parent.ignored ? parent : this._rules.test(path2, MODE_IGNORE);
|
|
834
849
|
}
|
|
835
850
|
ignores(path2) {
|
|
836
|
-
return this._test(path2, this._ignoreCache).ignored;
|
|
851
|
+
return this._test(path2, this._ignoreCache, convertPath(path2)).ignored;
|
|
837
852
|
}
|
|
838
853
|
createFilter() {
|
|
839
854
|
return (path2) => !this.ignores(path2);
|
|
@@ -843,11 +858,11 @@ var require_ignore = __commonJS({
|
|
|
843
858
|
}
|
|
844
859
|
// @returns {TestResult}
|
|
845
860
|
test(path2) {
|
|
846
|
-
return this._test(path2, this._testCache);
|
|
861
|
+
return this._test(path2, this._testCache, convertPath(path2));
|
|
847
862
|
}
|
|
848
863
|
};
|
|
849
864
|
var factory = (options) => new Ignore(options);
|
|
850
|
-
var isPathValid = (path2) => checkPath(
|
|
865
|
+
var isPathValid = (path2) => checkPath(convertPath(path2), path2, RETURN_FALSE);
|
|
851
866
|
var setupWindows = () => {
|
|
852
867
|
const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
|
|
853
868
|
checkPath.convert = makePosix;
|
|
@@ -895,7 +910,7 @@ var HARD_EXCLUDES = [
|
|
|
895
910
|
"coverage",
|
|
896
911
|
".DS_Store",
|
|
897
912
|
"*.log",
|
|
898
|
-
// secrets
|
|
913
|
+
// WARNING: secrets below must never ship in an archive.
|
|
899
914
|
".env",
|
|
900
915
|
".env.*",
|
|
901
916
|
"*.pem",
|
|
@@ -908,7 +923,6 @@ var HARD_EXCLUDES = [
|
|
|
908
923
|
"id_ed25519",
|
|
909
924
|
".npmrc",
|
|
910
925
|
".git-credentials",
|
|
911
|
-
// archives (avoid bundling our own output)
|
|
912
926
|
"*.tgz",
|
|
913
927
|
"*.tar.gz"
|
|
914
928
|
];
|
|
@@ -948,19 +962,22 @@ var collectFiles = (root, ignored) => {
|
|
|
948
962
|
walk(root);
|
|
949
963
|
return out.toSorted();
|
|
950
964
|
};
|
|
965
|
+
var packageVersion = (manifest) => {
|
|
966
|
+
try {
|
|
967
|
+
const pkg = parseJson(readFileSync(manifest, "utf-8"));
|
|
968
|
+
const v = isJsonObject(pkg) ? pkg.version : void 0;
|
|
969
|
+
return isJsonString(v) ? v : null;
|
|
970
|
+
} catch {
|
|
971
|
+
return null;
|
|
972
|
+
}
|
|
973
|
+
};
|
|
951
974
|
var installedVersion = (root, name) => {
|
|
952
975
|
let dir = root;
|
|
953
976
|
while (true) {
|
|
954
977
|
const p = path.join(dir, "node_modules", name, "package.json");
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
const v = isJsonObject(pkg) ? pkg.version : void 0;
|
|
959
|
-
if (isJsonString(v)) {
|
|
960
|
-
return v;
|
|
961
|
-
}
|
|
962
|
-
} catch {
|
|
963
|
-
}
|
|
978
|
+
const v = existsSync(p) ? packageVersion(p) : null;
|
|
979
|
+
if (v !== null) {
|
|
980
|
+
return v;
|
|
964
981
|
}
|
|
965
982
|
const parent = path.dirname(dir);
|
|
966
983
|
if (parent === dir) {
|
|
@@ -976,7 +993,7 @@ var resolveSpec = (root, name, spec) => {
|
|
|
976
993
|
return range;
|
|
977
994
|
}
|
|
978
995
|
const v2 = installedVersion(root, name);
|
|
979
|
-
if (
|
|
996
|
+
if (v2 === null || v2 === "") {
|
|
980
997
|
return null;
|
|
981
998
|
}
|
|
982
999
|
if (range === "~") {
|
|
@@ -988,13 +1005,13 @@ var resolveSpec = (root, name, spec) => {
|
|
|
988
1005
|
return `^${v2}`;
|
|
989
1006
|
}
|
|
990
1007
|
const v = installedVersion(root, name);
|
|
991
|
-
return v ? `^${v}` : null;
|
|
1008
|
+
return v !== null && v !== "" ? `^${v}` : null;
|
|
992
1009
|
};
|
|
993
1010
|
var DEP_FIELDS = ["dependencies", "devDependencies", "peerDependencies", "optionalDependencies"];
|
|
994
1011
|
var rewriteWorkspaceProtocols = (root) => {
|
|
995
1012
|
let pkg;
|
|
996
1013
|
try {
|
|
997
|
-
pkg =
|
|
1014
|
+
pkg = parseJson(readFileSync(path.join(root, "package.json"), "utf-8"));
|
|
998
1015
|
} catch {
|
|
999
1016
|
return null;
|
|
1000
1017
|
}
|
|
@@ -1015,7 +1032,7 @@ var rewriteWorkspaceProtocols = (root) => {
|
|
|
1015
1032
|
continue;
|
|
1016
1033
|
}
|
|
1017
1034
|
const resolved = resolveSpec(root, name, spec);
|
|
1018
|
-
if (resolved && resolved !== spec) {
|
|
1035
|
+
if (resolved !== null && resolved !== "" && resolved !== spec) {
|
|
1019
1036
|
deps[name] = resolved;
|
|
1020
1037
|
changed = true;
|
|
1021
1038
|
}
|
|
@@ -1034,7 +1051,7 @@ var packSource = async (root, tmpDir) => {
|
|
|
1034
1051
|
const rewritten = files.includes("package.json") ? rewriteWorkspaceProtocols(root) : null;
|
|
1035
1052
|
let cwd = root;
|
|
1036
1053
|
let stage = null;
|
|
1037
|
-
if (rewritten) {
|
|
1054
|
+
if (rewritten !== null && rewritten !== "") {
|
|
1038
1055
|
stage = mkdtempSync(path.join(tmpDir, "stage-"));
|
|
1039
1056
|
for (const f of files) {
|
|
1040
1057
|
const dest = path.join(stage, f);
|
|
@@ -1048,7 +1065,7 @@ var packSource = async (root, tmpDir) => {
|
|
|
1048
1065
|
try {
|
|
1049
1066
|
await Qn({ cwd, file: tarball, gzip: true, portable: true }, files);
|
|
1050
1067
|
} finally {
|
|
1051
|
-
if (stage) {
|
|
1068
|
+
if (stage !== null && stage !== "") {
|
|
1052
1069
|
rmSync(stage, { force: true, recursive: true });
|
|
1053
1070
|
}
|
|
1054
1071
|
}
|
|
@@ -8,18 +8,19 @@ import {
|
|
|
8
8
|
OAuthError,
|
|
9
9
|
pollDeviceToken,
|
|
10
10
|
requestDeviceCode
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-E3FJUPLT.js";
|
|
12
12
|
import {
|
|
13
13
|
getBaseUrl,
|
|
14
14
|
saveConfig
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
consola
|
|
18
|
-
} from "./chunk-D2RF35HJ.js";
|
|
19
|
-
import "./chunk-J6PKNPI2.js";
|
|
15
|
+
} from "./chunk-Q5NZNXJE.js";
|
|
20
16
|
import {
|
|
21
17
|
defineCommand
|
|
22
18
|
} from "./chunk-MBXCVCC4.js";
|
|
19
|
+
import {
|
|
20
|
+
consola
|
|
21
|
+
} from "./chunk-D2RF35HJ.js";
|
|
22
|
+
import "./chunk-RPSUFZAG.js";
|
|
23
|
+
import "./chunk-2SBBKY5C.js";
|
|
23
24
|
import "./chunk-GKDUYJ7R.js";
|
|
24
25
|
|
|
25
26
|
// src/commands/login.ts
|
|
@@ -43,6 +44,7 @@ var openBrowser = (url, baseUrl) => {
|
|
|
43
44
|
const [cmd, args] = openers[process.platform] ?? ["xdg-open", [target.href]];
|
|
44
45
|
const child = spawn(cmd, args, { detached: true, stdio: "ignore" });
|
|
45
46
|
child.on("error", () => {
|
|
47
|
+
consola.debug("could not open a browser");
|
|
46
48
|
});
|
|
47
49
|
child.unref();
|
|
48
50
|
};
|
|
@@ -64,28 +66,35 @@ var loginCommand = defineCommand({
|
|
|
64
66
|
);
|
|
65
67
|
openBrowser(device.verificationUriComplete, baseUrl);
|
|
66
68
|
consola.start("Waiting for approval...");
|
|
67
|
-
let intervalMs = device.interval * 1e3;
|
|
68
69
|
const deadline = Date.now() + device.expiresIn * 1e3;
|
|
69
|
-
|
|
70
|
+
const poll = async (intervalMs) => {
|
|
71
|
+
if (Date.now() >= deadline) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
70
74
|
await sleep(intervalMs);
|
|
71
75
|
try {
|
|
72
76
|
saveConfig(await pollDeviceToken(baseUrl, device.deviceCode));
|
|
73
77
|
consola.success("Logged in successfully");
|
|
74
|
-
return;
|
|
78
|
+
return true;
|
|
75
79
|
} catch (error) {
|
|
76
80
|
if (!(error instanceof OAuthError)) {
|
|
77
81
|
throw error;
|
|
78
82
|
}
|
|
79
83
|
if (error.code === "slow_down") {
|
|
80
|
-
intervalMs
|
|
81
|
-
}
|
|
84
|
+
return await poll(intervalMs + SLOW_DOWN_STEP_MS);
|
|
85
|
+
}
|
|
86
|
+
if (error.code === "access_denied") {
|
|
82
87
|
fail("Login was denied in the browser.");
|
|
83
88
|
} else if (error.code === "expired_token") {
|
|
84
89
|
fail("Code expired. Run `vg login` to try again.");
|
|
85
90
|
} else if (error.code !== "authorization_pending") {
|
|
86
91
|
throw error;
|
|
87
92
|
}
|
|
93
|
+
return await poll(intervalMs);
|
|
88
94
|
}
|
|
95
|
+
};
|
|
96
|
+
if (await poll(device.interval * 1e3)) {
|
|
97
|
+
return;
|
|
89
98
|
}
|
|
90
99
|
fail("Timed out waiting for approval. Run `vg login` to try again.");
|
|
91
100
|
}
|