@shopify/create-app 3.86.0 → 3.87.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 +2 -1
- package/dist/{chunk-24C6AXHU.js → chunk-HBFPX5N4.js} +77 -206
- package/dist/{chunk-TO2X4F7Z.js → chunk-HLOOBB4I.js} +17 -5
- package/dist/chunk-MWXQRYBK.js +80 -0
- package/dist/{chunk-VCNJSI7V.js → chunk-PDSOKLSC.js} +46 -21
- package/dist/{chunk-MGT4QKYB.js → chunk-TIUOQMGA.js} +4 -4
- package/dist/{chunk-JVOC6QPM.js → chunk-UOEBXUPG.js} +5 -5
- package/dist/{chunk-JXJ33RQ2.js → chunk-V7OWCSFT.js} +4 -4
- package/dist/{chunk-KUW6F33L.js → chunk-VLJHCQXA.js} +5 -5
- package/dist/{chunk-Y7KLALIY.js → chunk-VR5VKR2I.js} +6 -6
- package/dist/{custom-oclif-loader-P2GF3H55.js → custom-oclif-loader-TBJQ73OQ.js} +15 -9
- package/dist/{del-M36IQP37.js → del-OKZSX2EU.js} +2 -2
- package/dist/{error-handler-A4ESBROE.js → error-handler-OMN5NZFN.js} +9 -7
- package/dist/hooks/postrun.js +9 -68
- package/dist/hooks/prerun.js +7 -5
- package/dist/{http-proxy-node16-K5X7BUK5.js → http-proxy-node16-VGGP6PLA.js} +5 -5
- package/dist/index.js +1090 -784
- package/dist/index.test.js +1 -1
- package/dist/{lib-JIKIO4JO.js → lib-IF6LVQLE.js} +2 -2
- package/dist/{local-NJYNKPHZ.js → local-XH6K2UZK.js} +5 -3
- package/dist/{magic-string.es-UZAAPNRE.js → magic-string.es-S5HKFBJX.js} +5 -6
- package/dist/{node-package-manager-DIXFSXME.js → node-package-manager-5EX7KILU.js} +6 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-TJJFYS6Z.js → ui-ROZ5MAUS.js} +5 -3
- package/oclif.manifest.json +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
errorHandler,
|
|
9
9
|
registerCleanBugsnagErrorsFromWithinPlugins,
|
|
10
10
|
require_end_of_stream
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-VR5VKR2I.js";
|
|
12
|
+
import {
|
|
13
|
+
postRunHookHasCompleted
|
|
14
|
+
} from "./chunk-MWXQRYBK.js";
|
|
12
15
|
import {
|
|
13
16
|
compileData,
|
|
14
17
|
fanoutHooks,
|
|
@@ -17,11 +20,11 @@ import {
|
|
|
17
20
|
recordEvent,
|
|
18
21
|
recordTiming,
|
|
19
22
|
reportAnalyticsEvent
|
|
20
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UOEBXUPG.js";
|
|
21
24
|
import {
|
|
22
25
|
setCurrentCommandId,
|
|
23
26
|
showNotificationsIfNeeded
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VLJHCQXA.js";
|
|
25
28
|
import {
|
|
26
29
|
CLI_KIT_VERSION,
|
|
27
30
|
ClientError,
|
|
@@ -60,6 +63,7 @@ import {
|
|
|
60
63
|
graphqlRequestDoc,
|
|
61
64
|
hashString,
|
|
62
65
|
isEmpty,
|
|
66
|
+
isNetworkError,
|
|
63
67
|
isServiceAccount,
|
|
64
68
|
isThemeAccessSession,
|
|
65
69
|
isUserAccount,
|
|
@@ -91,7 +95,7 @@ import {
|
|
|
91
95
|
setPathValue,
|
|
92
96
|
shopifyFetch,
|
|
93
97
|
z
|
|
94
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-PDSOKLSC.js";
|
|
95
99
|
import "./chunk-XD3LXUGW.js";
|
|
96
100
|
import {
|
|
97
101
|
LocalStorage,
|
|
@@ -101,7 +105,6 @@ import {
|
|
|
101
105
|
findUpAndReadPackageJson,
|
|
102
106
|
getDependencies,
|
|
103
107
|
getPackageManager,
|
|
104
|
-
getPackageName,
|
|
105
108
|
getPackageVersion,
|
|
106
109
|
inferPackageManager,
|
|
107
110
|
installNPMDependenciesRecursively,
|
|
@@ -114,7 +117,7 @@ import {
|
|
|
114
117
|
usesWorkspaces,
|
|
115
118
|
versionSatisfies,
|
|
116
119
|
writePackageJSON
|
|
117
|
-
} from "./chunk-
|
|
120
|
+
} from "./chunk-HLOOBB4I.js";
|
|
118
121
|
import {
|
|
119
122
|
AbortController as AbortController2,
|
|
120
123
|
AbortError,
|
|
@@ -168,6 +171,7 @@ import {
|
|
|
168
171
|
getThemeKitAccessDomain,
|
|
169
172
|
gitpodURL,
|
|
170
173
|
glob,
|
|
174
|
+
globSync,
|
|
171
175
|
globalCLIVersion,
|
|
172
176
|
handleCtrlC,
|
|
173
177
|
hasGit,
|
|
@@ -180,6 +184,7 @@ import {
|
|
|
180
184
|
isCI,
|
|
181
185
|
isDevelopment,
|
|
182
186
|
isDirectory,
|
|
187
|
+
isDirectorySync,
|
|
183
188
|
isPreReleaseVersion,
|
|
184
189
|
isShopify,
|
|
185
190
|
isTTY,
|
|
@@ -277,12 +282,13 @@ import {
|
|
|
277
282
|
username,
|
|
278
283
|
writeFile,
|
|
279
284
|
writeFileSync
|
|
280
|
-
} from "./chunk-
|
|
285
|
+
} from "./chunk-HBFPX5N4.js";
|
|
281
286
|
import {
|
|
287
|
+
require_brace_expansion,
|
|
282
288
|
require_commonjs,
|
|
283
289
|
require_lib as require_lib2,
|
|
284
290
|
require_typescript
|
|
285
|
-
} from "./chunk-
|
|
291
|
+
} from "./chunk-V7OWCSFT.js";
|
|
286
292
|
import {
|
|
287
293
|
require_ms,
|
|
288
294
|
require_src
|
|
@@ -292,7 +298,6 @@ import {
|
|
|
292
298
|
cwd,
|
|
293
299
|
dirname,
|
|
294
300
|
extname,
|
|
295
|
-
isSubpath,
|
|
296
301
|
joinPath,
|
|
297
302
|
moduleDirectory,
|
|
298
303
|
normalizePath,
|
|
@@ -306,16 +311,16 @@ import {
|
|
|
306
311
|
require_glob,
|
|
307
312
|
require_inflight,
|
|
308
313
|
require_inherits
|
|
309
|
-
} from "./chunk-
|
|
314
|
+
} from "./chunk-TIUOQMGA.js";
|
|
310
315
|
import {
|
|
311
316
|
require_once
|
|
312
317
|
} from "./chunk-SHWOPMLQ.js";
|
|
313
318
|
import {
|
|
314
319
|
require_graceful_fs
|
|
315
320
|
} from "./chunk-6ONJEX7Y.js";
|
|
316
|
-
import
|
|
317
|
-
|
|
318
|
-
|
|
321
|
+
import "./chunk-LABBARNJ.js";
|
|
322
|
+
import "./chunk-CTFDRWUN.js";
|
|
323
|
+
import "./chunk-7IK72W75.js";
|
|
319
324
|
import "./chunk-G2ZZKGSV.js";
|
|
320
325
|
import {
|
|
321
326
|
__commonJS,
|
|
@@ -1813,13 +1818,13 @@ var require_json = __commonJS({
|
|
|
1813
1818
|
}
|
|
1814
1819
|
exports2.nodeAtPath = nodeAtPath;
|
|
1815
1820
|
function getLocStart(node) {
|
|
1816
|
-
var
|
|
1817
|
-
return (_b = (
|
|
1821
|
+
var _a42, _b;
|
|
1822
|
+
return (_b = (_a42 = node.loc) === null || _a42 === void 0 ? void 0 : _a42.start.offset) !== null && _b !== void 0 ? _b : 0;
|
|
1818
1823
|
}
|
|
1819
1824
|
exports2.getLocStart = getLocStart;
|
|
1820
1825
|
function getLocEnd(node) {
|
|
1821
|
-
var
|
|
1822
|
-
return (_b = (
|
|
1826
|
+
var _a42, _b;
|
|
1827
|
+
return (_b = (_a42 = node.loc) === null || _a42 === void 0 ? void 0 : _a42.end.offset) !== null && _b !== void 0 ? _b : 0;
|
|
1823
1828
|
}
|
|
1824
1829
|
exports2.getLocEnd = getLocEnd;
|
|
1825
1830
|
}
|
|
@@ -1898,7 +1903,7 @@ var require_block = __commonJS({
|
|
|
1898
1903
|
exports2.validateBlockFileExistence = exports2.reportWarning = exports2.validateNestedBlocks = exports2.isInvalidDefaultBlock = exports2.isInvalidPresetBlock = exports2.getBlocks = void 0;
|
|
1899
1904
|
var json_1 = require_json(), file_utils_1 = require_file_utils();
|
|
1900
1905
|
function getBlocks(validSchema) {
|
|
1901
|
-
var
|
|
1906
|
+
var _a42, _b;
|
|
1902
1907
|
let rootLevelThemeBlocks = [], rootLevelLocalBlocks = [], presetLevelBlocks = {}, defaultLevelBlocks = [], rootLevelBlocks = validSchema.blocks, presets = validSchema.presets;
|
|
1903
1908
|
function categorizeRootLevelBlocks(block, index) {
|
|
1904
1909
|
if (!block)
|
|
@@ -1935,7 +1940,7 @@ var require_block = __commonJS({
|
|
|
1935
1940
|
}) : typeof preset.blocks == "object" && Object.entries(preset.blocks).forEach(([key, block]) => {
|
|
1936
1941
|
categorizePresetLevelBlocks(block, ["presets", String(presetIndex), "blocks", key], 0);
|
|
1937
1942
|
}));
|
|
1938
|
-
}), "default" in validSchema && ((_b = (
|
|
1943
|
+
}), "default" in validSchema && ((_b = (_a42 = validSchema.default) === null || _a42 === void 0 ? void 0 : _a42.blocks) === null || _b === void 0 || _b.forEach((block, index) => {
|
|
1939
1944
|
categorizeDefaultLevelBlocks(block, index);
|
|
1940
1945
|
})), {
|
|
1941
1946
|
rootLevelThemeBlocks,
|
|
@@ -1969,10 +1974,10 @@ var require_block = __commonJS({
|
|
|
1969
1974
|
"blocks" in nestedBlock && nestedBlock.blocks && validateNestedBlocks(context, nestedBlock, nestedBlock.blocks, nestedPath.slice(0, -1), offset, ast);
|
|
1970
1975
|
}
|
|
1971
1976
|
async function validateNestedBlocks(context, parentNode, nestedBlocks, currentPath, offset, ast) {
|
|
1972
|
-
var
|
|
1977
|
+
var _a42;
|
|
1973
1978
|
if (!nestedBlocks)
|
|
1974
1979
|
return;
|
|
1975
|
-
let parentSchema = await ((
|
|
1980
|
+
let parentSchema = await ((_a42 = context.getBlockSchema) === null || _a42 === void 0 ? void 0 : _a42.call(context, parentNode.type));
|
|
1976
1981
|
if (!parentSchema || parentSchema instanceof Error)
|
|
1977
1982
|
return;
|
|
1978
1983
|
let { validSchema, staticBlockDefs } = parentSchema;
|
|
@@ -2393,9 +2398,9 @@ var DocumentUri, URI, integer, uinteger, Position, Range, Location, LocationLink
|
|
|
2393
2398
|
}
|
|
2394
2399
|
Diagnostic3.create = create;
|
|
2395
2400
|
function is(value) {
|
|
2396
|
-
var
|
|
2401
|
+
var _a42;
|
|
2397
2402
|
let candidate = value;
|
|
2398
|
-
return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((
|
|
2403
|
+
return Is.defined(candidate) && Range.is(candidate.range) && Is.string(candidate.message) && (Is.number(candidate.severity) || Is.undefined(candidate.severity)) && (Is.integer(candidate.code) || Is.string(candidate.code) || Is.undefined(candidate.code)) && (Is.undefined(candidate.codeDescription) || Is.string((_a42 = candidate.codeDescription) === null || _a42 === void 0 ? void 0 : _a42.href)) && (Is.string(candidate.source) || Is.undefined(candidate.source)) && (Is.undefined(candidate.relatedInformation) || Is.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation.is));
|
|
2399
2404
|
}
|
|
2400
2405
|
Diagnostic3.is = is;
|
|
2401
2406
|
})(Diagnostic || (Diagnostic = {}));
|
|
@@ -3273,7 +3278,7 @@ var require_main = __commonJS({
|
|
|
3273
3278
|
t: () => t18
|
|
3274
3279
|
});
|
|
3275
3280
|
module2.exports = __toCommonJS3(main_exports4);
|
|
3276
|
-
var
|
|
3281
|
+
var import_fs84 = __require("fs"), import_promises5 = __require("fs/promises");
|
|
3277
3282
|
async function readFileFromUri(uri) {
|
|
3278
3283
|
if (uri.protocol === "file:")
|
|
3279
3284
|
return await (0, import_promises5.readFile)(uri, "utf8");
|
|
@@ -3298,7 +3303,7 @@ var require_main = __commonJS({
|
|
|
3298
3303
|
throw new Error("Unsupported protocol");
|
|
3299
3304
|
}
|
|
3300
3305
|
function readFileFromFsPath(fsPath) {
|
|
3301
|
-
return (0,
|
|
3306
|
+
return (0, import_fs84.readFileSync)(fsPath, "utf8");
|
|
3302
3307
|
}
|
|
3303
3308
|
var bundle;
|
|
3304
3309
|
function config2(config22) {
|
|
@@ -6981,8 +6986,8 @@ var require_JSONValidator = __commonJS({
|
|
|
6981
6986
|
});
|
|
6982
6987
|
}
|
|
6983
6988
|
async getSchemaForURI(uri) {
|
|
6984
|
-
var
|
|
6985
|
-
let schema = (
|
|
6989
|
+
var _a42;
|
|
6990
|
+
let schema = (_a42 = this.schemas[uri]) === null || _a42 === void 0 ? void 0 : _a42.schema;
|
|
6986
6991
|
return schema || `No schema for '${uri}' found`;
|
|
6987
6992
|
}
|
|
6988
6993
|
};
|
|
@@ -8285,7 +8290,7 @@ NOTE: as of Ohm v16, there is no default action for iteration nodes \u2014 see `
|
|
|
8285
8290
|
));
|
|
8286
8291
|
});
|
|
8287
8292
|
}
|
|
8288
|
-
}, BALLOT_X = "\u2717", CHECK_MARK = "\u2713", DOT_OPERATOR = "\u22C5", RIGHTWARDS_DOUBLE_ARROW = "\u21D2", SYMBOL_FOR_HORIZONTAL_TABULATION = "\u2409", SYMBOL_FOR_LINE_FEED = "\u240A", SYMBOL_FOR_CARRIAGE_RETURN = "\u240D",
|
|
8293
|
+
}, BALLOT_X = "\u2717", CHECK_MARK = "\u2713", DOT_OPERATOR = "\u22C5", RIGHTWARDS_DOUBLE_ARROW = "\u21D2", SYMBOL_FOR_HORIZONTAL_TABULATION = "\u2409", SYMBOL_FOR_LINE_FEED = "\u240A", SYMBOL_FOR_CARRIAGE_RETURN = "\u240D", Flags36 = {
|
|
8289
8294
|
succeeded: 1,
|
|
8290
8295
|
isRootNode: 2,
|
|
8291
8296
|
isImplicitSpaces: 4,
|
|
@@ -8305,7 +8310,7 @@ NOTE: as of Ohm v16, there is no default action for iteration nodes \u2014 see `
|
|
|
8305
8310
|
}
|
|
8306
8311
|
var Trace = class _Trace {
|
|
8307
8312
|
constructor(input, pos1, pos2, expr, succeeded, bindings, optChildren) {
|
|
8308
|
-
this.input = input, this.pos = this.pos1 = pos1, this.pos2 = pos2, this.source = new Interval(input, pos1, pos2), this.expr = expr, this.bindings = bindings, this.children = optChildren || [], this.terminatingLREntry = null, this._flags = succeeded ?
|
|
8313
|
+
this.input = input, this.pos = this.pos1 = pos1, this.pos2 = pos2, this.source = new Interval(input, pos1, pos2), this.expr = expr, this.bindings = bindings, this.children = optChildren || [], this.terminatingLREntry = null, this._flags = succeeded ? Flags36.succeeded : 0;
|
|
8309
8314
|
}
|
|
8310
8315
|
get displayString() {
|
|
8311
8316
|
return this.expr.toDisplayString();
|
|
@@ -8381,8 +8386,8 @@ NOTE: as of Ohm v16, there is no default action for iteration nodes \u2014 see `
|
|
|
8381
8386
|
}
|
|
8382
8387
|
};
|
|
8383
8388
|
Trace.prototype.SKIP = {};
|
|
8384
|
-
Object.keys(
|
|
8385
|
-
let mask =
|
|
8389
|
+
Object.keys(Flags36).forEach((name) => {
|
|
8390
|
+
let mask = Flags36[name];
|
|
8386
8391
|
Object.defineProperty(Trace.prototype, name, {
|
|
8387
8392
|
get() {
|
|
8388
8393
|
return (this._flags & mask) !== 0;
|
|
@@ -11553,7 +11558,7 @@ NOTE: as of Ohm v16, there is no default action for iteration nodes \u2014 see `
|
|
|
11553
11558
|
));
|
|
11554
11559
|
});
|
|
11555
11560
|
}
|
|
11556
|
-
}, BALLOT_X = "\u2717", CHECK_MARK = "\u2713", DOT_OPERATOR = "\u22C5", RIGHTWARDS_DOUBLE_ARROW = "\u21D2", SYMBOL_FOR_HORIZONTAL_TABULATION = "\u2409", SYMBOL_FOR_LINE_FEED = "\u240A", SYMBOL_FOR_CARRIAGE_RETURN = "\u240D",
|
|
11561
|
+
}, BALLOT_X = "\u2717", CHECK_MARK = "\u2713", DOT_OPERATOR = "\u22C5", RIGHTWARDS_DOUBLE_ARROW = "\u21D2", SYMBOL_FOR_HORIZONTAL_TABULATION = "\u2409", SYMBOL_FOR_LINE_FEED = "\u240A", SYMBOL_FOR_CARRIAGE_RETURN = "\u240D", Flags36 = {
|
|
11557
11562
|
succeeded: 1,
|
|
11558
11563
|
isRootNode: 2,
|
|
11559
11564
|
isImplicitSpaces: 4,
|
|
@@ -11573,7 +11578,7 @@ NOTE: as of Ohm v16, there is no default action for iteration nodes \u2014 see `
|
|
|
11573
11578
|
}
|
|
11574
11579
|
var Trace = class _Trace {
|
|
11575
11580
|
constructor(input, pos1, pos2, expr, succeeded, bindings, optChildren) {
|
|
11576
|
-
this.input = input, this.pos = this.pos1 = pos1, this.pos2 = pos2, this.source = new Interval(input, pos1, pos2), this.expr = expr, this.bindings = bindings, this.children = optChildren || [], this.terminatingLREntry = null, this._flags = succeeded ?
|
|
11581
|
+
this.input = input, this.pos = this.pos1 = pos1, this.pos2 = pos2, this.source = new Interval(input, pos1, pos2), this.expr = expr, this.bindings = bindings, this.children = optChildren || [], this.terminatingLREntry = null, this._flags = succeeded ? Flags36.succeeded : 0;
|
|
11577
11582
|
}
|
|
11578
11583
|
get displayString() {
|
|
11579
11584
|
return this.expr.toDisplayString();
|
|
@@ -11649,8 +11654,8 @@ NOTE: as of Ohm v16, there is no default action for iteration nodes \u2014 see `
|
|
|
11649
11654
|
}
|
|
11650
11655
|
};
|
|
11651
11656
|
Trace.prototype.SKIP = {};
|
|
11652
|
-
Object.keys(
|
|
11653
|
-
let mask =
|
|
11657
|
+
Object.keys(Flags36).forEach((name) => {
|
|
11658
|
+
let mask = Flags36[name];
|
|
11654
11659
|
Object.defineProperty(Trace.prototype, name, {
|
|
11655
11660
|
get() {
|
|
11656
11661
|
return (this._flags & mask) !== 0;
|
|
@@ -14908,12 +14913,12 @@ var require_stage_1_cst = __commonJS({
|
|
|
14908
14913
|
whitespaceStart: (tokens) => tokens[0].children[1].sourceString,
|
|
14909
14914
|
whitespaceEnd: (tokens) => tokens[0].children[7].sourceString,
|
|
14910
14915
|
delimiterWhitespaceStart: (tokens) => {
|
|
14911
|
-
var
|
|
14912
|
-
return ((
|
|
14916
|
+
var _a42;
|
|
14917
|
+
return ((_a42 = tokens[2].children[1]) === null || _a42 === void 0 ? void 0 : _a42.sourceString) || "";
|
|
14913
14918
|
},
|
|
14914
14919
|
delimiterWhitespaceEnd: (tokens) => {
|
|
14915
|
-
var
|
|
14916
|
-
return ((
|
|
14920
|
+
var _a42;
|
|
14921
|
+
return ((_a42 = tokens[2].children[7]) === null || _a42 === void 0 ? void 0 : _a42.sourceString) || "";
|
|
14917
14922
|
},
|
|
14918
14923
|
locStart,
|
|
14919
14924
|
locEnd,
|
|
@@ -15721,7 +15726,7 @@ var require_stage_2_ast = __commonJS({
|
|
|
15721
15726
|
this.current.push(node);
|
|
15722
15727
|
}
|
|
15723
15728
|
close(node, nodeType) {
|
|
15724
|
-
var
|
|
15729
|
+
var _a42, _b;
|
|
15725
15730
|
if (isLiquidBranch(this.parent) && (this.parent.blockEndPosition = { start: node.locStart, end: node.locStart }, this.closeParentWith(node)), !this.parent)
|
|
15726
15731
|
throw new errors_1.LiquidHTMLASTParsingError(`Attempting to close ${nodeType} '${getName2(node)}' before it was opened`, this.source, node.locStart, node.locEnd);
|
|
15727
15732
|
if (getName2(this.parent) !== getName2(node) || this.parent.type !== nodeType) {
|
|
@@ -15732,7 +15737,7 @@ var require_stage_2_ast = __commonJS({
|
|
|
15732
15737
|
else
|
|
15733
15738
|
throw new errors_1.LiquidHTMLASTParsingError(`Attempting to close ${nodeType} '${getName2(node)}' before ${this.parent.type} '${getName2(this.parent)}' was closed`, this.source, this.parent.position.start, node.locEnd, getUnclosed(this.parent));
|
|
15734
15739
|
}
|
|
15735
|
-
this.parent.position.end = node.locEnd, this.parent.blockEndPosition = position(node), this.parent.type == types_1.NodeTypes.LiquidTag && node.type == stage_1_cst_1.ConcreteNodeTypes.LiquidTagClose && (this.parent.delimiterWhitespaceStart = (
|
|
15740
|
+
this.parent.position.end = node.locEnd, this.parent.blockEndPosition = position(node), this.parent.type == types_1.NodeTypes.LiquidTag && node.type == stage_1_cst_1.ConcreteNodeTypes.LiquidTagClose && (this.parent.delimiterWhitespaceStart = (_a42 = node.whitespaceStart) !== null && _a42 !== void 0 ? _a42 : "", this.parent.delimiterWhitespaceEnd = (_b = node.whitespaceEnd) !== null && _b !== void 0 ? _b : ""), this.cursor.pop(), this.cursor.pop();
|
|
15736
15741
|
}
|
|
15737
15742
|
// This function performs the following tasks:
|
|
15738
15743
|
// - Tries to find a parent branch to close when pushing a new branch.
|
|
@@ -15788,17 +15793,17 @@ var require_stage_2_ast = __commonJS({
|
|
|
15788
15793
|
}
|
|
15789
15794
|
exports2.getName = getName2;
|
|
15790
15795
|
function cstToAst(cst, options) {
|
|
15791
|
-
var
|
|
15796
|
+
var _a42;
|
|
15792
15797
|
if (cst.length === 0)
|
|
15793
15798
|
return [];
|
|
15794
15799
|
let builder = buildAst(cst, options);
|
|
15795
15800
|
if (!options.allowUnclosedDocumentNode && builder.cursor.length !== 0)
|
|
15796
|
-
throw new errors_1.LiquidHTMLASTParsingError(`Attempting to end parsing before ${(
|
|
15801
|
+
throw new errors_1.LiquidHTMLASTParsingError(`Attempting to end parsing before ${(_a42 = builder.parent) === null || _a42 === void 0 ? void 0 : _a42.type} '${getName2(builder.parent)}' was closed`, builder.source, builder.source.length - 1, builder.source.length, getUnclosed(builder.parent, builder.grandparent));
|
|
15797
15802
|
return builder.ast;
|
|
15798
15803
|
}
|
|
15799
15804
|
exports2.cstToAst = cstToAst;
|
|
15800
15805
|
function buildAst(cst, options) {
|
|
15801
|
-
var
|
|
15806
|
+
var _a42, _b, _c, _d;
|
|
15802
15807
|
let builder = new ASTBuilder(cst[0].source);
|
|
15803
15808
|
for (let i = 0; i < cst.length; i++) {
|
|
15804
15809
|
let node = cst[i];
|
|
@@ -15829,7 +15834,7 @@ var require_stage_2_ast = __commonJS({
|
|
|
15829
15834
|
markup: markup(node.name, node.markup),
|
|
15830
15835
|
name: node.name,
|
|
15831
15836
|
body: toRawMarkup(node, options),
|
|
15832
|
-
whitespaceStart: (
|
|
15837
|
+
whitespaceStart: (_a42 = node.whitespaceStart) !== null && _a42 !== void 0 ? _a42 : "",
|
|
15833
15838
|
whitespaceEnd: (_b = node.whitespaceEnd) !== null && _b !== void 0 ? _b : "",
|
|
15834
15839
|
delimiterWhitespaceStart: (_c = node.delimiterWhitespaceStart) !== null && _c !== void 0 ? _c : "",
|
|
15835
15840
|
delimiterWhitespaceEnd: (_d = node.delimiterWhitespaceEnd) !== null && _d !== void 0 ? _d : "",
|
|
@@ -16012,23 +16017,23 @@ var require_stage_2_ast = __commonJS({
|
|
|
16012
16017
|
return cstToAst(attrList, options);
|
|
16013
16018
|
}
|
|
16014
16019
|
function liquidTagBaseAttributes(node) {
|
|
16015
|
-
var
|
|
16020
|
+
var _a42, _b;
|
|
16016
16021
|
return {
|
|
16017
16022
|
type: types_1.NodeTypes.LiquidTag,
|
|
16018
16023
|
position: position(node),
|
|
16019
|
-
whitespaceStart: (
|
|
16024
|
+
whitespaceStart: (_a42 = node.whitespaceStart) !== null && _a42 !== void 0 ? _a42 : "",
|
|
16020
16025
|
whitespaceEnd: (_b = node.whitespaceEnd) !== null && _b !== void 0 ? _b : "",
|
|
16021
16026
|
blockStartPosition: position(node),
|
|
16022
16027
|
source: node.source
|
|
16023
16028
|
};
|
|
16024
16029
|
}
|
|
16025
16030
|
function liquidBranchBaseAttributes(node) {
|
|
16026
|
-
var
|
|
16031
|
+
var _a42, _b;
|
|
16027
16032
|
return {
|
|
16028
16033
|
type: types_1.NodeTypes.LiquidBranch,
|
|
16029
16034
|
children: [],
|
|
16030
16035
|
position: position(node),
|
|
16031
|
-
whitespaceStart: (
|
|
16036
|
+
whitespaceStart: (_a42 = node.whitespaceStart) !== null && _a42 !== void 0 ? _a42 : "",
|
|
16032
16037
|
whitespaceEnd: (_b = node.whitespaceEnd) !== null && _b !== void 0 ? _b : "",
|
|
16033
16038
|
blockStartPosition: position(node),
|
|
16034
16039
|
blockEndPosition: { start: -1, end: -1 },
|
|
@@ -16168,7 +16173,7 @@ var require_stage_2_ast = __commonJS({
|
|
|
16168
16173
|
}
|
|
16169
16174
|
}
|
|
16170
16175
|
function toNamedLiquidBranchBaseCase(node) {
|
|
16171
|
-
var
|
|
16176
|
+
var _a42, _b;
|
|
16172
16177
|
return {
|
|
16173
16178
|
name: node.name,
|
|
16174
16179
|
type: types_1.NodeTypes.LiquidBranch,
|
|
@@ -16177,7 +16182,7 @@ var require_stage_2_ast = __commonJS({
|
|
|
16177
16182
|
children: [],
|
|
16178
16183
|
blockStartPosition: { start: node.locStart, end: node.locEnd },
|
|
16179
16184
|
blockEndPosition: { start: -1, end: -1 },
|
|
16180
|
-
whitespaceStart: (
|
|
16185
|
+
whitespaceStart: (_a42 = node.whitespaceStart) !== null && _a42 !== void 0 ? _a42 : "",
|
|
16181
16186
|
whitespaceEnd: (_b = node.whitespaceEnd) !== null && _b !== void 0 ? _b : "",
|
|
16182
16187
|
source: node.source
|
|
16183
16188
|
};
|
|
@@ -16260,10 +16265,10 @@ var require_stage_2_ast = __commonJS({
|
|
|
16260
16265
|
}
|
|
16261
16266
|
var liquidToken = /(\{%|\{\{)-?/g;
|
|
16262
16267
|
function toRawMarkupKindFromHtmlNode(node) {
|
|
16263
|
-
var
|
|
16268
|
+
var _a42;
|
|
16264
16269
|
switch (node.name) {
|
|
16265
16270
|
case "script": {
|
|
16266
|
-
let scriptAttr = (
|
|
16271
|
+
let scriptAttr = (_a42 = node.attrList) === null || _a42 === void 0 ? void 0 : _a42.find((attr) => "name" in attr && typeof attr.name != "string" && attr.name.length === 1 && attr.name[0].type === stage_1_cst_1.ConcreteNodeTypes.TextNode && attr.name[0].value === "type");
|
|
16267
16272
|
if (!scriptAttr || !("value" in scriptAttr) || scriptAttr.value.length === 0 || scriptAttr.value[0].type !== stage_1_cst_1.ConcreteNodeTypes.TextNode)
|
|
16268
16273
|
return RawMarkupKinds.javascript;
|
|
16269
16274
|
let type = scriptAttr.value[0].value;
|
|
@@ -16377,11 +16382,11 @@ var require_stage_2_ast = __commonJS({
|
|
|
16377
16382
|
};
|
|
16378
16383
|
}
|
|
16379
16384
|
function toLiquidVariableOutput(node) {
|
|
16380
|
-
var
|
|
16385
|
+
var _a42, _b;
|
|
16381
16386
|
return {
|
|
16382
16387
|
type: types_1.NodeTypes.LiquidVariableOutput,
|
|
16383
16388
|
markup: typeof node.markup == "string" ? node.markup : toLiquidVariable(node.markup),
|
|
16384
|
-
whitespaceStart: (
|
|
16389
|
+
whitespaceStart: (_a42 = node.whitespaceStart) !== null && _a42 !== void 0 ? _a42 : "",
|
|
16385
16390
|
whitespaceEnd: (_b = node.whitespaceEnd) !== null && _b !== void 0 ? _b : "",
|
|
16386
16391
|
position: position(node),
|
|
16387
16392
|
source: node.source
|
|
@@ -16568,11 +16573,11 @@ var require_stage_2_ast = __commonJS({
|
|
|
16568
16573
|
}
|
|
16569
16574
|
exports2.isLiquidHtmlNode = isLiquidHtmlNode;
|
|
16570
16575
|
function getUnclosed(node, parentNode) {
|
|
16571
|
-
var
|
|
16576
|
+
var _a42;
|
|
16572
16577
|
if (node)
|
|
16573
16578
|
return getName2(node) === null && parentNode && (node = parentNode), {
|
|
16574
16579
|
type: node.type,
|
|
16575
|
-
name: (
|
|
16580
|
+
name: (_a42 = getName2(node)) !== null && _a42 !== void 0 ? _a42 : "",
|
|
16576
16581
|
blockStartPosition: "blockStartPosition" in node ? node.blockStartPosition : node.position
|
|
16577
16582
|
};
|
|
16578
16583
|
}
|
|
@@ -16887,8 +16892,8 @@ var require_context_utils = __commonJS({
|
|
|
16887
16892
|
};
|
|
16888
16893
|
}
|
|
16889
16894
|
async function getDefaultLocaleFile(fs4, rootUri, postfix = ".default.json") {
|
|
16890
|
-
var
|
|
16891
|
-
return (
|
|
16895
|
+
var _a42;
|
|
16896
|
+
return (_a42 = (await fs4.readDirectory((0, path_1.join)(rootUri, "locales"))).find(([uri]) => uri.endsWith(postfix))) === null || _a42 === void 0 ? void 0 : _a42[0];
|
|
16892
16897
|
}
|
|
16893
16898
|
async function getDefaultLocale(fs4, rootUri, postfix) {
|
|
16894
16899
|
try {
|
|
@@ -17049,8 +17054,8 @@ var require_visitor = __commonJS({
|
|
|
17049
17054
|
return node.position.end - node.position.start;
|
|
17050
17055
|
}
|
|
17051
17056
|
function isUnclosed(node) {
|
|
17052
|
-
var
|
|
17053
|
-
return "blockEndPosition" in node ? ((
|
|
17057
|
+
var _a42;
|
|
17058
|
+
return "blockEndPosition" in node ? ((_a42 = node.blockEndPosition) === null || _a42 === void 0 ? void 0 : _a42.end) === -1 : "children" in node ? node.children.length > 0 : !1;
|
|
17054
17059
|
}
|
|
17055
17060
|
function findJSONNode(ast, cursorPosition) {
|
|
17056
17061
|
let prev, current = ast, ancestors = [], offset = cursorPosition;
|
|
@@ -17149,8 +17154,8 @@ var require_ignore = __commonJS({
|
|
|
17149
17154
|
}
|
|
17150
17155
|
exports2.isIgnored = isIgnored;
|
|
17151
17156
|
function checkIgnorePatterns(checkDef, config2) {
|
|
17152
|
-
var
|
|
17153
|
-
return checkDef ? asArray2((
|
|
17157
|
+
var _a42;
|
|
17158
|
+
return checkDef ? asArray2((_a42 = config2.settings[checkDef.meta.code]) === null || _a42 === void 0 ? void 0 : _a42.ignore) : [];
|
|
17154
17159
|
}
|
|
17155
17160
|
function asArray2(x) {
|
|
17156
17161
|
return x ?? [];
|
|
@@ -17383,10 +17388,10 @@ var require_asset_preload = __commonJS({
|
|
|
17383
17388
|
create(context) {
|
|
17384
17389
|
return {
|
|
17385
17390
|
async HtmlVoidElement(node) {
|
|
17386
|
-
var
|
|
17391
|
+
var _a42;
|
|
17387
17392
|
let preloadLinkAttr = node.attributes.find((attr) => (0, utils_1.isValuedHtmlAttribute)(attr) && isPreload(attr));
|
|
17388
17393
|
if (node.name === "link" && preloadLinkAttr) {
|
|
17389
|
-
let asAttr = node.attributes.filter(utils_1.isValuedHtmlAttribute).find((attr) => (0, utils_1.isAttr)(attr, "as")), assetType = (
|
|
17394
|
+
let asAttr = node.attributes.filter(utils_1.isValuedHtmlAttribute).find((attr) => (0, utils_1.isAttr)(attr, "as")), assetType = (_a42 = asAttr?.value.find((node2) => (0, utils_1.isNodeOfType)(liquid_html_parser_1.NodeTypes.TextNode, node2))) === null || _a42 === void 0 ? void 0 : _a42.value, message = "";
|
|
17390
17395
|
assetType === "style" ? message = "For better performance, prefer using the preload argument of the stylesheet_tag filter" : assetType === "image" ? message = "For better performance, prefer using the preload argument of the image_tag filter" : message = "For better performance, prefer using the preload_tag filter", context.report({
|
|
17391
17396
|
message,
|
|
17392
17397
|
startIndex: node.position.start,
|
|
@@ -18184,10 +18189,10 @@ var require_parse = __commonJS({
|
|
|
18184
18189
|
}
|
|
18185
18190
|
}
|
|
18186
18191
|
function objectToObjectNode(node) {
|
|
18187
|
-
var
|
|
18192
|
+
var _a42;
|
|
18188
18193
|
return {
|
|
18189
18194
|
type: "Object",
|
|
18190
|
-
children: ((
|
|
18195
|
+
children: ((_a42 = node.children) !== null && _a42 !== void 0 ? _a42 : []).map(jsoncToJsonAst),
|
|
18191
18196
|
loc: (0, exports2.location)(node.offset, node.offset + node.length)
|
|
18192
18197
|
};
|
|
18193
18198
|
}
|
|
@@ -18396,13 +18401,13 @@ var require_to_schema = __commonJS({
|
|
|
18396
18401
|
}
|
|
18397
18402
|
exports2.toAppBlockSchema = toAppBlockSchema;
|
|
18398
18403
|
function toSchemaNode(ast) {
|
|
18399
|
-
var
|
|
18400
|
-
return ast instanceof Error ? ast : (
|
|
18404
|
+
var _a42;
|
|
18405
|
+
return ast instanceof Error ? ast : (_a42 = (0, visitor_1.visit)(ast, {
|
|
18401
18406
|
LiquidRawTag(node) {
|
|
18402
18407
|
if (node.name === "schema")
|
|
18403
18408
|
return node;
|
|
18404
18409
|
}
|
|
18405
|
-
})[0]) !== null &&
|
|
18410
|
+
})[0]) !== null && _a42 !== void 0 ? _a42 : new Error("No schema tag found");
|
|
18406
18411
|
}
|
|
18407
18412
|
function toStaticBlockDefs(ast) {
|
|
18408
18413
|
return ast instanceof Error ? [] : (0, visitor_1.visit)(ast, {
|
|
@@ -18422,11 +18427,11 @@ var require_to_schema = __commonJS({
|
|
|
18422
18427
|
});
|
|
18423
18428
|
}
|
|
18424
18429
|
function getSchema(context) {
|
|
18425
|
-
var
|
|
18430
|
+
var _a42, _b;
|
|
18426
18431
|
let name = path.basename(context.file.uri, ".liquid");
|
|
18427
18432
|
switch (!0) {
|
|
18428
18433
|
case isBlock(context.file.uri):
|
|
18429
|
-
return (
|
|
18434
|
+
return (_a42 = context.getBlockSchema) === null || _a42 === void 0 ? void 0 : _a42.call(context, name);
|
|
18430
18435
|
case isSection(context.file.uri):
|
|
18431
18436
|
return (_b = context.getSectionSchema) === null || _b === void 0 ? void 0 : _b.call(context, name);
|
|
18432
18437
|
default:
|
|
@@ -19859,29 +19864,29 @@ var require_deprecated_fonts_on_sections_and_blocks = __commonJS({
|
|
|
19859
19864
|
});
|
|
19860
19865
|
}
|
|
19861
19866
|
async function checkPresetsForDeprecatedFonts(schema, offset, ast, context) {
|
|
19862
|
-
var
|
|
19867
|
+
var _a42;
|
|
19863
19868
|
let presets = schema.presets;
|
|
19864
19869
|
if (presets)
|
|
19865
19870
|
for (let [preset_index, preset] of presets.entries()) {
|
|
19866
19871
|
let warningAstPath = ["presets", String(preset_index)];
|
|
19867
|
-
await checkSettingsAndBlocksForDeprecatedFonts((
|
|
19872
|
+
await checkSettingsAndBlocksForDeprecatedFonts((_a42 = preset.settings) !== null && _a42 !== void 0 ? _a42 : {}, "blocks" in preset ? preset.blocks : void 0, schema, offset, ast, warningAstPath, context);
|
|
19868
19873
|
}
|
|
19869
19874
|
}
|
|
19870
19875
|
async function checkSettingsAndBlocksForDeprecatedFonts(settings, blocks2, schema, offset, ast, warningAstPath, context) {
|
|
19871
19876
|
settings && typeof settings == "object" && Object.entries(settings).forEach(([settingKey, settingValue]) => {
|
|
19872
|
-
var
|
|
19873
|
-
if (isFontPickerType((
|
|
19877
|
+
var _a42;
|
|
19878
|
+
if (isFontPickerType((_a42 = schema.settings) !== null && _a42 !== void 0 ? _a42 : [], settingKey) && deprecated_fonts_data_1.DEPRECATED_FONT_HANDLES.has(settingValue)) {
|
|
19874
19879
|
let currentPath = warningAstPath.concat(["settings", settingKey]);
|
|
19875
19880
|
reportWarning(context, offset, ast, currentPath, `setting '${settingKey}' is using deprecated font '${settingValue}'`);
|
|
19876
19881
|
}
|
|
19877
19882
|
}), blocks2 && await checkBlocksForDeprecatedFonts(blocks2, schema, offset, ast, context, warningAstPath);
|
|
19878
19883
|
}
|
|
19879
19884
|
async function checkBlocksForDeprecatedFonts(blocks2, schema, offset, ast, context, nodePath) {
|
|
19880
|
-
var
|
|
19885
|
+
var _a42, _b, _c, _d;
|
|
19881
19886
|
let iterator = Array.isArray(blocks2) ? blocks2.entries() : Object.entries(blocks2);
|
|
19882
19887
|
for (let [keyOrIndex, block] of iterator) {
|
|
19883
19888
|
let currentPath = nodePath.concat(["blocks", String(keyOrIndex)]), validSchema = null;
|
|
19884
|
-
if ((
|
|
19889
|
+
if ((_a42 = schema.blocks) === null || _a42 === void 0 || _a42.forEach((schemaBlock) => {
|
|
19885
19890
|
schemaBlock.type === block.type && "name" in schemaBlock && (validSchema = schemaBlock);
|
|
19886
19891
|
}), !validSchema) {
|
|
19887
19892
|
let blockSchema = await ((_b = context.getBlockSchema) === null || _b === void 0 ? void 0 : _b.call(context, block.type));
|
|
@@ -19894,12 +19899,12 @@ var require_deprecated_fonts_on_sections_and_blocks = __commonJS({
|
|
|
19894
19899
|
}
|
|
19895
19900
|
}
|
|
19896
19901
|
async function checkSchemaDefaultForDeprecatedFonts(schema, offset, ast, context) {
|
|
19897
|
-
var
|
|
19902
|
+
var _a42;
|
|
19898
19903
|
let defaultValues = schema.default;
|
|
19899
19904
|
if (!defaultValues || typeof defaultValues != "object")
|
|
19900
19905
|
return;
|
|
19901
19906
|
let warningAstPath = ["default"];
|
|
19902
|
-
await checkSettingsAndBlocksForDeprecatedFonts((
|
|
19907
|
+
await checkSettingsAndBlocksForDeprecatedFonts((_a42 = defaultValues.settings) !== null && _a42 !== void 0 ? _a42 : {}, "blocks" in defaultValues ? defaultValues.blocks : void 0, schema, offset, ast, warningAstPath, context);
|
|
19903
19908
|
}
|
|
19904
19909
|
function isFontPickerType(settings, settingKey) {
|
|
19905
19910
|
return settings.some((setting) => setting.id === settingKey && setting.type === "font_picker");
|
|
@@ -20198,10 +20203,10 @@ var require_arguments = __commonJS({
|
|
|
20198
20203
|
return node.args.length == 1 || arg.position.start == node.args[node.args.length - 1].position.start;
|
|
20199
20204
|
}
|
|
20200
20205
|
function getBlockName(node) {
|
|
20201
|
-
var
|
|
20206
|
+
var _a42;
|
|
20202
20207
|
if (node.contentForType.value !== "block")
|
|
20203
20208
|
return;
|
|
20204
|
-
let contentForTypeArg = (
|
|
20209
|
+
let contentForTypeArg = (_a42 = node.args.find((arg) => arg.name == "type")) === null || _a42 === void 0 ? void 0 : _a42.value;
|
|
20205
20210
|
if (!(!contentForTypeArg || !(0, utils_2.isLiquidString)(contentForTypeArg)))
|
|
20206
20211
|
return contentForTypeArg.value;
|
|
20207
20212
|
}
|
|
@@ -20212,9 +20217,9 @@ var require_arguments = __commonJS({
|
|
|
20212
20217
|
}
|
|
20213
20218
|
exports2.getSnippetName = getSnippetName;
|
|
20214
20219
|
async function getLiquidDocParams(context, relativePath2) {
|
|
20215
|
-
var
|
|
20220
|
+
var _a42;
|
|
20216
20221
|
let docDefinition = context.getDocDefinition && await context.getDocDefinition(relativePath2);
|
|
20217
|
-
if (!((
|
|
20222
|
+
if (!((_a42 = docDefinition?.liquidDoc) === null || _a42 === void 0) && _a42.parameters)
|
|
20218
20223
|
return new Map(docDefinition.liquidDoc.parameters.map((p) => [p.name, p]));
|
|
20219
20224
|
}
|
|
20220
20225
|
exports2.getLiquidDocParams = getLiquidDocParams;
|
|
@@ -20266,12 +20271,12 @@ var require_duplicate_render_snippet_arguments = __commonJS({
|
|
|
20266
20271
|
create(context) {
|
|
20267
20272
|
return {
|
|
20268
20273
|
async RenderMarkup(node) {
|
|
20269
|
-
var
|
|
20274
|
+
var _a42;
|
|
20270
20275
|
let snippetName = (0, arguments_1.getSnippetName)(node);
|
|
20271
20276
|
if (!snippetName)
|
|
20272
20277
|
return;
|
|
20273
20278
|
let encounteredArgNames = /* @__PURE__ */ new Set(), duplicateArgs = [];
|
|
20274
|
-
!((
|
|
20279
|
+
!((_a42 = node.alias) === null || _a42 === void 0) && _a42.value && encounteredArgNames.add(node.alias.value);
|
|
20275
20280
|
for (let param of node.args)
|
|
20276
20281
|
encounteredArgNames.has(param.name) && duplicateArgs.push(param), encounteredArgNames.add(param.name);
|
|
20277
20282
|
(0, arguments_1.reportDuplicateArguments)(context, node, duplicateArgs, snippetName);
|
|
@@ -20524,11 +20529,11 @@ var require_missing_block_utils = __commonJS({
|
|
|
20524
20529
|
return await (0, file_utils_1.doesFileExist)(context, blockPath);
|
|
20525
20530
|
}
|
|
20526
20531
|
async function getThemeBlocks(sectionType, currentPath, context) {
|
|
20527
|
-
var
|
|
20532
|
+
var _a42, _b;
|
|
20528
20533
|
let themeBlocks = [];
|
|
20529
20534
|
if (!sectionType)
|
|
20530
20535
|
return themeBlocks;
|
|
20531
|
-
let schema = isNestedBlock(currentPath) ? await ((
|
|
20536
|
+
let schema = isNestedBlock(currentPath) ? await ((_a42 = context.getBlockSchema) === null || _a42 === void 0 ? void 0 : _a42.call(context, sectionType)) : await ((_b = context.getSectionSchema) === null || _b === void 0 ? void 0 : _b.call(context, sectionType));
|
|
20532
20537
|
if (!schema || schema instanceof Error)
|
|
20533
20538
|
return themeBlocks;
|
|
20534
20539
|
let { validSchema } = schema;
|
|
@@ -20747,9 +20752,9 @@ var require_liquid_free_settings = __commonJS({
|
|
|
20747
20752
|
}
|
|
20748
20753
|
function isInArrayWithParentKey(ancestors, parentKey) {
|
|
20749
20754
|
return ancestors.some((ancestor, index) => {
|
|
20750
|
-
var
|
|
20755
|
+
var _a42;
|
|
20751
20756
|
let parent = ancestors[index - 1];
|
|
20752
|
-
return (ancestor.type === "Array" || ancestor.type === "Object") && parent?.type === "Property" && ((
|
|
20757
|
+
return (ancestor.type === "Array" || ancestor.type === "Object") && parent?.type === "Property" && ((_a42 = parent.key) === null || _a42 === void 0 ? void 0 : _a42.value) === parentKey;
|
|
20753
20758
|
});
|
|
20754
20759
|
}
|
|
20755
20760
|
}
|
|
@@ -20809,7 +20814,7 @@ var require_MultipleAssignValues = __commonJS({
|
|
|
20809
20814
|
exports2.detectMultipleAssignValues = void 0;
|
|
20810
20815
|
var utils_1 = require_utils5();
|
|
20811
20816
|
function detectMultipleAssignValues(node) {
|
|
20812
|
-
var
|
|
20817
|
+
var _a42;
|
|
20813
20818
|
let ASSIGN_MARKUP_REGEX = /([^=]+)(=\s*)([^|]+)(?:\s*\|\s*.*)?$/m;
|
|
20814
20819
|
if (node.name !== "assign")
|
|
20815
20820
|
return;
|
|
@@ -20828,7 +20833,7 @@ var require_MultipleAssignValues = __commonJS({
|
|
|
20828
20833
|
assignmentOperator,
|
|
20829
20834
|
// '"123" something'
|
|
20830
20835
|
assignmentValue
|
|
20831
|
-
] = match2, firstAssignmentValue = (
|
|
20836
|
+
] = match2, firstAssignmentValue = (_a42 = (0, utils_1.getValuesInMarkup)(assignmentValue).at(0)) === null || _a42 === void 0 ? void 0 : _a42.value;
|
|
20832
20837
|
if (!firstAssignmentValue)
|
|
20833
20838
|
return;
|
|
20834
20839
|
let removalIndices = (source, startingIndex) => {
|
|
@@ -20887,7 +20892,7 @@ var require_InvalidEchoValue = __commonJS({
|
|
|
20887
20892
|
exports2.detectInvalidEchoValue = void 0;
|
|
20888
20893
|
var liquid_html_parser_1 = require_dist(), utils_1 = require_utils5();
|
|
20889
20894
|
function detectInvalidEchoValue(node) {
|
|
20890
|
-
var
|
|
20895
|
+
var _a42;
|
|
20891
20896
|
let ECHO_MARKUP_REGEX = /([^|]*)(?:\s*\|\s*.*)?$/m;
|
|
20892
20897
|
if (node.type === liquid_html_parser_1.NodeTypes.LiquidTag && node.name !== "echo")
|
|
20893
20898
|
return;
|
|
@@ -20899,7 +20904,7 @@ var require_InvalidEchoValue = __commonJS({
|
|
|
20899
20904
|
let match2 = markup.match(ECHO_MARKUP_REGEX);
|
|
20900
20905
|
if (!match2)
|
|
20901
20906
|
return;
|
|
20902
|
-
let [, echoValue] = match2, firstEchoValue = (
|
|
20907
|
+
let [, echoValue] = match2, firstEchoValue = (_a42 = (0, utils_1.getValuesInMarkup)(echoValue).at(0)) === null || _a42 === void 0 ? void 0 : _a42.value;
|
|
20903
20908
|
if (!firstEchoValue) {
|
|
20904
20909
|
let startIndex2 = node.source.indexOf(markup, node.position.start), endIndex2 = startIndex2 + markup.length;
|
|
20905
20910
|
return {
|
|
@@ -21004,12 +21009,12 @@ var require_InvalidConditionalNode = __commonJS({
|
|
|
21004
21009
|
return null;
|
|
21005
21010
|
}
|
|
21006
21011
|
function checkLaxParsingIssues(tokens) {
|
|
21007
|
-
var
|
|
21012
|
+
var _a42;
|
|
21008
21013
|
for (let i = 0; i < tokens.length - 1; i++) {
|
|
21009
21014
|
let current = tokens[i], next = tokens[i + 1];
|
|
21010
21015
|
if (current.type === "literal" && !isOperatorToken(next)) {
|
|
21011
21016
|
let remaining = tokens.slice(i + 1);
|
|
21012
|
-
if (!(((
|
|
21017
|
+
if (!(((_a42 = remaining[0]) === null || _a42 === void 0 ? void 0 : _a42.type) === "variable" && remaining.some(isOperatorToken))) {
|
|
21013
21018
|
let ignored = remaining.map((t18) => t18.value).join(" ");
|
|
21014
21019
|
return /&&|\|\|/.test(ignored) ? {
|
|
21015
21020
|
message: `Expression stops at truthy value '${current.value}', and will ignore: '${ignored}'. Use 'and'/'or' instead of '&&'/'||' for multiple conditions`,
|
|
@@ -21128,8 +21133,8 @@ var require_InvalidLoopArguments = __commonJS({
|
|
|
21128
21133
|
}
|
|
21129
21134
|
exports2.detectInvalidLoopArguments = detectInvalidLoopArguments;
|
|
21130
21135
|
function isSupportedTagArgument(tags, tagName, key, positional) {
|
|
21131
|
-
var
|
|
21132
|
-
return ((_b = (
|
|
21136
|
+
var _a42, _b;
|
|
21137
|
+
return ((_b = (_a42 = tags.find((tag) => tag.name === tagName)) === null || _a42 === void 0 ? void 0 : _a42.parameters) === null || _b === void 0 ? void 0 : _b.some((parameter) => parameter.name === key && parameter.positional === positional)) || !1;
|
|
21133
21138
|
}
|
|
21134
21139
|
}
|
|
21135
21140
|
});
|
|
@@ -21186,13 +21191,13 @@ var require_InvalidFilterName = __commonJS({
|
|
|
21186
21191
|
}
|
|
21187
21192
|
exports2.detectInvalidFilterName = detectInvalidFilterName;
|
|
21188
21193
|
async function detectInvalidFilterNameInMarkup(node, markup, filters) {
|
|
21189
|
-
var
|
|
21194
|
+
var _a42;
|
|
21190
21195
|
let knownFilters = filters, trimmedMarkup = markup.trim(), problems = [], filterPattern = /\|\s*([a-zA-Z][a-zA-Z0-9_]*)/g, matches2 = Array.from(trimmedMarkup.matchAll(filterPattern));
|
|
21191
21196
|
for (let match2 of matches2) {
|
|
21192
21197
|
let filterName = match2[1];
|
|
21193
21198
|
if (!knownFilters.some((filter) => filter.name === filterName))
|
|
21194
21199
|
continue;
|
|
21195
|
-
let filterEndIndex = match2.index + match2[0].length, invalidSegment = (
|
|
21200
|
+
let filterEndIndex = match2.index + match2[0].length, invalidSegment = (_a42 = trimmedMarkup.slice(filterEndIndex).match(/^(?!\s*(?::|$|\|\s*[a-zA-Z]|\|\s*\||\s*\|\s*(?:[}%]|$)))([^:|]+?)(?=\s*(?::|$|\|))/)) === null || _a42 === void 0 ? void 0 : _a42[1];
|
|
21196
21201
|
if (!invalidSegment)
|
|
21197
21202
|
continue;
|
|
21198
21203
|
let trailingStartInSource = node.source.indexOf(markup, node.position.start) + filterEndIndex, trailingEndInSource = trailingStartInSource + invalidSegment.length;
|
|
@@ -21297,8 +21302,8 @@ var require_liquid_html_syntax_error = __commonJS({
|
|
|
21297
21302
|
targets: []
|
|
21298
21303
|
},
|
|
21299
21304
|
create(context) {
|
|
21300
|
-
var
|
|
21301
|
-
let ast = context.file.ast, filtersPromise = (
|
|
21305
|
+
var _a42, _b;
|
|
21306
|
+
let ast = context.file.ast, filtersPromise = (_a42 = context.themeDocset) === null || _a42 === void 0 ? void 0 : _a42.filters(), tagsPromise = (_b = context.themeDocset) === null || _b === void 0 ? void 0 : _b.tags();
|
|
21302
21307
|
return (0, utils_1.isError)(ast) ? {
|
|
21303
21308
|
async onCodePathStart(file) {
|
|
21304
21309
|
if (isParsingErrorWithLocation(ast)) {
|
|
@@ -21388,8 +21393,8 @@ var require_matching_translations = __commonJS({
|
|
|
21388
21393
|
if (!isLocaleFile || isDefaultTranslationsFile || ast instanceof Error)
|
|
21389
21394
|
return {};
|
|
21390
21395
|
let hasDefaultTranslations = () => defaultTranslations.size > 0, isTerminalNode = ({ type }) => type === "Literal", isPluralizationNode = (node) => PLURALIZATION_KEYS.has(node.key.value), isShopifyPath = (path) => path.startsWith("shopify."), hasDefaultTranslation = (translationPath) => {
|
|
21391
|
-
var
|
|
21392
|
-
return (
|
|
21396
|
+
var _a42;
|
|
21397
|
+
return (_a42 = defaultTranslations.has(translationPath)) !== null && _a42 !== void 0 ? _a42 : !1;
|
|
21393
21398
|
}, isPluralizationPath = (path) => [...PLURALIZATION_KEYS].some((key) => path.endsWith(key)), jsonPaths = (json) => Object.keys(json).reduce((acc, key) => {
|
|
21394
21399
|
if (typeof json[key] != "object")
|
|
21395
21400
|
return acc.concat(key);
|
|
@@ -21402,13 +21407,13 @@ var require_matching_translations = __commonJS({
|
|
|
21402
21407
|
return i;
|
|
21403
21408
|
return minLength;
|
|
21404
21409
|
}, closestTranslationKey = (translationKey) => {
|
|
21405
|
-
var
|
|
21410
|
+
var _a42;
|
|
21406
21411
|
let translationKeyParts = translationKey.split("."), closestMatch = "", maxCommonParts = 0;
|
|
21407
21412
|
for (let path of nodesByPath.keys()) {
|
|
21408
21413
|
let pathParts = path.split("."), commonParts = countCommonParts(pathParts, translationKeyParts);
|
|
21409
21414
|
commonParts > maxCommonParts && (maxCommonParts = commonParts, closestMatch = path);
|
|
21410
21415
|
}
|
|
21411
|
-
return (
|
|
21416
|
+
return (_a42 = nodesByPath.get(closestMatch)) !== null && _a42 !== void 0 ? _a42 : ast;
|
|
21412
21417
|
};
|
|
21413
21418
|
return {
|
|
21414
21419
|
async onCodePathStart() {
|
|
@@ -21569,8 +21574,8 @@ var require_missing_render_snippet_arguments = __commonJS({
|
|
|
21569
21574
|
if (!liquidDocParameters)
|
|
21570
21575
|
return;
|
|
21571
21576
|
let providedParams = new Map(node.args.map((arg) => [arg.name, arg])), missingRequiredParams = Array.from(liquidDocParameters.values()).filter((p) => {
|
|
21572
|
-
var
|
|
21573
|
-
return p.required && !providedParams.has(p.name) && p.name !== ((
|
|
21577
|
+
var _a42;
|
|
21578
|
+
return p.required && !providedParams.has(p.name) && p.name !== ((_a42 = node.alias) === null || _a42 === void 0 ? void 0 : _a42.value);
|
|
21574
21579
|
});
|
|
21575
21580
|
(0, arguments_1.reportMissingArguments)(context, node, missingRequiredParams, snippetName);
|
|
21576
21581
|
}
|
|
@@ -21760,8 +21765,8 @@ var require_suggestions = __commonJS({
|
|
|
21760
21765
|
var utils_1 = require_utils(), suggestionMessage = (attr) => `Use an HTML script tag with the ${attr} attribute instead`, liquidFilterSuggestion = (attr, node, parentNode, grandParentNode) => ({
|
|
21761
21766
|
message: suggestionMessage(attr),
|
|
21762
21767
|
fix(corrector) {
|
|
21763
|
-
var
|
|
21764
|
-
let url = `{{ ${node.source.slice(parentNode.expression.position.start, (_b = (
|
|
21768
|
+
var _a42, _b;
|
|
21769
|
+
let url = `{{ ${node.source.slice(parentNode.expression.position.start, (_b = (_a42 = (0, utils_1.last)(parentNode.filters, -1)) === null || _a42 === void 0 ? void 0 : _a42.position.end) !== null && _b !== void 0 ? _b : node.position.start)} }}`;
|
|
21765
21770
|
corrector.replace(grandParentNode.position.start, grandParentNode.position.end, `<script src="${url}" ${attr}></script>`);
|
|
21766
21771
|
}
|
|
21767
21772
|
});
|
|
@@ -21958,10 +21963,10 @@ var require_schema_presets_static_blocks = __commonJS({
|
|
|
21958
21963
|
}
|
|
21959
21964
|
return {
|
|
21960
21965
|
async LiquidTag(node) {
|
|
21961
|
-
var
|
|
21966
|
+
var _a42, _b;
|
|
21962
21967
|
if (node.name !== liquid_html_parser_1.NamedTags.content_for || !(0, markup_1.isContentForBlock)(node.markup))
|
|
21963
21968
|
return;
|
|
21964
|
-
let idValue = (
|
|
21969
|
+
let idValue = (_a42 = node.markup.args.find((arg) => arg.name === "id")) === null || _a42 === void 0 ? void 0 : _a42.value, typeArg = (_b = node.markup.args.find((arg) => arg.name === "type")) === null || _b === void 0 ? void 0 : _b.value;
|
|
21965
21970
|
if (!typeArg || typeArg.type !== liquid_html_parser_1.NodeTypes.String)
|
|
21966
21971
|
return;
|
|
21967
21972
|
let typeValue = typeArg.value;
|
|
@@ -22186,13 +22191,13 @@ var require_required_layout_theme_object = __commonJS({
|
|
|
22186
22191
|
(0, utils_1.isHtmlTag)(node, "head") ? headTag = node : (0, utils_1.isHtmlTag)(node, "body") && (bodyTag = node);
|
|
22187
22192
|
},
|
|
22188
22193
|
async onCodePathEnd() {
|
|
22189
|
-
var
|
|
22194
|
+
var _a42, _b;
|
|
22190
22195
|
for (let requiredObject of requiredObjects)
|
|
22191
22196
|
if (!foundObjects.has(requiredObject)) {
|
|
22192
22197
|
let message = `The required object '{{ ${requiredObject} }}' is missing in layout/theme.liquid`, insertionNode = requiredObject === "content_for_header" ? headTag : bodyTag, fixInsertPosition = insertionNode?.blockEndPosition.start;
|
|
22193
22198
|
context.report({
|
|
22194
22199
|
message,
|
|
22195
|
-
startIndex: (
|
|
22200
|
+
startIndex: (_a42 = insertionNode?.position.start) !== null && _a42 !== void 0 ? _a42 : 0,
|
|
22196
22201
|
endIndex: (_b = insertionNode?.position.end) !== null && _b !== void 0 ? _b : 0,
|
|
22197
22202
|
fix: fixInsertPosition !== void 0 ? (corrector) => corrector.insert(fixInsertPosition, `{{ ${requiredObject} }}`) : void 0
|
|
22198
22203
|
});
|
|
@@ -22368,15 +22373,15 @@ var require_translation_key_exists = __commonJS({
|
|
|
22368
22373
|
});
|
|
22369
22374
|
},
|
|
22370
22375
|
async LiquidRawTag(node) {
|
|
22371
|
-
var
|
|
22376
|
+
var _a42;
|
|
22372
22377
|
if (node.name !== "schema" || node.body.kind !== "json")
|
|
22373
22378
|
return;
|
|
22374
22379
|
let defaultLocale = await context.getDefaultLocale(), schema = (0, json_1.parseJSON)(node.body.value);
|
|
22375
|
-
(0, utils_1.isError)(schema) && schema instanceof SyntaxError || (schemaLocales = (
|
|
22380
|
+
(0, utils_1.isError)(schema) && schema instanceof SyntaxError || (schemaLocales = (_a42 = schema.locales) === null || _a42 === void 0 ? void 0 : _a42[defaultLocale]);
|
|
22376
22381
|
},
|
|
22377
22382
|
async onCodePathEnd() {
|
|
22378
|
-
var
|
|
22379
|
-
let defaultTranslations = await context.getDefaultTranslations(), defaultLocale = await context.getDefaultLocale(), systemTranslations = await ((
|
|
22383
|
+
var _a42;
|
|
22384
|
+
let defaultTranslations = await context.getDefaultTranslations(), defaultLocale = await context.getDefaultLocale(), systemTranslations = await ((_a42 = context.themeDocset) === null || _a42 === void 0 ? void 0 : _a42.systemTranslations()), systemTranslationsKeys = Object.keys(systemTranslations ?? {});
|
|
22380
22385
|
!defaultTranslations && systemTranslationsKeys.length === 0 || nodes.forEach(({ translationKey, startIndex, endIndex }) => {
|
|
22381
22386
|
if (keyExists(translationKey, defaultTranslations) || keyExists(translationKey, schemaLocales) || systemTranslationsKeys.includes(translationKey))
|
|
22382
22387
|
return;
|
|
@@ -22453,10 +22458,10 @@ var require_unclosed_html_element = __commonJS({
|
|
|
22453
22458
|
stacks.identifiers.add(identifier), stacks.close.has(identifier) || stacks.close.set(identifier, []), stacks.close.get(identifier).push(node);
|
|
22454
22459
|
},
|
|
22455
22460
|
async onCodePathEnd() {
|
|
22456
|
-
var
|
|
22461
|
+
var _a42, _b;
|
|
22457
22462
|
for (let [grandparent, stacks] of stacksByGrandparent)
|
|
22458
22463
|
for (let identifier of stacks.identifiers) {
|
|
22459
|
-
let openNodes = (
|
|
22464
|
+
let openNodes = (_a42 = stacks.open.get(identifier)) !== null && _a42 !== void 0 ? _a42 : [], closeNodes = (_b = stacks.close.get(identifier)) !== null && _b !== void 0 ? _b : [], nodes = [].concat(openNodes, closeNodes).sort((a2, b) => a2.position.start - b.position.start), stack = [];
|
|
22460
22465
|
for (let node of nodes)
|
|
22461
22466
|
node.type === liquid_html_parser_1.NodeTypes.HtmlElement ? stack.push(node) : stack.length > 0 && getName2(node) === getName2(stack.at(-1)) && stack.at(-1).type === liquid_html_parser_1.NodeTypes.HtmlElement && node.type === liquid_html_parser_1.NodeTypes.HtmlDanglingMarkerClose ? stack.pop() : stack.push(node);
|
|
22462
22467
|
for (let node of stack)
|
|
@@ -22511,7 +22516,7 @@ var require_unclosed_html_element = __commonJS({
|
|
|
22511
22516
|
return typeof conditions == "string" ? conditions : conditions.map(getConditionIdentifierForMarkup).join(" or ");
|
|
22512
22517
|
}
|
|
22513
22518
|
function getConditionIdentifierForMarkup(condition) {
|
|
22514
|
-
var
|
|
22519
|
+
var _a42;
|
|
22515
22520
|
if (typeof condition == "string")
|
|
22516
22521
|
return condition;
|
|
22517
22522
|
switch (condition.type) {
|
|
@@ -22522,7 +22527,7 @@ var require_unclosed_html_element = __commonJS({
|
|
|
22522
22527
|
case liquid_html_parser_1.NodeTypes.Number:
|
|
22523
22528
|
return condition.value;
|
|
22524
22529
|
case liquid_html_parser_1.NodeTypes.VariableLookup:
|
|
22525
|
-
return `${(
|
|
22530
|
+
return `${(_a42 = condition.name) !== null && _a42 !== void 0 ? _a42 : ""}${condition.lookups.map((expression) => `[${getConditionIdentifierForMarkup(expression)}]`)}`;
|
|
22526
22531
|
case liquid_html_parser_1.NodeTypes.Range:
|
|
22527
22532
|
return `(${getConditionIdentifierForMarkup(condition.start)}..${getConditionIdentifierForMarkup(condition.end)})`;
|
|
22528
22533
|
case liquid_html_parser_1.NodeTypes.Comparison:
|
|
@@ -22573,10 +22578,10 @@ var require_liquidDoc = __commonJS({
|
|
|
22573
22578
|
node.name === "doc" && (hasDocTag = !0);
|
|
22574
22579
|
},
|
|
22575
22580
|
LiquidDocParamNode(node) {
|
|
22576
|
-
var
|
|
22581
|
+
var _a42, _b, _c, _d;
|
|
22577
22582
|
return {
|
|
22578
22583
|
name: node.paramName.value,
|
|
22579
|
-
description: (_b = (
|
|
22584
|
+
description: (_b = (_a42 = node.paramDescription) === null || _a42 === void 0 ? void 0 : _a42.value) !== null && _b !== void 0 ? _b : null,
|
|
22580
22585
|
type: (_d = (_c = node.paramType) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : null,
|
|
22581
22586
|
required: node.required,
|
|
22582
22587
|
nodeType: "param"
|
|
@@ -22665,24 +22670,24 @@ var require_undefined_object = __commonJS({
|
|
|
22665
22670
|
return {};
|
|
22666
22671
|
let themeDocset = context.themeDocset, scopedVariables = /* @__PURE__ */ new Map(), fileScopedVariables = /* @__PURE__ */ new Set(), variables = [];
|
|
22667
22672
|
function indexVariableScope(variableName, scope) {
|
|
22668
|
-
var
|
|
22673
|
+
var _a42;
|
|
22669
22674
|
if (!variableName)
|
|
22670
22675
|
return;
|
|
22671
|
-
let indexedScope = (
|
|
22676
|
+
let indexedScope = (_a42 = scopedVariables.get(variableName)) !== null && _a42 !== void 0 ? _a42 : [];
|
|
22672
22677
|
scopedVariables.set(variableName, indexedScope.concat(scope));
|
|
22673
22678
|
}
|
|
22674
22679
|
return {
|
|
22675
22680
|
async LiquidDocParamNode(node) {
|
|
22676
|
-
var
|
|
22677
|
-
let paramName = (
|
|
22681
|
+
var _a42;
|
|
22682
|
+
let paramName = (_a42 = node.paramName) === null || _a42 === void 0 ? void 0 : _a42.value;
|
|
22678
22683
|
paramName && fileScopedVariables.add(paramName);
|
|
22679
22684
|
},
|
|
22680
22685
|
async LiquidTag(node, ancestors) {
|
|
22681
|
-
var
|
|
22686
|
+
var _a42, _b, _c, _d;
|
|
22682
22687
|
(0, utils_2.isWithinRawTagThatDoesNotParseItsContents)(ancestors) || (isLiquidTagAssign(node) && indexVariableScope(node.markup.name, {
|
|
22683
22688
|
start: node.blockStartPosition.end
|
|
22684
22689
|
}), isLiquidTagCapture(node) && indexVariableScope(node.markup.name, {
|
|
22685
|
-
start: (
|
|
22690
|
+
start: (_a42 = node.blockEndPosition) === null || _a42 === void 0 ? void 0 : _a42.end
|
|
22686
22691
|
}), ["form", "paginate"].includes(node.name) && indexVariableScope(node.name, {
|
|
22687
22692
|
start: node.blockStartPosition.end,
|
|
22688
22693
|
end: (_b = node.blockEndPosition) === null || _b === void 0 ? void 0 : _b.start
|
|
@@ -23600,8 +23605,8 @@ var require_valid_render_snippet_argument_types = __commonJS({
|
|
|
23600
23605
|
},
|
|
23601
23606
|
create(context) {
|
|
23602
23607
|
function findAndReportAliasType(node, liquidDocParameters) {
|
|
23603
|
-
var
|
|
23604
|
-
if (node.alias && (!((
|
|
23608
|
+
var _a42, _b, _c;
|
|
23609
|
+
if (node.alias && (!((_a42 = node.variable) === null || _a42 === void 0) && _a42.name) && node.variable.name.type !== liquid_html_parser_1.NodeTypes.VariableLookup) {
|
|
23605
23610
|
let paramIsDefinedWithType = (_c = (_b = liquidDocParameters.get(node.alias.value)) === null || _b === void 0 ? void 0 : _b.type) === null || _c === void 0 ? void 0 : _c.toLowerCase();
|
|
23606
23611
|
if (paramIsDefinedWithType) {
|
|
23607
23612
|
let providedParamType = (0, utils_1.inferArgumentType)(node.variable.name);
|
|
@@ -23759,7 +23764,7 @@ var require_valid_settings_key = __commonJS({
|
|
|
23759
23764
|
create(context) {
|
|
23760
23765
|
return {
|
|
23761
23766
|
async LiquidRawTag(node) {
|
|
23762
|
-
var
|
|
23767
|
+
var _a42;
|
|
23763
23768
|
if (node.name !== "schema" || node.body.kind !== "json")
|
|
23764
23769
|
return;
|
|
23765
23770
|
let offset = node.blockStartPosition.end, schema = await (0, to_schema_1.getSchema)(context), { validSchema, ast } = schema ?? {};
|
|
@@ -23773,7 +23778,7 @@ var require_valid_settings_key = __commonJS({
|
|
|
23773
23778
|
}
|
|
23774
23779
|
if ((0, to_schema_1.isSectionSchema)(schema) && "default" in validSchema && validSchema.default) {
|
|
23775
23780
|
let settingsNode = (0, json_1.nodeAtPath)(ast, ["default", "settings"]);
|
|
23776
|
-
validateSettingsKey(context, offset, settingsNode, validSchema.settings), (
|
|
23781
|
+
validateSettingsKey(context, offset, settingsNode, validSchema.settings), (_a42 = validSchema.default.blocks) === null || _a42 === void 0 || _a42.forEach((block, i) => {
|
|
23777
23782
|
let settingsNode2 = (0, json_1.nodeAtPath)(ast, ["default", "blocks", i, "settings"]);
|
|
23778
23783
|
validateReferencedBlock(context, offset, settingsNode2, rootLevelLocalBlocks, block);
|
|
23779
23784
|
});
|
|
@@ -23788,7 +23793,7 @@ var require_valid_settings_key = __commonJS({
|
|
|
23788
23793
|
}
|
|
23789
23794
|
};
|
|
23790
23795
|
async function validateReferencedBlock(context, offset, settingsNode, localBlocks, referencedBlock) {
|
|
23791
|
-
var
|
|
23796
|
+
var _a42;
|
|
23792
23797
|
if (localBlocks.length > 0) {
|
|
23793
23798
|
let localBlock = localBlocks.find((localBlock2) => localBlock2.node.type === referencedBlock.type);
|
|
23794
23799
|
if (!localBlock)
|
|
@@ -23796,7 +23801,7 @@ var require_valid_settings_key = __commonJS({
|
|
|
23796
23801
|
let localBlockNode = localBlock.node;
|
|
23797
23802
|
validateSettingsKey(context, offset, settingsNode, localBlockNode.settings);
|
|
23798
23803
|
} else {
|
|
23799
|
-
let blockSchema = await ((
|
|
23804
|
+
let blockSchema = await ((_a42 = context.getBlockSchema) === null || _a42 === void 0 ? void 0 : _a42.call(context, referencedBlock.type)), { validSchema: validBlockSchema } = blockSchema ?? {};
|
|
23800
23805
|
if (!validBlockSchema || validBlockSchema instanceof Error)
|
|
23801
23806
|
return;
|
|
23802
23807
|
validateSettingsKey(context, offset, settingsNode, validBlockSchema.settings, referencedBlock);
|
|
@@ -23971,11 +23976,11 @@ var require_valid_visible_if = __commonJS({
|
|
|
23971
23976
|
create(context) {
|
|
23972
23977
|
return {
|
|
23973
23978
|
async LiquidRawTag(node) {
|
|
23974
|
-
var
|
|
23979
|
+
var _a42;
|
|
23975
23980
|
if (node.name !== "schema" || node.body.kind !== "json")
|
|
23976
23981
|
return;
|
|
23977
23982
|
let schema = await (0, to_schema_1.getSchema)(context), { validSchema, ast } = schema ?? {};
|
|
23978
|
-
if (!validSchema || validSchema instanceof Error || !(!((
|
|
23983
|
+
if (!validSchema || validSchema instanceof Error || !(!((_a42 = validSchema.settings) === null || _a42 === void 0) && _a42.some((setting) => "visible_if" in setting)) || !ast || ast instanceof Error)
|
|
23979
23984
|
return;
|
|
23980
23985
|
let offset = node.blockStartPosition.end, settings = Object.fromEntries((await (0, visible_if_utils_1.getGlobalSettings)(context)).map((s) => [s, !0])), currentFileSettings = Object.fromEntries(validSchema.settings.map((setting) => [setting.id, !0])), vars = { settings };
|
|
23981
23986
|
(0, to_schema_1.isSectionSchema)(schema) ? vars.section = { settings: currentFileSettings } : (0, to_schema_1.isBlockSchema)(schema) && (vars.block = { settings: currentFileSettings });
|
|
@@ -28360,7 +28365,7 @@ var require_dist2 = __commonJS({
|
|
|
28360
28365
|
var defaultErrorHandler = (_error) => {
|
|
28361
28366
|
};
|
|
28362
28367
|
async function check2(theme, config2, injectedDependencies) {
|
|
28363
|
-
var
|
|
28368
|
+
var _a42;
|
|
28364
28369
|
let pipelines = [], offenses = [], { fs: fs4 } = injectedDependencies, { rootUri } = config2, dependencies = {
|
|
28365
28370
|
...injectedDependencies,
|
|
28366
28371
|
mode: config2.context,
|
|
@@ -28370,7 +28375,7 @@ var require_dist2 = __commonJS({
|
|
|
28370
28375
|
getDefaultTranslations: (0, context_utils_1.makeGetDefaultTranslations)(fs4, theme, rootUri),
|
|
28371
28376
|
getDefaultSchemaLocale: (0, context_utils_1.makeGetDefaultSchemaLocale)(fs4, rootUri),
|
|
28372
28377
|
getDefaultSchemaTranslations: (0, context_utils_1.makeGetDefaultSchemaTranslations)(fs4, theme, rootUri),
|
|
28373
|
-
getMetafieldDefinitions: (
|
|
28378
|
+
getMetafieldDefinitions: (_a42 = injectedDependencies.getMetafieldDefinitions) !== null && _a42 !== void 0 ? _a42 : (0, context_utils_1.makeGetMetafieldDefinitions)(fs4)
|
|
28374
28379
|
}, { DisabledChecksVisitor, isDisabled } = (0, disabled_checks_1.createDisabledChecksModule)(), jsonValidator = await JSONValidator_1.JSONValidator.create(dependencies.jsonValidationSet, config2), validateJSON = jsonValidator?.validate;
|
|
28375
28380
|
dependencies.themeDocset && !dependencies.themeDocset.isAugmented && (dependencies.themeDocset = new AugmentedThemeDocset_1.AugmentedThemeDocset(dependencies.themeDocset));
|
|
28376
28381
|
for (let type of Object.values(types_1.SourceCodeType))
|
|
@@ -28411,13 +28416,13 @@ var require_dist2 = __commonJS({
|
|
|
28411
28416
|
toUri: (relativePath2) => path.join(config2.rootUri, ...relativePath2.split("/")),
|
|
28412
28417
|
toRelativePath: (uri) => path.relative(uri, config2.rootUri),
|
|
28413
28418
|
report(problem) {
|
|
28414
|
-
var
|
|
28419
|
+
var _a42;
|
|
28415
28420
|
offenses.push({
|
|
28416
28421
|
type: check3.meta.type,
|
|
28417
28422
|
check: check3.meta.code,
|
|
28418
28423
|
message: problem.message,
|
|
28419
28424
|
uri: file.uri,
|
|
28420
|
-
severity: (
|
|
28425
|
+
severity: (_a42 = checkSettings?.severity) !== null && _a42 !== void 0 ? _a42 : check3.meta.severity,
|
|
28421
28426
|
start: (0, utils_1.getPosition)(file.source, problem.startIndex),
|
|
28422
28427
|
end: (0, utils_1.getPosition)(file.source, problem.endIndex),
|
|
28423
28428
|
fix: problem.fix,
|
|
@@ -28428,10 +28433,10 @@ var require_dist2 = __commonJS({
|
|
|
28428
28433
|
};
|
|
28429
28434
|
}
|
|
28430
28435
|
function createSettings(checkSettings, schema) {
|
|
28431
|
-
var
|
|
28436
|
+
var _a42;
|
|
28432
28437
|
let settings = {};
|
|
28433
28438
|
for (let [key, schemaProp] of Object.entries(schema))
|
|
28434
|
-
settings[key] = (
|
|
28439
|
+
settings[key] = (_a42 = checkSettings?.[key]) !== null && _a42 !== void 0 ? _a42 : schemaProp.defaultValue();
|
|
28435
28440
|
return settings;
|
|
28436
28441
|
}
|
|
28437
28442
|
function checksOfType(type, checks) {
|
|
@@ -28652,8 +28657,8 @@ var require_themeLiquidDocsManager = __commonJS({
|
|
|
28652
28657
|
});
|
|
28653
28658
|
}
|
|
28654
28659
|
async latestRevision() {
|
|
28655
|
-
var
|
|
28656
|
-
return (
|
|
28660
|
+
var _a42;
|
|
28661
|
+
return (_a42 = (await findSuitableResource([loader(() => this.load("latest"), "loadLatestRevision")], JSON.parse, {}, this.log)).revision) !== null && _a42 !== void 0 ? _a42 : "";
|
|
28657
28662
|
}
|
|
28658
28663
|
async loadResource(name) {
|
|
28659
28664
|
return await this.setup(), this.load(name).then((0, utils_1.tap)(() => this.log(`Loaded resource from ${(0, themeLiquidDocsDownloader_1.resourcePath)(name)}`)));
|
|
@@ -28746,103 +28751,6 @@ var require_path2 = __commonJS({
|
|
|
28746
28751
|
}
|
|
28747
28752
|
});
|
|
28748
28753
|
|
|
28749
|
-
// ../../node_modules/.pnpm/brace-expansion@2.0.2/node_modules/brace-expansion/index.js
|
|
28750
|
-
var require_brace_expansion = __commonJS({
|
|
28751
|
-
"../../node_modules/.pnpm/brace-expansion@2.0.2/node_modules/brace-expansion/index.js"(exports2, module2) {
|
|
28752
|
-
init_cjs_shims();
|
|
28753
|
-
var balanced = require_balanced_match();
|
|
28754
|
-
module2.exports = expandTop;
|
|
28755
|
-
var escSlash = "\0SLASH" + Math.random() + "\0", escOpen = "\0OPEN" + Math.random() + "\0", escClose = "\0CLOSE" + Math.random() + "\0", escComma = "\0COMMA" + Math.random() + "\0", escPeriod = "\0PERIOD" + Math.random() + "\0";
|
|
28756
|
-
function numeric(str) {
|
|
28757
|
-
return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
|
|
28758
|
-
}
|
|
28759
|
-
function escapeBraces(str) {
|
|
28760
|
-
return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
|
|
28761
|
-
}
|
|
28762
|
-
function unescapeBraces(str) {
|
|
28763
|
-
return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
|
|
28764
|
-
}
|
|
28765
|
-
function parseCommaParts(str) {
|
|
28766
|
-
if (!str)
|
|
28767
|
-
return [""];
|
|
28768
|
-
var parts = [], m = balanced("{", "}", str);
|
|
28769
|
-
if (!m)
|
|
28770
|
-
return str.split(",");
|
|
28771
|
-
var pre = m.pre, body = m.body, post = m.post, p = pre.split(",");
|
|
28772
|
-
p[p.length - 1] += "{" + body + "}";
|
|
28773
|
-
var postParts = parseCommaParts(post);
|
|
28774
|
-
return post.length && (p[p.length - 1] += postParts.shift(), p.push.apply(p, postParts)), parts.push.apply(parts, p), parts;
|
|
28775
|
-
}
|
|
28776
|
-
function expandTop(str) {
|
|
28777
|
-
return str ? (str.substr(0, 2) === "{}" && (str = "\\{\\}" + str.substr(2)), expand(escapeBraces(str), !0).map(unescapeBraces)) : [];
|
|
28778
|
-
}
|
|
28779
|
-
function embrace(str) {
|
|
28780
|
-
return "{" + str + "}";
|
|
28781
|
-
}
|
|
28782
|
-
function isPadded(el) {
|
|
28783
|
-
return /^-?0\d/.test(el);
|
|
28784
|
-
}
|
|
28785
|
-
function lte(i, y) {
|
|
28786
|
-
return i <= y;
|
|
28787
|
-
}
|
|
28788
|
-
function gte(i, y) {
|
|
28789
|
-
return i >= y;
|
|
28790
|
-
}
|
|
28791
|
-
function expand(str, isTop) {
|
|
28792
|
-
var expansions = [], m = balanced("{", "}", str);
|
|
28793
|
-
if (!m) return [str];
|
|
28794
|
-
var pre = m.pre, post = m.post.length ? expand(m.post, !1) : [""];
|
|
28795
|
-
if (/\$$/.test(m.pre))
|
|
28796
|
-
for (var k = 0; k < post.length; k++) {
|
|
28797
|
-
var expansion = pre + "{" + m.body + "}" + post[k];
|
|
28798
|
-
expansions.push(expansion);
|
|
28799
|
-
}
|
|
28800
|
-
else {
|
|
28801
|
-
var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body), isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body), isSequence = isNumericSequence || isAlphaSequence, isOptions = m.body.indexOf(",") >= 0;
|
|
28802
|
-
if (!isSequence && !isOptions)
|
|
28803
|
-
return m.post.match(/,(?!,).*\}/) ? (str = m.pre + "{" + m.body + escClose + m.post, expand(str)) : [str];
|
|
28804
|
-
var n;
|
|
28805
|
-
if (isSequence)
|
|
28806
|
-
n = m.body.split(/\.\./);
|
|
28807
|
-
else if (n = parseCommaParts(m.body), n.length === 1 && (n = expand(n[0], !1).map(embrace), n.length === 1))
|
|
28808
|
-
return post.map(function(p) {
|
|
28809
|
-
return m.pre + n[0] + p;
|
|
28810
|
-
});
|
|
28811
|
-
var N;
|
|
28812
|
-
if (isSequence) {
|
|
28813
|
-
var x = numeric(n[0]), y = numeric(n[1]), width = Math.max(n[0].length, n[1].length), incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1, test = lte, reverse = y < x;
|
|
28814
|
-
reverse && (incr *= -1, test = gte);
|
|
28815
|
-
var pad = n.some(isPadded);
|
|
28816
|
-
N = [];
|
|
28817
|
-
for (var i = x; test(i, y); i += incr) {
|
|
28818
|
-
var c;
|
|
28819
|
-
if (isAlphaSequence)
|
|
28820
|
-
c = String.fromCharCode(i), c === "\\" && (c = "");
|
|
28821
|
-
else if (c = String(i), pad) {
|
|
28822
|
-
var need = width - c.length;
|
|
28823
|
-
if (need > 0) {
|
|
28824
|
-
var z2 = new Array(need + 1).join("0");
|
|
28825
|
-
i < 0 ? c = "-" + z2 + c.slice(1) : c = z2 + c;
|
|
28826
|
-
}
|
|
28827
|
-
}
|
|
28828
|
-
N.push(c);
|
|
28829
|
-
}
|
|
28830
|
-
} else {
|
|
28831
|
-
N = [];
|
|
28832
|
-
for (var j = 0; j < n.length; j++)
|
|
28833
|
-
N.push.apply(N, expand(n[j], !1));
|
|
28834
|
-
}
|
|
28835
|
-
for (var j = 0; j < N.length; j++)
|
|
28836
|
-
for (var k = 0; k < post.length; k++) {
|
|
28837
|
-
var expansion = pre + N[j] + post[k];
|
|
28838
|
-
(!isTop || isSequence || expansion) && expansions.push(expansion);
|
|
28839
|
-
}
|
|
28840
|
-
}
|
|
28841
|
-
return expansions;
|
|
28842
|
-
}
|
|
28843
|
-
}
|
|
28844
|
-
});
|
|
28845
|
-
|
|
28846
28754
|
// ../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js
|
|
28847
28755
|
var require_minimatch = __commonJS({
|
|
28848
28756
|
"../../node_modules/.pnpm/minimatch@5.1.6/node_modules/minimatch/minimatch.js"(exports2, module2) {
|
|
@@ -29260,10 +29168,10 @@ var require_common = __commonJS({
|
|
|
29260
29168
|
var require_sync = __commonJS({
|
|
29261
29169
|
"../../node_modules/.pnpm/glob@8.1.0/node_modules/glob/sync.js"(exports2, module2) {
|
|
29262
29170
|
init_cjs_shims();
|
|
29263
|
-
module2.exports =
|
|
29264
|
-
|
|
29171
|
+
module2.exports = globSync2;
|
|
29172
|
+
globSync2.GlobSync = GlobSync;
|
|
29265
29173
|
var rp = require_fs(), minimatch = require_minimatch(), Minimatch = minimatch.Minimatch, Glob = require_glob2().Glob, util = __require("util"), path = __require("path"), assert = __require("assert"), isAbsolute = __require("path").isAbsolute, common = require_common(), setopts = common.setopts, ownProp = common.ownProp, childrenIgnored = common.childrenIgnored, isIgnored = common.isIgnored;
|
|
29266
|
-
function
|
|
29174
|
+
function globSync2(pattern, options) {
|
|
29267
29175
|
if (typeof options == "function" || arguments.length === 3)
|
|
29268
29176
|
throw new TypeError(`callback provided to sync glob
|
|
29269
29177
|
See: https://github.com/isaacs/node-glob/issues/167`);
|
|
@@ -29511,17 +29419,17 @@ var require_glob2 = __commonJS({
|
|
|
29511
29419
|
"../../node_modules/.pnpm/glob@8.1.0/node_modules/glob/glob.js"(exports2, module2) {
|
|
29512
29420
|
init_cjs_shims();
|
|
29513
29421
|
module2.exports = glob2;
|
|
29514
|
-
var rp = require_fs(), minimatch = require_minimatch(), Minimatch = minimatch.Minimatch, inherits = require_inherits(), EE = __require("events").EventEmitter, path = __require("path"), assert = __require("assert"), isAbsolute = __require("path").isAbsolute,
|
|
29422
|
+
var rp = require_fs(), minimatch = require_minimatch(), Minimatch = minimatch.Minimatch, inherits = require_inherits(), EE = __require("events").EventEmitter, path = __require("path"), assert = __require("assert"), isAbsolute = __require("path").isAbsolute, globSync2 = require_sync(), common = require_common(), setopts = common.setopts, ownProp = common.ownProp, inflight = require_inflight(), util = __require("util"), childrenIgnored = common.childrenIgnored, isIgnored = common.isIgnored, once = require_once();
|
|
29515
29423
|
function glob2(pattern, options, cb) {
|
|
29516
29424
|
if (typeof options == "function" && (cb = options, options = {}), options || (options = {}), options.sync) {
|
|
29517
29425
|
if (cb)
|
|
29518
29426
|
throw new TypeError("callback provided to sync glob");
|
|
29519
|
-
return
|
|
29427
|
+
return globSync2(pattern, options);
|
|
29520
29428
|
}
|
|
29521
29429
|
return new Glob(pattern, options, cb);
|
|
29522
29430
|
}
|
|
29523
|
-
glob2.sync =
|
|
29524
|
-
var GlobSync = glob2.GlobSync =
|
|
29431
|
+
glob2.sync = globSync2;
|
|
29432
|
+
var GlobSync = glob2.GlobSync = globSync2.GlobSync;
|
|
29525
29433
|
glob2.glob = glob2;
|
|
29526
29434
|
function extend(origin, add) {
|
|
29527
29435
|
if (add === null || typeof add != "object")
|
|
@@ -29991,7 +29899,7 @@ var require_load_config_description = __commonJS({
|
|
|
29991
29899
|
exports2.loadConfigDescription = void 0;
|
|
29992
29900
|
var theme_check_common_1 = require_dist2(), node_path_1 = __importDefault(__require("node:path")), file_utils_1 = require_file_utils2(), installation_location_1 = require_installation_location(), load_third_party_checks_1 = require_load_third_party_checks(), vscode_uri_1 = require_umd(), flatten = (arrs) => arrs.flat();
|
|
29993
29901
|
async function loadConfigDescription(configDescription, root) {
|
|
29994
|
-
var
|
|
29902
|
+
var _a42;
|
|
29995
29903
|
let nodeModuleRoot = await findNodeModuleRoot(root), thirdPartyChecksPaths = await Promise.all([
|
|
29996
29904
|
(0, load_third_party_checks_1.findThirdPartyChecks)((0, installation_location_1.thisNodeModuleRoot)()),
|
|
29997
29905
|
(0, load_third_party_checks_1.findThirdPartyChecks)(nodeModuleRoot)
|
|
@@ -30001,7 +29909,7 @@ var require_load_config_description = __commonJS({
|
|
|
30001
29909
|
]), checks = theme_check_common_1.allChecks.concat(thirdPartyChecks).filter(isEnabledBy(configDescription)), rootUri = vscode_uri_1.URI.file(root);
|
|
30002
29910
|
return {
|
|
30003
29911
|
settings: unaliasedSettings(configDescription.checkSettings, checks),
|
|
30004
|
-
context: (
|
|
29912
|
+
context: (_a42 = configDescription.context) !== null && _a42 !== void 0 ? _a42 : "theme",
|
|
30005
29913
|
checks,
|
|
30006
29914
|
ignore: configDescription.ignore,
|
|
30007
29915
|
rootUri: resolveRoot(rootUri, configDescription.root)
|
|
@@ -30016,8 +29924,8 @@ var require_load_config_description = __commonJS({
|
|
|
30016
29924
|
return theme_check_common_1.path.resolve(root, pathLike);
|
|
30017
29925
|
}
|
|
30018
29926
|
var isEnabledBy = (config2) => (checkDefinition) => {
|
|
30019
|
-
var
|
|
30020
|
-
let checkSettings = (
|
|
29927
|
+
var _a42;
|
|
29928
|
+
let checkSettings = (_a42 = config2.checkSettings[checkDefinition.meta.code]) !== null && _a42 !== void 0 ? _a42 : aliasedSettings(config2, checkDefinition);
|
|
30021
29929
|
return checkSettings ? checkSettings.enabled : !1;
|
|
30022
29930
|
};
|
|
30023
29931
|
function aliasedSettings(config2, checkDefinition) {
|
|
@@ -30032,8 +29940,8 @@ var require_load_config_description = __commonJS({
|
|
|
30032
29940
|
}
|
|
30033
29941
|
function unaliasedCode(code, checks) {
|
|
30034
29942
|
let check2 = checks.find((check3) => {
|
|
30035
|
-
var
|
|
30036
|
-
return check3.meta.code === code || ((
|
|
29943
|
+
var _a42;
|
|
29944
|
+
return check3.meta.code === code || ((_a42 = check3.meta.aliases) === null || _a42 === void 0 ? void 0 : _a42.find((alias) => alias === code));
|
|
30037
29945
|
});
|
|
30038
29946
|
return check2?.meta.code;
|
|
30039
29947
|
}
|
|
@@ -35659,7 +35567,7 @@ var require_merge_fragments = __commonJS({
|
|
|
35659
35567
|
Object.defineProperty(exports2, "__esModule", { value: !0 });
|
|
35660
35568
|
exports2.mergeFragments = void 0;
|
|
35661
35569
|
function mergeFragments(baseConfigs, config2) {
|
|
35662
|
-
var
|
|
35570
|
+
var _a42;
|
|
35663
35571
|
return {
|
|
35664
35572
|
// we use the last one defined
|
|
35665
35573
|
root: selectLatest(baseConfigs.map((b) => b.root), config2.root),
|
|
@@ -35672,7 +35580,7 @@ var require_merge_fragments = __commonJS({
|
|
|
35672
35580
|
// we merge deep the settings
|
|
35673
35581
|
checkSettings: baseConfigs.map((b) => b.checkSettings).concat(config2.checkSettings).reduce(mergeDeep),
|
|
35674
35582
|
// We use the last one defined, or default to 'theme'
|
|
35675
|
-
context: (
|
|
35583
|
+
context: (_a42 = selectLatest(baseConfigs.map((b) => b.context), config2.context)) !== null && _a42 !== void 0 ? _a42 : "theme"
|
|
35676
35584
|
};
|
|
35677
35585
|
}
|
|
35678
35586
|
exports2.mergeFragments = mergeFragments;
|
|
@@ -35971,20 +35879,20 @@ var require_dist5 = __commonJS({
|
|
|
35971
35879
|
// In the language server, this is memo'ed in DocumentManager, but we don't have that kind
|
|
35972
35880
|
// of luxury in CLI-mode.
|
|
35973
35881
|
getSectionSchema: async (name) => {
|
|
35974
|
-
var
|
|
35975
|
-
return (
|
|
35882
|
+
var _a42;
|
|
35883
|
+
return (_a42 = sectionSchemas.get(name)) === null || _a42 === void 0 ? void 0 : _a42();
|
|
35976
35884
|
},
|
|
35977
35885
|
getBlockSchema: async (name) => {
|
|
35978
|
-
var
|
|
35979
|
-
return (
|
|
35886
|
+
var _a42;
|
|
35887
|
+
return (_a42 = blockSchemas.get(name)) === null || _a42 === void 0 ? void 0 : _a42();
|
|
35980
35888
|
},
|
|
35981
35889
|
getAppBlockSchema: async (name) => {
|
|
35982
|
-
var
|
|
35983
|
-
return (
|
|
35890
|
+
var _a42;
|
|
35891
|
+
return (_a42 = blockSchemas.get(name)) === null || _a42 === void 0 ? void 0 : _a42();
|
|
35984
35892
|
},
|
|
35985
35893
|
getDocDefinition: async (relativePath2) => {
|
|
35986
|
-
var
|
|
35987
|
-
return (
|
|
35894
|
+
var _a42;
|
|
35895
|
+
return (_a42 = docDefinitions.get(relativePath2)) === null || _a42 === void 0 ? void 0 : _a42();
|
|
35988
35896
|
}
|
|
35989
35897
|
});
|
|
35990
35898
|
return {
|
|
@@ -36113,9 +36021,9 @@ var require_main2 = __commonJS({
|
|
|
36113
36021
|
}
|
|
36114
36022
|
});
|
|
36115
36023
|
|
|
36116
|
-
// ../../node_modules/.pnpm/@luckycatfactory+esbuild-graphql-loader@3.8.1_esbuild@0.25.
|
|
36024
|
+
// ../../node_modules/.pnpm/@luckycatfactory+esbuild-graphql-loader@3.8.1_esbuild@0.25.12_graphql-tag@2.12.6_graphql@16.10.0__graphql@16.10.0/node_modules/@luckycatfactory/esbuild-graphql-loader/lib/index.js
|
|
36117
36025
|
var require_lib5 = __commonJS({
|
|
36118
|
-
"../../node_modules/.pnpm/@luckycatfactory+esbuild-graphql-loader@3.8.1_esbuild@0.25.
|
|
36026
|
+
"../../node_modules/.pnpm/@luckycatfactory+esbuild-graphql-loader@3.8.1_esbuild@0.25.12_graphql-tag@2.12.6_graphql@16.10.0__graphql@16.10.0/node_modules/@luckycatfactory/esbuild-graphql-loader/lib/index.js"(exports2) {
|
|
36119
36027
|
init_cjs_shims();
|
|
36120
36028
|
var __create = Object.create, __defProp4 = Object.defineProperty, __getProtoOf = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __getOwnPropNames2 = Object.getOwnPropertyNames, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __markAsModule = (target) => __defProp4(target, "__esModule", { value: !0 }), __export3 = (target, all) => {
|
|
36121
36029
|
__markAsModule(target);
|
|
@@ -36189,8 +36097,8 @@ var require_lib5 = __commonJS({
|
|
|
36189
36097
|
}
|
|
36190
36098
|
};
|
|
36191
36099
|
return node.kind === "OperationDefinition" ? node.selectionSet.selections.forEach((selection) => {
|
|
36192
|
-
var
|
|
36193
|
-
selection.kind === "Field" && ((
|
|
36100
|
+
var _a42;
|
|
36101
|
+
selection.kind === "Field" && ((_a42 = selection.selectionSet) == null || _a42.selections.forEach(handleSelectionNode));
|
|
36194
36102
|
}) : node.selectionSet.selections.forEach(handleSelectionNode), references;
|
|
36195
36103
|
}, generateContentsFromGraphqlString = (graphqlString, mapDocumentNode) => {
|
|
36196
36104
|
let graphqlDocument = graphql_tag.default(graphqlString), documentNodeAsString = generateDocumentNodeString(graphqlDocument, mapDocumentNode), allFragments = collectAllFragmentDefinitions(graphqlDocument), lines = graphqlDocument.definitions.reduce((accumulator, definition) => {
|
|
@@ -50663,7 +50571,7 @@ var require_linkedMap = __commonJS({
|
|
|
50663
50571
|
"../../node_modules/.pnpm/vscode-jsonrpc@8.1.0/node_modules/vscode-jsonrpc/lib/common/linkedMap.js"(exports2) {
|
|
50664
50572
|
"use strict";
|
|
50665
50573
|
init_cjs_shims();
|
|
50666
|
-
var
|
|
50574
|
+
var _a42;
|
|
50667
50575
|
Object.defineProperty(exports2, "__esModule", { value: !0 });
|
|
50668
50576
|
exports2.LRUCache = exports2.LinkedMap = exports2.Touch = void 0;
|
|
50669
50577
|
var Touch;
|
|
@@ -50672,7 +50580,7 @@ var require_linkedMap = __commonJS({
|
|
|
50672
50580
|
})(Touch = exports2.Touch || (exports2.Touch = {}));
|
|
50673
50581
|
var LinkedMap = class {
|
|
50674
50582
|
constructor() {
|
|
50675
|
-
this[
|
|
50583
|
+
this[_a42] = "LinkedMap", this._map = /* @__PURE__ */ new Map(), this._head = void 0, this._tail = void 0, this._size = 0, this._state = 0;
|
|
50676
50584
|
}
|
|
50677
50585
|
clear() {
|
|
50678
50586
|
this._map.clear(), this._head = void 0, this._tail = void 0, this._size = 0, this._state++;
|
|
@@ -50789,7 +50697,7 @@ var require_linkedMap = __commonJS({
|
|
|
50789
50697
|
};
|
|
50790
50698
|
return iterator;
|
|
50791
50699
|
}
|
|
50792
|
-
[(
|
|
50700
|
+
[(_a42 = Symbol.toStringTag, Symbol.iterator)]() {
|
|
50793
50701
|
return this.entries();
|
|
50794
50702
|
}
|
|
50795
50703
|
trimOld(newSize) {
|
|
@@ -53264,8 +53172,8 @@ var DocumentUri2, URI3, integer2, uinteger2, Position2, Range2, Location2, Locat
|
|
|
53264
53172
|
}
|
|
53265
53173
|
Diagnostic3.create = create;
|
|
53266
53174
|
function is(value) {
|
|
53267
|
-
var
|
|
53268
|
-
return Is2.defined(candidate) && Range2.is(candidate.range) && Is2.string(candidate.message) && (Is2.number(candidate.severity) || Is2.undefined(candidate.severity)) && (Is2.integer(candidate.code) || Is2.string(candidate.code) || Is2.undefined(candidate.code)) && (Is2.undefined(candidate.codeDescription) || Is2.string((
|
|
53175
|
+
var _a42, candidate = value;
|
|
53176
|
+
return Is2.defined(candidate) && Range2.is(candidate.range) && Is2.string(candidate.message) && (Is2.number(candidate.severity) || Is2.undefined(candidate.severity)) && (Is2.integer(candidate.code) || Is2.string(candidate.code) || Is2.undefined(candidate.code)) && (Is2.undefined(candidate.codeDescription) || Is2.string((_a42 = candidate.codeDescription) === null || _a42 === void 0 ? void 0 : _a42.href)) && (Is2.string(candidate.source) || Is2.undefined(candidate.source)) && (Is2.undefined(candidate.relatedInformation) || Is2.typedArray(candidate.relatedInformation, DiagnosticRelatedInformation2.is));
|
|
53269
53177
|
}
|
|
53270
53178
|
Diagnostic3.is = is;
|
|
53271
53179
|
})(Diagnostic2 || (Diagnostic2 = {}));
|
|
@@ -57008,36 +56916,36 @@ var require_ClientCapabilities = __commonJS({
|
|
|
57008
56916
|
this.capabilities = capabilities, this.initializationOptions = initializationOptions;
|
|
57009
56917
|
}
|
|
57010
56918
|
get hasWorkspaceConfigurationSupport() {
|
|
57011
|
-
var
|
|
57012
|
-
return !!(!((_b = (
|
|
56919
|
+
var _a42, _b;
|
|
56920
|
+
return !!(!((_b = (_a42 = this.capabilities) === null || _a42 === void 0 ? void 0 : _a42.workspace) === null || _b === void 0) && _b.configuration);
|
|
57013
56921
|
}
|
|
57014
56922
|
get hasApplyEditSupport() {
|
|
57015
|
-
var
|
|
57016
|
-
return !!(!((_b = (
|
|
56923
|
+
var _a42, _b;
|
|
56924
|
+
return !!(!((_b = (_a42 = this.capabilities) === null || _a42 === void 0 ? void 0 : _a42.workspace) === null || _b === void 0) && _b.applyEdit);
|
|
57017
56925
|
}
|
|
57018
56926
|
get hasWorkspaceFoldersSupport() {
|
|
57019
|
-
var
|
|
57020
|
-
return !!(!((_b = (
|
|
56927
|
+
var _a42, _b;
|
|
56928
|
+
return !!(!((_b = (_a42 = this.capabilities) === null || _a42 === void 0 ? void 0 : _a42.workspace) === null || _b === void 0) && _b.workspaceFolders);
|
|
57021
56929
|
}
|
|
57022
56930
|
get hasDidChangeConfigurationDynamicRegistrationSupport() {
|
|
57023
|
-
var
|
|
57024
|
-
return !!(!((_c = (_b = (
|
|
56931
|
+
var _a42, _b, _c;
|
|
56932
|
+
return !!(!((_c = (_b = (_a42 = this.capabilities) === null || _a42 === void 0 ? void 0 : _a42.workspace) === null || _b === void 0 ? void 0 : _b.didChangeConfiguration) === null || _c === void 0) && _c.dynamicRegistration);
|
|
57025
56933
|
}
|
|
57026
56934
|
get hasDidChangeWatchedFilesDynamicRegistrationSupport() {
|
|
57027
|
-
var
|
|
57028
|
-
return !!(!((_c = (_b = (
|
|
56935
|
+
var _a42, _b, _c;
|
|
56936
|
+
return !!(!((_c = (_b = (_a42 = this.capabilities) === null || _a42 === void 0 ? void 0 : _a42.workspace) === null || _b === void 0 ? void 0 : _b.didChangeWatchedFiles) === null || _c === void 0) && _c.dynamicRegistration);
|
|
57029
56937
|
}
|
|
57030
56938
|
get hasShowDocumentSupport() {
|
|
57031
|
-
var
|
|
57032
|
-
return !!(!((_b = (
|
|
56939
|
+
var _a42, _b;
|
|
56940
|
+
return !!(!((_b = (_a42 = this.capabilities) === null || _a42 === void 0 ? void 0 : _a42.window) === null || _b === void 0) && _b.showDocument);
|
|
57033
56941
|
}
|
|
57034
56942
|
get hasProgressSupport() {
|
|
57035
|
-
var
|
|
57036
|
-
return !!(!((_b = (
|
|
56943
|
+
var _a42, _b;
|
|
56944
|
+
return !!(!((_b = (_a42 = this.capabilities) === null || _a42 === void 0 ? void 0 : _a42.window) === null || _b === void 0) && _b.workDoneProgress);
|
|
57037
56945
|
}
|
|
57038
56946
|
initializationOption(key, defaultValue) {
|
|
57039
|
-
var
|
|
57040
|
-
let direct = (
|
|
56947
|
+
var _a42;
|
|
56948
|
+
let direct = (_a42 = this.initializationOptions) === null || _a42 === void 0 ? void 0 : _a42[key];
|
|
57041
56949
|
if (direct !== void 0)
|
|
57042
56950
|
return direct;
|
|
57043
56951
|
let nested = pathGet(this.initializationOptions, key);
|
|
@@ -57124,7 +57032,7 @@ var require_ApplySuggestionProvider = __commonJS({
|
|
|
57124
57032
|
exports2.applySuggestionCommand = exports2.ApplySuggestionProvider = void 0;
|
|
57125
57033
|
var theme_check_common_1 = require_dist2(), vscode_languageserver_1 = require_main6(), BaseExecuteCommandProvider_1 = require_BaseExecuteCommandProvider(), ApplySuggestionProvider = class extends BaseExecuteCommandProvider_1.BaseExecuteCommandProvider {
|
|
57126
57034
|
async execute(uri, version, anomalyId, suggestionIndex) {
|
|
57127
|
-
var
|
|
57035
|
+
var _a42;
|
|
57128
57036
|
if (!this.clientCapabilities.hasApplyEditSupport)
|
|
57129
57037
|
return;
|
|
57130
57038
|
let diagnostics = this.diagnosticsManager.get(uri), document2 = this.documentManager.get(uri);
|
|
@@ -57133,7 +57041,7 @@ var require_ApplySuggestionProvider = __commonJS({
|
|
|
57133
57041
|
let anomaly = diagnostics.anomalies[anomalyId];
|
|
57134
57042
|
if (!anomaly)
|
|
57135
57043
|
return;
|
|
57136
|
-
let offense = anomaly.offense, suggestion = (
|
|
57044
|
+
let offense = anomaly.offense, suggestion = (_a42 = offense.suggest) === null || _a42 === void 0 ? void 0 : _a42[suggestionIndex];
|
|
57137
57045
|
if (!suggestion)
|
|
57138
57046
|
return;
|
|
57139
57047
|
let corrector = (0, theme_check_common_1.createCorrector)(document2.type, document2.source);
|
|
@@ -57244,10 +57152,10 @@ var require_ExecuteCommandProvider = __commonJS({
|
|
|
57244
57152
|
};
|
|
57245
57153
|
}
|
|
57246
57154
|
async execute(params) {
|
|
57247
|
-
var
|
|
57155
|
+
var _a42;
|
|
57248
57156
|
if (!isKnownCommand(params.command))
|
|
57249
57157
|
return;
|
|
57250
|
-
let provider = this.commands[params.command], args = (
|
|
57158
|
+
let provider = this.commands[params.command], args = (_a42 = params.arguments) !== null && _a42 !== void 0 ? _a42 : [];
|
|
57251
57159
|
await provider.execute(...args);
|
|
57252
57160
|
}
|
|
57253
57161
|
};
|
|
@@ -57513,7 +57421,7 @@ var require_TypeSystem = __commonJS({
|
|
|
57513
57421
|
var liquid_html_parser_1 = require_dist(), theme_check_common_1 = require_dist2(), settings_1 = require_settings(), utils_1 = require_utils8(), theme_check_common_2 = require_dist2(), TypeSystem = class {
|
|
57514
57422
|
constructor(themeDocset, getThemeSettingsSchemaForURI, getMetafieldDefinitions) {
|
|
57515
57423
|
this.themeDocset = themeDocset, this.getThemeSettingsSchemaForURI = getThemeSettingsSchemaForURI, this.getMetafieldDefinitions = getMetafieldDefinitions, this.objectMap = async (uri, ast) => {
|
|
57516
|
-
var
|
|
57424
|
+
var _a42, _b, _c, _d;
|
|
57517
57425
|
let [objectMap, themeSettingProperties, metafieldDefinitionsObjectMap] = await Promise.all([
|
|
57518
57426
|
this._objectMap(),
|
|
57519
57427
|
this.themeSettingProperties(uri),
|
|
@@ -57521,7 +57429,7 @@ var require_TypeSystem = __commonJS({
|
|
|
57521
57429
|
]), result = {
|
|
57522
57430
|
...objectMap,
|
|
57523
57431
|
settings: {
|
|
57524
|
-
...(
|
|
57432
|
+
...(_a42 = objectMap.settings) !== null && _a42 !== void 0 ? _a42 : {},
|
|
57525
57433
|
properties: themeSettingProperties
|
|
57526
57434
|
},
|
|
57527
57435
|
...customMetafieldTypeEntries(objectMap.metafield),
|
|
@@ -57572,8 +57480,8 @@ var require_TypeSystem = __commonJS({
|
|
|
57572
57480
|
this.contextualVariables(uri)
|
|
57573
57481
|
]);
|
|
57574
57482
|
return globalVariables.concat(contextualVariables).reduce((table, objectEntry) => {
|
|
57575
|
-
var
|
|
57576
|
-
return (
|
|
57483
|
+
var _a42, _b;
|
|
57484
|
+
return (_a42 = table[_b = objectEntry.name]) !== null && _a42 !== void 0 || (table[_b] = []), table[objectEntry.name].push({
|
|
57577
57485
|
identifier: objectEntry.name,
|
|
57578
57486
|
type: objectEntryType(objectEntry),
|
|
57579
57487
|
range: [0]
|
|
@@ -57599,10 +57507,10 @@ var require_TypeSystem = __commonJS({
|
|
|
57599
57507
|
this.symbolsTable(partialAst, uri)
|
|
57600
57508
|
]);
|
|
57601
57509
|
return Object.entries(symbolsTable).filter(([key, typeRanges]) => key.startsWith(partial) && typeRanges.some((typeRange) => isCorrectTypeRange(typeRange, node))).map(([identifier, typeRanges]) => {
|
|
57602
|
-
var
|
|
57510
|
+
var _a42;
|
|
57603
57511
|
let typeRange = (0, utils_1.findLast)(typeRanges, (typeRange2) => isCorrectTypeRange(typeRange2, node)), type = resolveTypeRangeType(typeRange.type, symbolsTable, objectMap, filtersMap);
|
|
57604
57512
|
return {
|
|
57605
|
-
entry: { ...(
|
|
57513
|
+
entry: { ...(_a42 = objectMap[isArrayType(type) ? type.valueType : type]) !== null && _a42 !== void 0 ? _a42 : {}, name: identifier },
|
|
57606
57514
|
type
|
|
57607
57515
|
};
|
|
57608
57516
|
});
|
|
@@ -57731,19 +57639,19 @@ var require_TypeSystem = __commonJS({
|
|
|
57731
57639
|
},
|
|
57732
57640
|
// This also covers tablerow
|
|
57733
57641
|
ForMarkup(node, ancestors) {
|
|
57734
|
-
var
|
|
57642
|
+
var _a42;
|
|
57735
57643
|
let parentNode = ancestors.at(-1);
|
|
57736
57644
|
return {
|
|
57737
57645
|
identifier: node.variableName,
|
|
57738
57646
|
type: LazyDeconstructedExpression(node.collection, node.position.start),
|
|
57739
|
-
range: [parentNode.blockStartPosition.end, end((
|
|
57647
|
+
range: [parentNode.blockStartPosition.end, end((_a42 = parentNode.blockEndPosition) === null || _a42 === void 0 ? void 0 : _a42.end)]
|
|
57740
57648
|
};
|
|
57741
57649
|
},
|
|
57742
57650
|
// {% capture foo %}
|
|
57743
57651
|
// ...
|
|
57744
57652
|
// {% endcapture}
|
|
57745
57653
|
LiquidTag(node) {
|
|
57746
|
-
var
|
|
57654
|
+
var _a42, _b;
|
|
57747
57655
|
if (node.name === "capture" && typeof node.markup != "string")
|
|
57748
57656
|
return {
|
|
57749
57657
|
identifier: node.markup.name,
|
|
@@ -57754,7 +57662,7 @@ var require_TypeSystem = __commonJS({
|
|
|
57754
57662
|
return {
|
|
57755
57663
|
identifier: node.name,
|
|
57756
57664
|
type: node.name,
|
|
57757
|
-
range: [node.blockStartPosition.end, end((
|
|
57665
|
+
range: [node.blockStartPosition.end, end((_a42 = node.blockEndPosition) === null || _a42 === void 0 ? void 0 : _a42.end)]
|
|
57758
57666
|
};
|
|
57759
57667
|
if (["for", "tablerow"].includes(node.name))
|
|
57760
57668
|
return {
|
|
@@ -57776,8 +57684,8 @@ var require_TypeSystem = __commonJS({
|
|
|
57776
57684
|
};
|
|
57777
57685
|
}
|
|
57778
57686
|
}).sort(({ range: [startA] }, { range: [startB] }) => startA - startB).reduce((table, typeRange) => {
|
|
57779
|
-
var
|
|
57780
|
-
return (
|
|
57687
|
+
var _a42, _b;
|
|
57688
|
+
return (_a42 = table[_b = typeRange.identifier]) !== null && _a42 !== void 0 || (table[_b] = []), table[typeRange.identifier].push(typeRange), table;
|
|
57781
57689
|
}, seedSymbolsTable);
|
|
57782
57690
|
}
|
|
57783
57691
|
function resolveTypeRangeType(typeRangeType, symbolsTable, objectMap, filtersMap) {
|
|
@@ -57795,9 +57703,9 @@ var require_TypeSystem = __commonJS({
|
|
|
57795
57703
|
}
|
|
57796
57704
|
}
|
|
57797
57705
|
function inferType(thing, symbolsTable, objectMap, filtersMap) {
|
|
57798
|
-
var
|
|
57706
|
+
var _a42, _b;
|
|
57799
57707
|
if (typeof thing == "string")
|
|
57800
|
-
return (_b = (
|
|
57708
|
+
return (_b = (_a42 = objectMap[thing]) === null || _a42 === void 0 ? void 0 : _a42.name) !== null && _b !== void 0 ? _b : exports2.Untyped;
|
|
57801
57709
|
switch (thing.type) {
|
|
57802
57710
|
case liquid_html_parser_1.NodeTypes.Number:
|
|
57803
57711
|
return "number";
|
|
@@ -57834,8 +57742,8 @@ var require_TypeSystem = __commonJS({
|
|
|
57834
57742
|
}
|
|
57835
57743
|
}
|
|
57836
57744
|
function inferLiquidDocParamType(node, liquidDrops) {
|
|
57837
|
-
var
|
|
57838
|
-
let paramTypeValue = (
|
|
57745
|
+
var _a42;
|
|
57746
|
+
let paramTypeValue = (_a42 = node.paramType) === null || _a42 === void 0 ? void 0 : _a42.value;
|
|
57839
57747
|
if (!paramTypeValue)
|
|
57840
57748
|
return exports2.Untyped;
|
|
57841
57749
|
let validParamTypes = (0, theme_check_common_1.getValidParamTypes)(liquidDrops), parsedParamType = (0, theme_check_common_1.parseParamType)(new Set(validParamTypes.keys()), paramTypeValue);
|
|
@@ -57881,7 +57789,7 @@ var require_TypeSystem = __commonJS({
|
|
|
57881
57789
|
return exports2.Untyped;
|
|
57882
57790
|
}
|
|
57883
57791
|
function inferPseudoTypePropertyType(curr, lookup3, objectMap) {
|
|
57884
|
-
var
|
|
57792
|
+
var _a42;
|
|
57885
57793
|
let parentEntry = objectMap[curr];
|
|
57886
57794
|
if (lookup3.type !== liquid_html_parser_1.NodeTypes.String)
|
|
57887
57795
|
return exports2.Untyped;
|
|
@@ -57901,7 +57809,7 @@ var require_TypeSystem = __commonJS({
|
|
|
57901
57809
|
}
|
|
57902
57810
|
return exports2.Untyped;
|
|
57903
57811
|
}
|
|
57904
|
-
let propertyName = lookup3.value, property = (
|
|
57812
|
+
let propertyName = lookup3.value, property = (_a42 = parentEntry.properties) === null || _a42 === void 0 ? void 0 : _a42.find((property2) => property2.name === propertyName);
|
|
57905
57813
|
return property ? objectEntryType(property) : exports2.Untyped;
|
|
57906
57814
|
}
|
|
57907
57815
|
function filterEntryReturnType(entry) {
|
|
@@ -58029,18 +57937,18 @@ var require_TypeSystem = __commonJS({
|
|
|
58029
57937
|
file_reference: exports2.Untyped
|
|
58030
57938
|
}), REFERENCE_TYPE_METAFIELDS = Object.entries(METAFIELD_TYPE_TO_TYPE).filter(([metafieldType, _type2]) => metafieldType.endsWith("_reference")).map(([_metafieldType, type]) => type);
|
|
58031
57939
|
function metafieldReturnType(metafieldType) {
|
|
58032
|
-
var
|
|
57940
|
+
var _a42;
|
|
58033
57941
|
let isArray = metafieldType.startsWith("list.");
|
|
58034
57942
|
isArray && (metafieldType = metafieldType.split(".")[1]);
|
|
58035
|
-
let type = "metafield_" + ((
|
|
57943
|
+
let type = "metafield_" + ((_a42 = METAFIELD_TYPE_TO_TYPE[metafieldType]) !== null && _a42 !== void 0 ? _a42 : exports2.Untyped);
|
|
58036
57944
|
return isArray ? [{ type: `${type}_array`, name: "" }] : [{ type, name: "" }];
|
|
58037
57945
|
}
|
|
58038
57946
|
var customMetafieldTypeEntries = (0, utils_1.memo)((baseMetafieldEntry) => baseMetafieldEntry ? [
|
|
58039
57947
|
.../* @__PURE__ */ new Set([...Object.values(METAFIELD_TYPE_TO_TYPE), ...theme_check_common_1.FETCHED_METAFIELD_CATEGORIES])
|
|
58040
57948
|
].reduce((map, type) => {
|
|
58041
|
-
var
|
|
57949
|
+
var _a42, _b;
|
|
58042
57950
|
{
|
|
58043
|
-
let metafieldEntry = JSON.parse(JSON.stringify(baseMetafieldEntry)), metafieldValueProp = (
|
|
57951
|
+
let metafieldEntry = JSON.parse(JSON.stringify(baseMetafieldEntry)), metafieldValueProp = (_a42 = metafieldEntry.properties) === null || _a42 === void 0 ? void 0 : _a42.find((prop) => prop.name === "value");
|
|
58044
57952
|
metafieldValueProp && (metafieldValueProp.return_type = [{ type, name: "" }], metafieldValueProp.description = "", metafieldEntry.name = `metafield_${type}`, map[metafieldEntry.name] = metafieldEntry);
|
|
58045
57953
|
}
|
|
58046
57954
|
{
|
|
@@ -58218,8 +58126,8 @@ var require_fix = __commonJS({
|
|
|
58218
58126
|
}
|
|
58219
58127
|
}
|
|
58220
58128
|
shouldIncludeCursorPlaceholder() {
|
|
58221
|
-
var
|
|
58222
|
-
let prevCharacter = (
|
|
58129
|
+
var _a42, _b;
|
|
58130
|
+
let prevCharacter = (_a42 = this.markup.at(-1)) !== null && _a42 !== void 0 ? _a42 : "", prevPrevCharacter = (_b = this.markup.at(-2)) !== null && _b !== void 0 ? _b : "", isInLiquidContext = this.stack.includes("%}") || this.stack.includes("}}"), isInHtmlContext = this.current === ">", isInStringContext = QUOTES.includes(this.current);
|
|
58223
58131
|
return isInStringContext && this.stack.at(-2) === ">" && QUOTES.includes(prevCharacter) || isInHtmlContext && (/\s/.test(prevCharacter) || prevCharacter === "<" || prevPrevCharacter === "<" && prevCharacter === "/" || prevPrevCharacter === "%" && prevCharacter === "}") || isInLiquidContext && (!isInStringContext && [" ", " ", `
|
|
58224
58132
|
`, ".", "{", "[", ","].includes(prevCharacter) || isInStringContext && prevPrevCharacter === "[");
|
|
58225
58133
|
}
|
|
@@ -58658,7 +58566,7 @@ ${example}
|
|
|
58658
58566
|
}
|
|
58659
58567
|
exports2.getParameterCompletionTemplate = getParameterCompletionTemplate;
|
|
58660
58568
|
function formatLiquidDocContentMarkdown(name, docDefinition) {
|
|
58661
|
-
var
|
|
58569
|
+
var _a42, _b, _c;
|
|
58662
58570
|
let liquidDoc = docDefinition?.liquidDoc;
|
|
58663
58571
|
if (!liquidDoc)
|
|
58664
58572
|
return `### ${name}`;
|
|
@@ -58668,7 +58576,7 @@ ${example}
|
|
|
58668
58576
|
parts.push("", "**Description:**", `
|
|
58669
58577
|
`, description);
|
|
58670
58578
|
}
|
|
58671
|
-
if (!((
|
|
58579
|
+
if (!((_a42 = liquidDoc.parameters) === null || _a42 === void 0) && _a42.length) {
|
|
58672
58580
|
let parameters = liquidDoc.parameters.map((param) => formatLiquidDocParameter(param)).join(`
|
|
58673
58581
|
`);
|
|
58674
58582
|
parts.push("", "**Parameters:**", parameters);
|
|
@@ -58699,7 +58607,7 @@ var require_ContentForParameterCompletionProvider = __commonJS({
|
|
|
58699
58607
|
this.getDocDefinitionForURI = getDocDefinitionForURI;
|
|
58700
58608
|
}
|
|
58701
58609
|
async completions(params) {
|
|
58702
|
-
var
|
|
58610
|
+
var _a42;
|
|
58703
58611
|
if (!params.completionContext)
|
|
58704
58612
|
return [];
|
|
58705
58613
|
let { node, ancestors } = params.completionContext, parentNode = ancestors.at(-1), parentIsContentFor = parentNode?.type == liquid_html_parser_1.NodeTypes.ContentForMarkup, nodeIsVariableLookup = node?.type == liquid_html_parser_1.NodeTypes.VariableLookup;
|
|
@@ -58709,7 +58617,7 @@ var require_ContentForParameterCompletionProvider = __commonJS({
|
|
|
58709
58617
|
return [];
|
|
58710
58618
|
let completionItems = this.staticCompletions(node, parentNode.contentForType.value == "blocks", params.document);
|
|
58711
58619
|
if (parentNode.contentForType.value === "block") {
|
|
58712
|
-
let typeArg = (
|
|
58620
|
+
let typeArg = (_a42 = parentNode.args.find((arg) => arg.name === "type")) === null || _a42 === void 0 ? void 0 : _a42.value;
|
|
58713
58621
|
if (typeArg?.type === liquid_html_parser_1.NodeTypes.String) {
|
|
58714
58622
|
let snippetDefinition = await this.getDocDefinitionForURI(params.textDocument.uri, "blocks", typeArg.value);
|
|
58715
58623
|
completionItems.push(...this.liquidDocParameterCompletions(node, params.document, snippetDefinition));
|
|
@@ -58719,8 +58627,8 @@ var require_ContentForParameterCompletionProvider = __commonJS({
|
|
|
58719
58627
|
return completionItems.filter((item) => !existingParams.includes(item.label));
|
|
58720
58628
|
}
|
|
58721
58629
|
textEdit(node, document2, name, textTemplate = `${name}: '$1'`) {
|
|
58722
|
-
var
|
|
58723
|
-
let remainingText = document2.source.slice(node.position.end), match2 = remainingText.match(/^(.*?)\s*(?=,|\||-?\}\}|-?\%\})|^(.*)$/), offset = match2 ? match2[0].trimEnd().length : remainingText.length, existingParameterOffset = (_b = (
|
|
58630
|
+
var _a42, _b;
|
|
58631
|
+
let remainingText = document2.source.slice(node.position.end), match2 = remainingText.match(/^(.*?)\s*(?=,|\||-?\}\}|-?\%\})|^(.*)$/), offset = match2 ? match2[0].trimEnd().length : remainingText.length, existingParameterOffset = (_b = (_a42 = remainingText.match(/[^a-zA-Z]/)) === null || _a42 === void 0 ? void 0 : _a42.index) !== null && _b !== void 0 ? _b : remainingText.length, start = document2.textDocument.positionAt(node.position.start), end = document2.textDocument.positionAt(node.position.end + offset), newText = name === "closest" ? `${name}.` : textTemplate, format5 = name === "closest" ? vscode_languageserver_1.InsertTextFormat.PlainText : vscode_languageserver_1.InsertTextFormat.Snippet;
|
|
58724
58632
|
return node.name + remainingText.slice(0, existingParameterOffset) == name && (newText = name, format5 = vscode_languageserver_1.InsertTextFormat.PlainText, end = document2.textDocument.positionAt(node.position.end + existingParameterOffset)), node.name === params_1.CURSOR && (end = start, existingParameterOffset > 0 && (newText += ", ")), {
|
|
58725
58633
|
textEdit: vscode_languageserver_1.TextEdit.replace({
|
|
58726
58634
|
start,
|
|
@@ -58748,8 +58656,8 @@ var require_ContentForParameterCompletionProvider = __commonJS({
|
|
|
58748
58656
|
});
|
|
58749
58657
|
}
|
|
58750
58658
|
liquidDocParameterCompletions(node, document2, docDefinition) {
|
|
58751
|
-
var
|
|
58752
|
-
return (((
|
|
58659
|
+
var _a42;
|
|
58660
|
+
return (((_a42 = docDefinition?.liquidDoc) === null || _a42 === void 0 ? void 0 : _a42.parameters) || []).map((liquidDocParam) => {
|
|
58753
58661
|
let { textEdit, format: format5 } = this.textEdit(node, document2, liquidDocParam.name, (0, liquidDoc_1.getParameterCompletionTemplate)(liquidDocParam.name, liquidDocParam.type));
|
|
58754
58662
|
return {
|
|
58755
58663
|
label: liquidDocParam.name,
|
|
@@ -65592,10 +65500,10 @@ var require_HtmlTagCompletionProvider = __commonJS({
|
|
|
65592
65500
|
};
|
|
65593
65501
|
}
|
|
65594
65502
|
function grandParentCloseOption(grandParentNode) {
|
|
65595
|
-
var
|
|
65503
|
+
var _a42;
|
|
65596
65504
|
let grandParentName = getGrandParentName(grandParentNode);
|
|
65597
65505
|
return grandParentName ? [
|
|
65598
|
-
(
|
|
65506
|
+
(_a42 = docset_1.HtmlData.tags.find((tag) => tag.name === grandParentName)) !== null && _a42 !== void 0 ? _a42 : {
|
|
65599
65507
|
name: grandParentName,
|
|
65600
65508
|
description: "",
|
|
65601
65509
|
attributes: [],
|
|
@@ -65644,13 +65552,13 @@ var require_HtmlAttributeCompletionProvider = __commonJS({
|
|
|
65644
65552
|
// Find the range of the attribute partial. If the attribute contains any liquid code, the range
|
|
65645
65553
|
// will end before the first character of the liquid block.
|
|
65646
65554
|
attributeTagRange(node, document2) {
|
|
65647
|
-
var
|
|
65555
|
+
var _a42, _b;
|
|
65648
65556
|
if (node.type === "TextNode" && node.value === params_1.CURSOR)
|
|
65649
65557
|
return {
|
|
65650
65558
|
start: document2.textDocument.positionAt(node.position.start),
|
|
65651
65559
|
end: document2.textDocument.positionAt(node.position.start)
|
|
65652
65560
|
};
|
|
65653
|
-
let sourcePartialPastCursor = document2.source.slice(node.position.end), attributeEndOffset = (_b = (
|
|
65561
|
+
let sourcePartialPastCursor = document2.source.slice(node.position.end), attributeEndOffset = (_b = (_a42 = sourcePartialPastCursor.match(/[\s=]|\{%|\{\{|>/)) === null || _a42 === void 0 ? void 0 : _a42.index) !== null && _b !== void 0 ? _b : sourcePartialPastCursor.length;
|
|
65654
65562
|
return {
|
|
65655
65563
|
start: document2.textDocument.positionAt(node.position.start),
|
|
65656
65564
|
end: document2.textDocument.positionAt(node.position.end + attributeEndOffset)
|
|
@@ -65659,9 +65567,9 @@ var require_HtmlAttributeCompletionProvider = __commonJS({
|
|
|
65659
65567
|
};
|
|
65660
65568
|
exports2.HtmlAttributeCompletionProvider = HtmlAttributeCompletionProvider;
|
|
65661
65569
|
function getOptions(partial, parentNodeName) {
|
|
65662
|
-
var
|
|
65570
|
+
var _a42;
|
|
65663
65571
|
let tag = docset_1.HtmlData.tags.find((tag2) => tag2.name === parentNodeName);
|
|
65664
|
-
return [...(
|
|
65572
|
+
return [...(_a42 = tag?.attributes) !== null && _a42 !== void 0 ? _a42 : [], ...docset_1.HtmlData.globalAttributes].filter((x) => x.name.startsWith(partial));
|
|
65665
65573
|
}
|
|
65666
65574
|
function toCompletionItem(tag, attributeTagRange, hasExistingAttributeValue, hasLiquidTag) {
|
|
65667
65575
|
let insertSnippet = (!tag.valueSet || tag.valueSet !== "v") && !hasExistingAttributeValue && !hasLiquidTag;
|
|
@@ -65690,13 +65598,13 @@ var require_HtmlAttributeValueCompletionProvider = __commonJS({
|
|
|
65690
65598
|
constructor() {
|
|
65691
65599
|
}
|
|
65692
65600
|
async completions(params) {
|
|
65693
|
-
var
|
|
65601
|
+
var _a42, _b;
|
|
65694
65602
|
if (!params.completionContext)
|
|
65695
65603
|
return [];
|
|
65696
65604
|
let { node, ancestors } = params.completionContext, attributeNode = (0, utils_1.findLast)(ancestors, utils_1.isHtmlAttribute), tagNode = (0, utils_1.findLast)(ancestors, utils_1.isNamedHtmlElementNode);
|
|
65697
65605
|
if (!node || !attributeNode || !tagNode || !(0, utils_1.isTextNode)(node) || !(0, utils_1.isHtmlAttribute)(attributeNode) || !(0, utils_1.isNamedHtmlElementNode)(tagNode) || (0, utils_1.isAttrEmpty)(attributeNode) || !attributeNode.value.includes(node))
|
|
65698
65606
|
return [];
|
|
65699
|
-
let tagName = (0, utils_1.getCompoundName)(tagNode), attrName = (0, utils_1.getCompoundName)(attributeNode), partial = node.value.replace(params_1.CURSOR, ""), tagEntry = docset_1.HtmlData.tags.find((tag) => tag.name === tagName), attribute = (
|
|
65607
|
+
let tagName = (0, utils_1.getCompoundName)(tagNode), attrName = (0, utils_1.getCompoundName)(attributeNode), partial = node.value.replace(params_1.CURSOR, ""), tagEntry = docset_1.HtmlData.tags.find((tag) => tag.name === tagName), attribute = (_a42 = docset_1.HtmlData.globalAttributes.find((attr) => attr.name === attrName)) !== null && _a42 !== void 0 ? _a42 : tagEntry?.attributes.find((attr) => attr.name === attrName), valueSetName = attribute?.valueSet, valueSetEntry = docset_1.HtmlData.valueSets.find((valueSet) => valueSet.name === valueSetName);
|
|
65700
65608
|
return ((_b = valueSetEntry?.values) !== null && _b !== void 0 ? _b : []).filter((value) => value.name.startsWith(partial)).sort(common_1.sortByName).map((option) => toCompletionItem(option, attribute && "references" in attribute ? attribute : tagEntry));
|
|
65701
65609
|
}
|
|
65702
65610
|
};
|
|
@@ -65725,8 +65633,8 @@ var require_FilterCompletionProvider = __commonJS({
|
|
|
65725
65633
|
constructor(typeSystem) {
|
|
65726
65634
|
this.typeSystem = typeSystem, this.options = (0, utils_1.memoize)(async (inputType) => {
|
|
65727
65635
|
let filterEntries = await this.typeSystem.filterEntries(), options = filterEntries.filter((entry) => {
|
|
65728
|
-
var
|
|
65729
|
-
return (
|
|
65636
|
+
var _a42;
|
|
65637
|
+
return (_a42 = entry.syntax) === null || _a42 === void 0 ? void 0 : _a42.startsWith(inputType);
|
|
65730
65638
|
}).sort(common_1.sortByName);
|
|
65731
65639
|
if (inputType === "variable") {
|
|
65732
65640
|
let entriesWithoutSyntax = filterEntries.filter((entry) => !entry.syntax);
|
|
@@ -65761,8 +65669,8 @@ var require_FilterCompletionProvider = __commonJS({
|
|
|
65761
65669
|
});
|
|
65762
65670
|
}
|
|
65763
65671
|
textEdit(node, document2, entry) {
|
|
65764
|
-
var
|
|
65765
|
-
let remainingText = document2.source.slice(node.position.end), matchEndOfFilter = remainingText.match(/^(.*?)\s*(?=\||-?\}\}|-?\%\})|^(.*)$/), endOffset = matchEndOfFilter ? matchEndOfFilter[1].length : remainingText.length, pipeRegex = new RegExp(`(\\s*\\|\\s*)(?:${node.name}(?:\\}|\\%)\\})`), matchFilterPipe = node.source.match(pipeRegex), startOffet = matchFilterPipe ? matchFilterPipe[1].length : 0, start = document2.textDocument.positionAt(node.position.start + startOffet), end = document2.textDocument.positionAt(node.position.end + endOffset), { insertText, insertStyle } = appendRequiredParemeters(entry), newText = insertText, format5 = insertStyle, existingFilterOffset = (_b = (
|
|
65672
|
+
var _a42, _b;
|
|
65673
|
+
let remainingText = document2.source.slice(node.position.end), matchEndOfFilter = remainingText.match(/^(.*?)\s*(?=\||-?\}\}|-?\%\})|^(.*)$/), endOffset = matchEndOfFilter ? matchEndOfFilter[1].length : remainingText.length, pipeRegex = new RegExp(`(\\s*\\|\\s*)(?:${node.name}(?:\\}|\\%)\\})`), matchFilterPipe = node.source.match(pipeRegex), startOffet = matchFilterPipe ? matchFilterPipe[1].length : 0, start = document2.textDocument.positionAt(node.position.start + startOffet), end = document2.textDocument.positionAt(node.position.end + endOffset), { insertText, insertStyle } = appendRequiredParemeters(entry), newText = insertText, format5 = insertStyle, existingFilterOffset = (_b = (_a42 = remainingText.match(/[^a-zA-Z_]/)) === null || _a42 === void 0 ? void 0 : _a42.index) !== null && _b !== void 0 ? _b : remainingText.length;
|
|
65766
65674
|
return node.name + remainingText.slice(0, existingFilterOffset) === entry.name && (newText = entry.name, format5 = vscode_languageserver_1.InsertTextFormat.PlainText, end = document2.textDocument.positionAt(node.position.end + existingFilterOffset)), node.name === params_1.CURSOR && (end = start), {
|
|
65767
65675
|
textEdit: vscode_languageserver_1.TextEdit.replace({
|
|
65768
65676
|
start,
|
|
@@ -65777,9 +65685,9 @@ var require_FilterCompletionProvider = __commonJS({
|
|
|
65777
65685
|
return { ...entry, deprioritized: !0 };
|
|
65778
65686
|
}
|
|
65779
65687
|
function appendRequiredParemeters(entry) {
|
|
65780
|
-
var
|
|
65688
|
+
var _a42;
|
|
65781
65689
|
let insertText = entry.name, insertStyle = vscode_languageserver_1.InsertTextFormat.PlainText;
|
|
65782
|
-
if (!(!((
|
|
65690
|
+
if (!(!((_a42 = entry?.parameters) === null || _a42 === void 0) && _a42.length))
|
|
65783
65691
|
return { insertText, insertStyle };
|
|
65784
65692
|
let requiredPositionalParams = entry.parameters.filter((p) => p.required && p.positional).map(formatParameter), requiredNamedParams = entry.parameters.filter((p) => p.required && !p.positional).map(formatParameter);
|
|
65785
65693
|
return requiredPositionalParams.length && (insertText += `: ${requiredPositionalParams.join(", ")}`, insertStyle = vscode_languageserver_1.InsertTextFormat.Snippet), requiredNamedParams.length && (insertText += `: ${requiredNamedParams.join(", ")}`, insertStyle = vscode_languageserver_1.InsertTextFormat.Snippet), {
|
|
@@ -65833,8 +65741,8 @@ var require_FilterNamedParameterCompletionProvider = __commonJS({
|
|
|
65833
65741
|
}) : [];
|
|
65834
65742
|
}
|
|
65835
65743
|
textEdit(node, document2, name, type) {
|
|
65836
|
-
var
|
|
65837
|
-
let remainingText = document2.source.slice(node.position.end), match2 = remainingText.match(/^(.*?)\s*(?=,|\||-?\}\}|-?\%\})|^(.*)$/), offset = match2 ? match2[0].length : remainingText.length, existingParameterOffset = (_b = (
|
|
65744
|
+
var _a42, _b;
|
|
65745
|
+
let remainingText = document2.source.slice(node.position.end), match2 = remainingText.match(/^(.*?)\s*(?=,|\||-?\}\}|-?\%\})|^(.*)$/), offset = match2 ? match2[0].length : remainingText.length, existingParameterOffset = (_b = (_a42 = remainingText.match(/[^a-zA-Z]/)) === null || _a42 === void 0 ? void 0 : _a42.index) !== null && _b !== void 0 ? _b : remainingText.length, start = document2.textDocument.positionAt(node.position.start), end = document2.textDocument.positionAt(node.position.end + offset), newText = type === "string" ? `${name}: '$1'` : `${name}: `, format5 = type === "string" ? vscode_languageserver_1.InsertTextFormat.Snippet : vscode_languageserver_1.InsertTextFormat.PlainText;
|
|
65838
65746
|
return node.name + remainingText.slice(0, existingParameterOffset) == name && (newText = name, format5 = vscode_languageserver_1.InsertTextFormat.PlainText, end = document2.textDocument.positionAt(node.position.end + existingParameterOffset)), node.name === "\u2588" && (end = start), {
|
|
65839
65747
|
textEdit: vscode_languageserver_1.TextEdit.replace({
|
|
65840
65748
|
start,
|
|
@@ -65944,8 +65852,8 @@ var require_LiquidTagsCompletionProvider = __commonJS({
|
|
|
65944
65852
|
return textDocument.getText(vscode_languageserver_1.Range.create(startPosition, endPosition)).trim() !== "";
|
|
65945
65853
|
}
|
|
65946
65854
|
function withCorrectWhitespaceStrippingCharacters(snippet, whitespaceStart, whitespaceEnd) {
|
|
65947
|
-
var
|
|
65948
|
-
let starti = 0, endi = 0, countOfEndTags = (_b = (
|
|
65855
|
+
var _a42, _b;
|
|
65856
|
+
let starti = 0, endi = 0, countOfEndTags = (_b = (_a42 = snippet.match(/%\}/g)) === null || _a42 === void 0 ? void 0 : _a42.length) !== null && _b !== void 0 ? _b : 0;
|
|
65949
65857
|
return snippet = snippet.replace(/\{%/g, () => starti++ === 0 ? "{%" + whitespaceStart : "{%" + whitespaceEnd).replace(/%\}/g, () => countOfEndTags > 1 && endi++ === countOfEndTags - 1 ? whitespaceStart + "%}" : whitespaceEnd + "%}"), snippet;
|
|
65950
65858
|
}
|
|
65951
65859
|
function findEndOfBlockStart(context, node, isInLiquidLiquidTag) {
|
|
@@ -65984,7 +65892,7 @@ var require_ObjectAttributeCompletionProvider = __commonJS({
|
|
|
65984
65892
|
this.typeSystem = typeSystem, this.getThemeSettingsSchema = getThemeSettingsSchema;
|
|
65985
65893
|
}
|
|
65986
65894
|
async completions(params) {
|
|
65987
|
-
var
|
|
65895
|
+
var _a42;
|
|
65988
65896
|
if (!params.completionContext)
|
|
65989
65897
|
return [];
|
|
65990
65898
|
let { partialAst, node } = params.completionContext;
|
|
@@ -66002,7 +65910,7 @@ var require_ObjectAttributeCompletionProvider = __commonJS({
|
|
|
66002
65910
|
return completionItems(ArrayCoreProperties.map((name) => ({ name })), partial);
|
|
66003
65911
|
if (parentType === "string")
|
|
66004
65912
|
return completionItems(StringCoreProperties.map((name) => ({ name })), partial);
|
|
66005
|
-
let parentTypeProperties = ((
|
|
65913
|
+
let parentTypeProperties = ((_a42 = (await this.typeSystem.objectMap(params.textDocument.uri, partialAst))[parentType]) === null || _a42 === void 0 ? void 0 : _a42.properties) || [];
|
|
66006
65914
|
return completionItems(parentTypeProperties, partial);
|
|
66007
65915
|
}
|
|
66008
65916
|
};
|
|
@@ -66127,8 +66035,8 @@ var require_TranslationCompletionProvider = __commonJS({
|
|
|
66127
66035
|
if (!node || node.type !== liquid_html_parser_1.NodeTypes.String || !parentNode || parentNode.type !== liquid_html_parser_1.NodeTypes.LiquidVariable || !document2)
|
|
66128
66036
|
return [];
|
|
66129
66037
|
let ast = document2.ast, textDocument = document2.textDocument, translations = await this.getTranslationsForURI(params.textDocument.uri), partial = node.value, options = (0, translations_1.translationOptions)(translations).filter((option) => {
|
|
66130
|
-
var
|
|
66131
|
-
return !(!((
|
|
66038
|
+
var _a42;
|
|
66039
|
+
return !(!((_a42 = option.path[0]) === null || _a42 === void 0) && _a42.startsWith("shopify")) || partial.startsWith("shopify");
|
|
66132
66040
|
}), [_currentNode, realAncestors] = ast instanceof Error ? [null, []] : (0, theme_check_common_1.findCurrentNode)(ast, textDocument.offsetAt(params.position)), realParentNode = realAncestors.at(-1), shouldAppendTranslateFilter = realParentNode?.type === liquid_html_parser_1.NodeTypes.LiquidVariable && realParentNode?.filters.length === 0, quote = node.single ? "'" : '"', postFix = quote + " | t", replaceRange;
|
|
66133
66041
|
shouldAppendTranslateFilter ? (postFix = quote + " | t", replaceRange = {
|
|
66134
66042
|
start: textDocument.positionAt(node.position.start + 1),
|
|
@@ -66141,8 +66049,8 @@ var require_TranslationCompletionProvider = __commonJS({
|
|
|
66141
66049
|
});
|
|
66142
66050
|
let insertTextStartIndex = partial.lastIndexOf(".") + 1;
|
|
66143
66051
|
return options.map(({ path, translation }) => {
|
|
66144
|
-
var
|
|
66145
|
-
let params2 = (0, translations_1.extractParams)(typeof translation == "string" ? translation : (
|
|
66052
|
+
var _a42;
|
|
66053
|
+
let params2 = (0, translations_1.extractParams)(typeof translation == "string" ? translation : (_a42 = Object.values(translation)[0]) !== null && _a42 !== void 0 ? _a42 : ""), parameters = (0, translations_1.paramsString)(params2);
|
|
66146
66054
|
return {
|
|
66147
66055
|
label: quote + path.join(".") + quote + " | t",
|
|
66148
66056
|
insertText: path.join(".").slice(insertTextStartIndex),
|
|
@@ -66204,13 +66112,13 @@ var require_RenderSnippetParameterCompletionProvider = __commonJS({
|
|
|
66204
66112
|
this.getDocDefinitionForURI = getDocDefinitionForURI;
|
|
66205
66113
|
}
|
|
66206
66114
|
async completions(params) {
|
|
66207
|
-
var
|
|
66115
|
+
var _a42, _b;
|
|
66208
66116
|
if (!params.completionContext)
|
|
66209
66117
|
return [];
|
|
66210
66118
|
let { node, ancestors } = params.completionContext, parentNode = ancestors.at(-1);
|
|
66211
66119
|
if (!node || !parentNode || node.type !== liquid_html_parser_1.NodeTypes.VariableLookup || parentNode.type !== liquid_html_parser_1.NodeTypes.RenderMarkup || parentNode.snippet.type !== "String")
|
|
66212
66120
|
return [];
|
|
66213
|
-
let userInputStr = ((
|
|
66121
|
+
let userInputStr = ((_a42 = node.name) === null || _a42 === void 0 ? void 0 : _a42.replace(params_1.CURSOR, "")) || "", snippetDefinition = await this.getDocDefinitionForURI(params.textDocument.uri, "snippets", parentNode.snippet.value), liquidDocParams = (_b = snippetDefinition?.liquidDoc) === null || _b === void 0 ? void 0 : _b.parameters;
|
|
66214
66122
|
if (!liquidDocParams)
|
|
66215
66123
|
return [];
|
|
66216
66124
|
let offset = node.name === params_1.CURSOR ? 1 : 0, start = params.document.textDocument.positionAt(node.position.start), end = params.document.textDocument.positionAt(node.position.end - offset), existingRenderParams = parentNode.args.filter((arg) => arg.type === liquid_html_parser_1.NodeTypes.NamedArgument).map((arg) => arg.name);
|
|
@@ -66241,7 +66149,7 @@ var require_LiquidDocTagCompletionProvider = __commonJS({
|
|
|
66241
66149
|
constructor() {
|
|
66242
66150
|
}
|
|
66243
66151
|
async completions(params) {
|
|
66244
|
-
var
|
|
66152
|
+
var _a42;
|
|
66245
66153
|
if (!params.completionContext)
|
|
66246
66154
|
return [];
|
|
66247
66155
|
if (!(0, theme_check_common_1.filePathSupportsLiquidDoc)(params.document.uri))
|
|
@@ -66255,8 +66163,8 @@ var require_LiquidDocTagCompletionProvider = __commonJS({
|
|
|
66255
66163
|
case liquid_html_parser_1.NodeTypes.LiquidDocDescriptionNode:
|
|
66256
66164
|
case liquid_html_parser_1.NodeTypes.LiquidDocExampleNode:
|
|
66257
66165
|
case liquid_html_parser_1.NodeTypes.LiquidDocPromptNode:
|
|
66258
|
-
let lastLine = (
|
|
66259
|
-
`).at(-1)) === null ||
|
|
66166
|
+
let lastLine = (_a42 = node.content.value.split(`
|
|
66167
|
+
`).at(-1)) === null || _a42 === void 0 ? void 0 : _a42.trim();
|
|
66260
66168
|
return lastLine?.startsWith("@") ? this.createCompletionItems(lastLine) : [];
|
|
66261
66169
|
default:
|
|
66262
66170
|
return [];
|
|
@@ -101812,8 +101720,8 @@ var require_TranslationStringDefinitionProvider = __commonJS({
|
|
|
101812
101720
|
this.documentManager = documentManager, this.getDefaultLocaleSourceCode = getDefaultLocaleSourceCode;
|
|
101813
101721
|
}
|
|
101814
101722
|
async definitions(params, node, ancestors) {
|
|
101815
|
-
var
|
|
101816
|
-
let doc = (
|
|
101723
|
+
var _a42;
|
|
101724
|
+
let doc = (_a42 = this.documentManager.get(params.textDocument.uri)) === null || _a42 === void 0 ? void 0 : _a42.textDocument;
|
|
101817
101725
|
if (!doc)
|
|
101818
101726
|
return [];
|
|
101819
101727
|
if (node.type !== liquid_html_parser_1.NodeTypes.String)
|
|
@@ -102095,8 +102003,8 @@ var require_HtmlTagNameDocumentHighlightsProvider = __commonJS({
|
|
|
102095
102003
|
this.documentManager = documentManager;
|
|
102096
102004
|
}
|
|
102097
102005
|
async documentHighlights(node, ancestors, params) {
|
|
102098
|
-
var
|
|
102099
|
-
let textDocument = (
|
|
102006
|
+
var _a42;
|
|
102007
|
+
let textDocument = (_a42 = this.documentManager.get(params.textDocument.uri)) === null || _a42 === void 0 ? void 0 : _a42.textDocument;
|
|
102100
102008
|
if (!textDocument)
|
|
102101
102009
|
return null;
|
|
102102
102010
|
let ranges = (0, htmlTagNames_1.getHtmlElementNameRanges)(node, ancestors, params, textDocument);
|
|
@@ -102119,8 +102027,8 @@ var require_LiquidBlockTagDocumentHighlightsProvider = __commonJS({
|
|
|
102119
102027
|
this.documentManager = documentManager;
|
|
102120
102028
|
}
|
|
102121
102029
|
async documentHighlights(node, ancestors, params) {
|
|
102122
|
-
var
|
|
102123
|
-
let textDocument = (
|
|
102030
|
+
var _a42;
|
|
102031
|
+
let textDocument = (_a42 = this.documentManager.get(params.textDocument.uri)) === null || _a42 === void 0 ? void 0 : _a42.textDocument;
|
|
102124
102032
|
if (!textDocument || (isLiquidBranch(node) && (node = ancestors.at(-1)), !isLiquidBlock(node) || !node.blockEndPosition))
|
|
102125
102033
|
return null;
|
|
102126
102034
|
let nameOffset = node.source.indexOf(node.name, node.blockStartPosition.start), endblockNameOffset = node.source.indexOf("end" + node.name, node.blockEndPosition.start), ranges = [
|
|
@@ -102187,12 +102095,12 @@ var require_DocumentHighlightsProvider = __commonJS({
|
|
|
102187
102095
|
];
|
|
102188
102096
|
}
|
|
102189
102097
|
async documentHighlights(params) {
|
|
102190
|
-
var
|
|
102098
|
+
var _a42;
|
|
102191
102099
|
let document2 = this.documentManager.get(params.textDocument.uri);
|
|
102192
102100
|
if (!document2 || document2.type !== theme_check_common_1.SourceCodeType.LiquidHtml || document2.ast instanceof Error)
|
|
102193
102101
|
return exports2.PREVENT_DEFAULT;
|
|
102194
102102
|
let [currentNode, ancestors] = (0, theme_check_common_2.findCurrentNode)(document2.ast, document2.textDocument.offsetAt(params.position)), promises = this.providers.map((p) => p.documentHighlights(currentNode, ancestors, params).catch(() => null));
|
|
102195
|
-
return (
|
|
102103
|
+
return (_a42 = (await Promise.all(promises)).find(Boolean)) !== null && _a42 !== void 0 ? _a42 : exports2.PREVENT_DEFAULT;
|
|
102196
102104
|
}
|
|
102197
102105
|
};
|
|
102198
102106
|
exports2.DocumentHighlightsProvider = DocumentHighlightsProvider;
|
|
@@ -102400,11 +102308,11 @@ var require_DocumentManager = __commonJS({
|
|
|
102400
102308
|
uri = theme_check_common_1.path.normalize(uri), !(!/\.(json|liquid)$/.test(uri) || /\.(s?css|js).liquid$/.test(uri)) && this.sourceCodes.set(uri, this.augmentedSourceCode(uri, source, version));
|
|
102401
102309
|
}
|
|
102402
102310
|
augmentedSourceCode(uri, source, version) {
|
|
102403
|
-
var
|
|
102311
|
+
var _a42;
|
|
102404
102312
|
let sourceCode = (0, theme_check_common_1.toSourceCode)(uri, source, version), textDocument = vscode_languageserver_textdocument_1.TextDocument.create(
|
|
102405
102313
|
uri,
|
|
102406
102314
|
sourceCode.type,
|
|
102407
|
-
(
|
|
102315
|
+
(_a42 = sourceCode.version) !== null && _a42 !== void 0 ? _a42 : 0,
|
|
102408
102316
|
// create doesn't let us put undefined here.
|
|
102409
102317
|
sourceCode.source
|
|
102410
102318
|
);
|
|
@@ -102623,14 +102531,14 @@ var require_HtmlElementAutoclosingOnTypeFormattingProvider = __commonJS({
|
|
|
102623
102531
|
};
|
|
102624
102532
|
exports2.HtmlElementAutoclosingOnTypeFormattingProvider = HtmlElementAutoclosingOnTypeFormattingProvider;
|
|
102625
102533
|
function nodeAtCursor(textDocument, position) {
|
|
102626
|
-
var
|
|
102534
|
+
var _a42;
|
|
102627
102535
|
let text = textDocument.getText(vscode_languageserver_protocol_1.Range.create(vscode_languageserver_protocol_1.Position.create(0, 0), position));
|
|
102628
102536
|
try {
|
|
102629
102537
|
let ast = (0, liquid_html_parser_1.toLiquidHtmlAST)(text, {
|
|
102630
102538
|
allowUnclosedDocumentNode: !0,
|
|
102631
102539
|
mode: "tolerant"
|
|
102632
102540
|
}), [node, ancestors] = (0, theme_check_common_1.findCurrentNode)(ast, textDocument.offsetAt(position));
|
|
102633
|
-
return ((
|
|
102541
|
+
return ((_a42 = ancestors.at(-1)) === null || _a42 === void 0 ? void 0 : _a42.type) === liquid_html_parser_1.NodeTypes.HtmlElement || node.type === liquid_html_parser_1.NodeTypes.LiquidBranch ? ancestors.at(-1) : node;
|
|
102634
102542
|
} catch {
|
|
102635
102543
|
return null;
|
|
102636
102544
|
}
|
|
@@ -102660,9 +102568,9 @@ var require_OnTypeFormattingProvider = __commonJS({
|
|
|
102660
102568
|
];
|
|
102661
102569
|
}
|
|
102662
102570
|
async onTypeFormatting(params) {
|
|
102663
|
-
var
|
|
102571
|
+
var _a42;
|
|
102664
102572
|
let document2 = this.documentManager.get(params.textDocument.uri);
|
|
102665
|
-
return document2 && (
|
|
102573
|
+
return document2 && (_a42 = this.providers.map((provider) => provider.onTypeFormatting(document2, params)).find((result) => result !== null)) !== null && _a42 !== void 0 ? _a42 : null;
|
|
102666
102574
|
}
|
|
102667
102575
|
};
|
|
102668
102576
|
exports2.OnTypeFormattingProvider = OnTypeFormattingProvider;
|
|
@@ -102749,14 +102657,14 @@ var require_LiquidFilterArgumentHoverProvider = __commonJS({
|
|
|
102749
102657
|
this.themeDocset = themeDocset;
|
|
102750
102658
|
}
|
|
102751
102659
|
async hover(currentNode, ancestors) {
|
|
102752
|
-
var
|
|
102660
|
+
var _a42;
|
|
102753
102661
|
let parentNode = ancestors.at(-1);
|
|
102754
102662
|
if (!parentNode || parentNode.type !== liquid_html_parser_1.NodeTypes.LiquidFilter || currentNode.type !== liquid_html_parser_1.NodeTypes.NamedArgument)
|
|
102755
102663
|
return null;
|
|
102756
102664
|
let parentName = parentNode.name, entry = (await this.themeDocset.filters()).find((entry2) => entry2.name === parentName);
|
|
102757
102665
|
if (!entry)
|
|
102758
102666
|
return null;
|
|
102759
|
-
let argument = (
|
|
102667
|
+
let argument = (_a42 = entry.parameters) === null || _a42 === void 0 ? void 0 : _a42.find((argument2) => argument2.name === currentNode.name);
|
|
102760
102668
|
return argument ? {
|
|
102761
102669
|
contents: {
|
|
102762
102670
|
kind: "markdown",
|
|
@@ -102781,7 +102689,7 @@ var require_LiquidObjectHoverProvider = __commonJS({
|
|
|
102781
102689
|
this.typeSystem = typeSystem;
|
|
102782
102690
|
}
|
|
102783
102691
|
async hover(currentNode, ancestors, params) {
|
|
102784
|
-
var
|
|
102692
|
+
var _a42;
|
|
102785
102693
|
if (currentNode.type !== liquid_html_parser_1.NodeTypes.VariableLookup && currentNode.type !== liquid_html_parser_1.NodeTypes.AssignMarkup || !currentNode.name)
|
|
102786
102694
|
return null;
|
|
102787
102695
|
let node = currentNode;
|
|
@@ -102793,7 +102701,7 @@ var require_LiquidObjectHoverProvider = __commonJS({
|
|
|
102793
102701
|
if (type === TypeSystem_1.Unknown)
|
|
102794
102702
|
return null;
|
|
102795
102703
|
if (!entry) {
|
|
102796
|
-
let entryByName = (
|
|
102704
|
+
let entryByName = (_a42 = objectMap[currentNode.name]) !== null && _a42 !== void 0 ? _a42 : {};
|
|
102797
102705
|
return {
|
|
102798
102706
|
contents: {
|
|
102799
102707
|
kind: "markdown",
|
|
@@ -102828,7 +102736,7 @@ var require_LiquidObjectAttributeHoverProvider = __commonJS({
|
|
|
102828
102736
|
this.typeSystem = typeSystem;
|
|
102829
102737
|
}
|
|
102830
102738
|
async hover(currentNode, ancestors, params) {
|
|
102831
|
-
var
|
|
102739
|
+
var _a42, _b;
|
|
102832
102740
|
let parentNode = ancestors.at(-1), uri = params.textDocument.uri;
|
|
102833
102741
|
if (currentNode.type !== liquid_html_parser_1.NodeTypes.String || !parentNode || parentNode.type !== liquid_html_parser_1.NodeTypes.VariableLookup || !parentNode.lookups.includes(currentNode))
|
|
102834
102742
|
return null;
|
|
@@ -102840,7 +102748,7 @@ var require_LiquidObjectAttributeHoverProvider = __commonJS({
|
|
|
102840
102748
|
let nodeType = await this.typeSystem.inferType({ ...parentNode, lookups: parentNode.lookups.slice(0, lookupIndex + 1) }, ancestors[0], uri);
|
|
102841
102749
|
if ((0, TypeSystem_1.isArrayType)(nodeType) || nodeType === TypeSystem_1.Unknown)
|
|
102842
102750
|
return null;
|
|
102843
|
-
let entry2 = { ...(
|
|
102751
|
+
let entry2 = { ...(_a42 = objectMap[nodeType]) !== null && _a42 !== void 0 ? _a42 : {}, name: currentNode.value };
|
|
102844
102752
|
return {
|
|
102845
102753
|
contents: {
|
|
102846
102754
|
kind: "markdown",
|
|
@@ -102897,11 +102805,11 @@ var require_HtmlAttributeHoverProvider = __commonJS({
|
|
|
102897
102805
|
exports2.HtmlAttributeHoverProvider = void 0;
|
|
102898
102806
|
var docset_1 = require_docset(), utils_1 = require_utils8(), HtmlAttributeHoverProvider = class {
|
|
102899
102807
|
async hover(currentNode, ancestors) {
|
|
102900
|
-
var
|
|
102808
|
+
var _a42;
|
|
102901
102809
|
let attributeNode = ancestors.at(-1), tagNode = (0, utils_1.findLast)(ancestors, utils_1.isNamedHtmlElementNode);
|
|
102902
102810
|
if (!attributeNode || !tagNode || !(0, utils_1.isTextNode)(currentNode) || !(0, utils_1.isHtmlAttribute)(attributeNode) || !attributeNode.name.includes(currentNode) || attributeNode.name.length > 1 || !(0, utils_1.isNamedHtmlElementNode)(tagNode))
|
|
102903
102811
|
return null;
|
|
102904
|
-
let name = currentNode.value, tagName = (0, utils_1.getCompoundName)(tagNode), tagEntry = docset_1.HtmlData.tags.find((tag) => tag.name === tagName), tagEntryAttributes = tagEntry?.attributes || [], attribute = (
|
|
102812
|
+
let name = currentNode.value, tagName = (0, utils_1.getCompoundName)(tagNode), tagEntry = docset_1.HtmlData.tags.find((tag) => tag.name === tagName), tagEntryAttributes = tagEntry?.attributes || [], attribute = (_a42 = docset_1.HtmlData.globalAttributes.find((attr) => attr.name === name)) !== null && _a42 !== void 0 ? _a42 : tagEntryAttributes.find((attr) => attr.name === name);
|
|
102905
102813
|
return attribute ? {
|
|
102906
102814
|
contents: {
|
|
102907
102815
|
kind: "markdown",
|
|
@@ -102923,11 +102831,11 @@ var require_HtmlAttributeValueHoverProvider = __commonJS({
|
|
|
102923
102831
|
exports2.HtmlAttributeValueHoverProvider = void 0;
|
|
102924
102832
|
var liquid_html_parser_1 = require_dist(), docset_1 = require_docset(), utils_1 = require_utils8(), HtmlAttributeValueHoverProvider = class {
|
|
102925
102833
|
async hover(currentNode, ancestors) {
|
|
102926
|
-
var
|
|
102834
|
+
var _a42;
|
|
102927
102835
|
let attributeNode = (0, utils_1.findLast)(ancestors, utils_1.isHtmlAttribute), tagNode = (0, utils_1.findLast)(ancestors, utils_1.isNamedHtmlElementNode);
|
|
102928
102836
|
if (!(0, utils_1.isTextNode)(currentNode) || !attributeNode || !tagNode || !(0, utils_1.isHtmlAttribute)(attributeNode) || !(0, utils_1.isNamedHtmlElementNode)(tagNode) || attributeNode.type === liquid_html_parser_1.NodeTypes.AttrEmpty || attributeNode.value.length !== 1 || !attributeNode.value.includes(currentNode))
|
|
102929
102837
|
return null;
|
|
102930
|
-
let valueName = currentNode.value, attrName = (0, utils_1.getCompoundName)(attributeNode), tagName = (0, utils_1.getCompoundName)(tagNode), tagEntry = docset_1.HtmlData.tags.find((tag) => tag.name === tagName), attribute = (
|
|
102838
|
+
let valueName = currentNode.value, attrName = (0, utils_1.getCompoundName)(attributeNode), tagName = (0, utils_1.getCompoundName)(tagNode), tagEntry = docset_1.HtmlData.tags.find((tag) => tag.name === tagName), attribute = (_a42 = docset_1.HtmlData.globalAttributes.find((attr) => attr.name === attrName)) !== null && _a42 !== void 0 ? _a42 : tagEntry?.attributes.find((attr) => attr.name === attrName), valueSetName = attribute?.valueSet, valueSetEntry = docset_1.HtmlData.valueSets.find((valueSet) => valueSet.name === valueSetName), valueEntry = valueSetEntry?.values.find((value) => value.name === valueName);
|
|
102931
102839
|
return valueEntry ? {
|
|
102932
102840
|
contents: {
|
|
102933
102841
|
kind: "markdown",
|
|
@@ -102952,11 +102860,11 @@ var require_TranslationHoverProvider = __commonJS({
|
|
|
102952
102860
|
this.getTranslationsForUri = getTranslationsForUri, this.documentManager = documentManager;
|
|
102953
102861
|
}
|
|
102954
102862
|
async hover(currentNode, ancestors, params) {
|
|
102955
|
-
var
|
|
102863
|
+
var _a42;
|
|
102956
102864
|
let parentNode = ancestors.at(-1);
|
|
102957
102865
|
if (currentNode.type !== liquid_html_parser_1.NodeTypes.String || !parentNode || parentNode.type !== liquid_html_parser_1.NodeTypes.LiquidVariable || !parentNode.filters[0] || !["t", "translate"].includes(parentNode.filters[0].name))
|
|
102958
102866
|
return null;
|
|
102959
|
-
let translations = await this.getTranslationsForUri(params.textDocument.uri), translation = (0, translations_1.translationValue)(currentNode.value, translations), document2 = (
|
|
102867
|
+
let translations = await this.getTranslationsForUri(params.textDocument.uri), translation = (0, translations_1.translationValue)(currentNode.value, translations), document2 = (_a42 = this.documentManager.get(params.textDocument.uri)) === null || _a42 === void 0 ? void 0 : _a42.textDocument;
|
|
102960
102868
|
return !translation || !document2 ? null : {
|
|
102961
102869
|
contents: {
|
|
102962
102870
|
kind: "markdown",
|
|
@@ -103013,11 +102921,11 @@ var require_RenderSnippetParameterHoverProvider = __commonJS({
|
|
|
103013
102921
|
this.getDocDefinitionForURI = getDocDefinitionForURI;
|
|
103014
102922
|
}
|
|
103015
102923
|
async hover(currentNode, ancestors, params) {
|
|
103016
|
-
var
|
|
102924
|
+
var _a42, _b;
|
|
103017
102925
|
let parentNode = ancestors.at(-1);
|
|
103018
102926
|
if (currentNode.type !== liquid_html_parser_1.NodeTypes.NamedArgument || !parentNode || parentNode.type !== liquid_html_parser_1.NodeTypes.RenderMarkup || parentNode.snippet.type !== liquid_html_parser_1.NodeTypes.String)
|
|
103019
102927
|
return null;
|
|
103020
|
-
let docDefinition = await this.getDocDefinitionForURI(params.textDocument.uri, "snippets", parentNode.snippet.value), paramName = currentNode.name, hoveredParameter = (_b = (
|
|
102928
|
+
let docDefinition = await this.getDocDefinitionForURI(params.textDocument.uri, "snippets", parentNode.snippet.value), paramName = currentNode.name, hoveredParameter = (_b = (_a42 = docDefinition?.liquidDoc) === null || _a42 === void 0 ? void 0 : _a42.parameters) === null || _b === void 0 ? void 0 : _b.find((parameter) => parameter.name === paramName);
|
|
103021
102929
|
return hoveredParameter ? {
|
|
103022
102930
|
contents: {
|
|
103023
102931
|
kind: "markdown",
|
|
@@ -103096,11 +103004,11 @@ var require_LiquidDocTagHoverProvider = __commonJS({
|
|
|
103096
103004
|
this.documentManager = documentManager;
|
|
103097
103005
|
}
|
|
103098
103006
|
async hover(currentNode, ancestors, params) {
|
|
103099
|
-
var
|
|
103007
|
+
var _a42;
|
|
103100
103008
|
let parentNode = ancestors.at(-1);
|
|
103101
103009
|
if (currentNode.type !== liquid_html_parser_1.NodeTypes.LiquidDocParamNode && currentNode.type !== liquid_html_parser_1.NodeTypes.LiquidDocDescriptionNode && currentNode.type !== liquid_html_parser_1.NodeTypes.LiquidDocExampleNode)
|
|
103102
103010
|
return null;
|
|
103103
|
-
let document2 = (
|
|
103011
|
+
let document2 = (_a42 = this.documentManager.get(params.textDocument.uri)) === null || _a42 === void 0 ? void 0 : _a42.textDocument;
|
|
103104
103012
|
if (document2 && document2.offsetAt(params.position) > currentNode.position.start + currentNode.name.length)
|
|
103105
103013
|
return null;
|
|
103106
103014
|
let docTagData = liquidDoc_1.SUPPORTED_LIQUID_DOC_TAG_HANDLES[currentNode.name];
|
|
@@ -103128,14 +103036,14 @@ var require_ContentForArgumentHoverProvider = __commonJS({
|
|
|
103128
103036
|
this.getDocDefinitionForURI = getDocDefinitionForURI;
|
|
103129
103037
|
}
|
|
103130
103038
|
async hover(currentNode, ancestors, params) {
|
|
103131
|
-
var
|
|
103039
|
+
var _a42, _b;
|
|
103132
103040
|
let parentNode = ancestors.at(-1);
|
|
103133
103041
|
if (currentNode.type !== liquid_html_parser_1.NodeTypes.NamedArgument || !parentNode || parentNode.type !== liquid_html_parser_1.NodeTypes.ContentForMarkup || parentNode.contentForType.type !== liquid_html_parser_1.NodeTypes.String)
|
|
103134
103042
|
return null;
|
|
103135
103043
|
let blockName = (0, theme_check_common_1.getBlockName)(parentNode);
|
|
103136
103044
|
if (!blockName)
|
|
103137
103045
|
return null;
|
|
103138
|
-
let docDefinition = await this.getDocDefinitionForURI(params.textDocument.uri, "blocks", blockName), hoverArgument = (_b = (
|
|
103046
|
+
let docDefinition = await this.getDocDefinitionForURI(params.textDocument.uri, "blocks", blockName), hoverArgument = (_b = (_a42 = docDefinition?.liquidDoc) === null || _a42 === void 0 ? void 0 : _a42.parameters) === null || _b === void 0 ? void 0 : _b.find((argument) => argument.name === currentNode.name);
|
|
103139
103047
|
return hoverArgument ? {
|
|
103140
103048
|
contents: {
|
|
103141
103049
|
kind: "markdown",
|
|
@@ -103206,12 +103114,12 @@ var require_HoverProvider = __commonJS({
|
|
|
103206
103114
|
];
|
|
103207
103115
|
}
|
|
103208
103116
|
async hover(params) {
|
|
103209
|
-
var
|
|
103117
|
+
var _a42;
|
|
103210
103118
|
let uri = params.textDocument.uri, document2 = this.documentManager.get(uri);
|
|
103211
103119
|
if (document2?.type !== theme_check_common_1.SourceCodeType.LiquidHtml || document2.ast instanceof Error)
|
|
103212
103120
|
return null;
|
|
103213
103121
|
let [currentNode, ancestors] = (0, theme_check_common_2.findCurrentNode)(document2.ast, document2.textDocument.offsetAt(params.position)), promises = this.providers.map((p) => p.hover(currentNode, ancestors, params));
|
|
103214
|
-
return (
|
|
103122
|
+
return (_a42 = (await Promise.all(promises)).find(Boolean)) !== null && _a42 !== void 0 ? _a42 : null;
|
|
103215
103123
|
}
|
|
103216
103124
|
};
|
|
103217
103125
|
exports2.HoverProvider = HoverProvider;
|
|
@@ -103422,13 +103330,13 @@ var require_SchemaTranslationCompletionProvider = __commonJS({
|
|
|
103422
103330
|
this.getDefaultSchemaTranslations = getDefaultSchemaTranslations;
|
|
103423
103331
|
}
|
|
103424
103332
|
async completeValue(context, path) {
|
|
103425
|
-
var
|
|
103333
|
+
var _a42;
|
|
103426
103334
|
if (!(0, utils_1.isSectionOrBlockFile)(context.doc.uri) || !(0, RequestContext_1.isLiquidRequestContext)(context))
|
|
103427
103335
|
return [];
|
|
103428
103336
|
let { doc, parsed } = context, label = (0, theme_check_common_1.deepGet)(parsed, path);
|
|
103429
103337
|
if (!label || typeof label != "string" || !label.startsWith("t:"))
|
|
103430
103338
|
return [];
|
|
103431
|
-
if (((
|
|
103339
|
+
if (((_a42 = /^t:(.*)/.exec(label)) === null || _a42 === void 0 ? void 0 : _a42[1]) === void 0)
|
|
103432
103340
|
return [];
|
|
103433
103341
|
let translations = await this.getDefaultSchemaTranslations(doc.uri);
|
|
103434
103342
|
return (0, translations_1.translationOptions)(translations).map((option) => {
|
|
@@ -103561,8 +103469,8 @@ var require_schemaSettings = __commonJS({
|
|
|
103561
103469
|
}
|
|
103562
103470
|
exports2.schemaSettingsPropertyCompletionItems = schemaSettingsPropertyCompletionItems;
|
|
103563
103471
|
function getSectionBlockByName(parsedSchema = {}, blockName) {
|
|
103564
|
-
var
|
|
103565
|
-
return (_b = (
|
|
103472
|
+
var _a42, _b;
|
|
103473
|
+
return (_b = (_a42 = parsedSchema.blocks) === null || _a42 === void 0 ? void 0 : _a42.filter((block) => "name" in block)) === null || _b === void 0 ? void 0 : _b.find((block) => block.type === blockName);
|
|
103566
103474
|
}
|
|
103567
103475
|
exports2.getSectionBlockByName = getSectionBlockByName;
|
|
103568
103476
|
}
|
|
@@ -103638,10 +103546,10 @@ var require_SettingsHoverProvider = __commonJS({
|
|
|
103638
103546
|
return path.at(0) === "default" && path.at(1) === "settings" && path.at(2) !== void 0 && typeof path.at(2) == "string";
|
|
103639
103547
|
}
|
|
103640
103548
|
async function getSettingsLabel(doc, label) {
|
|
103641
|
-
var
|
|
103549
|
+
var _a42;
|
|
103642
103550
|
let schema = await doc.getSchema();
|
|
103643
103551
|
if (!(!schema || !(0, BlockTypeCompletionProvider_1.isSectionOrBlockSchema)(schema) || (0, theme_check_common_1.isError)(schema.parsed) || schema.parsed.settings === void 0 || !Array.isArray(schema.parsed.settings)))
|
|
103644
|
-
return (
|
|
103552
|
+
return (_a42 = schema.parsed.settings.find((setting) => setting?.id === label)) === null || _a42 === void 0 ? void 0 : _a42.label;
|
|
103645
103553
|
}
|
|
103646
103554
|
}
|
|
103647
103555
|
});
|
|
@@ -103658,7 +103566,7 @@ var require_BlockSettingsPropertyCompletionProvider = __commonJS({
|
|
|
103658
103566
|
this.getDefaultSchemaTranslations = getDefaultSchemaTranslations, this.getThemeBlockSchema = getThemeBlockSchema;
|
|
103659
103567
|
}
|
|
103660
103568
|
async completeProperty(context, path) {
|
|
103661
|
-
var
|
|
103569
|
+
var _a42, _b;
|
|
103662
103570
|
let { doc } = context;
|
|
103663
103571
|
if (doc.type !== theme_check_common_1.SourceCodeType.LiquidHtml)
|
|
103664
103572
|
return [];
|
|
@@ -103676,7 +103584,7 @@ var require_BlockSettingsPropertyCompletionProvider = __commonJS({
|
|
|
103676
103584
|
return (0, schemaSettings_1.schemaSettingsPropertyCompletionItems)(localBlock.settings, translations);
|
|
103677
103585
|
} else {
|
|
103678
103586
|
let blockOriginSchema = await this.getThemeBlockSchema(doc.uri, blockType);
|
|
103679
|
-
return !blockOriginSchema || (0, theme_check_common_1.isError)(blockOriginSchema.parsed) || !(0, BlockTypeCompletionProvider_1.isSectionOrBlockSchema)(blockOriginSchema) ? [] : !(!((
|
|
103587
|
+
return !blockOriginSchema || (0, theme_check_common_1.isError)(blockOriginSchema.parsed) || !(0, BlockTypeCompletionProvider_1.isSectionOrBlockSchema)(blockOriginSchema) ? [] : !(!((_a42 = blockOriginSchema.parsed) === null || _a42 === void 0) && _a42.settings) || !Array.isArray((_b = blockOriginSchema.parsed) === null || _b === void 0 ? void 0 : _b.settings) ? [] : (0, schemaSettings_1.schemaSettingsPropertyCompletionItems)(blockOriginSchema.parsed.settings, translations);
|
|
103680
103588
|
}
|
|
103681
103589
|
return [];
|
|
103682
103590
|
}
|
|
@@ -103746,8 +103654,8 @@ var require_BlockSettingsHoverProvider = __commonJS({
|
|
|
103746
103654
|
return settings !== void 0 && Array.isArray(settings);
|
|
103747
103655
|
}
|
|
103748
103656
|
function getSettingLabelById(settings, id) {
|
|
103749
|
-
var
|
|
103750
|
-
return (
|
|
103657
|
+
var _a42;
|
|
103658
|
+
return (_a42 = settings.find((setting) => setting.id === id)) === null || _a42 === void 0 ? void 0 : _a42.label;
|
|
103751
103659
|
}
|
|
103752
103660
|
}
|
|
103753
103661
|
});
|
|
@@ -103978,8 +103886,8 @@ var require_JSONLanguageService = __commonJS({
|
|
|
103978
103886
|
}
|
|
103979
103887
|
}
|
|
103980
103888
|
async getSchemaForURI(uri) {
|
|
103981
|
-
var
|
|
103982
|
-
let schema = (
|
|
103889
|
+
var _a42;
|
|
103890
|
+
let schema = (_a42 = this.schemas[uri]) === null || _a42 === void 0 ? void 0 : _a42.schema;
|
|
103983
103891
|
return schema || `Could not get schema for '${uri}'`;
|
|
103984
103892
|
}
|
|
103985
103893
|
};
|
|
@@ -104048,10 +103956,10 @@ var require_HtmlTagNameLinkedRangesProvider = __commonJS({
|
|
|
104048
103956
|
this.documentManager = documentManager;
|
|
104049
103957
|
}
|
|
104050
103958
|
async linkedEditingRanges(node, ancestors, params) {
|
|
104051
|
-
var
|
|
103959
|
+
var _a42;
|
|
104052
103960
|
if (!node || !ancestors)
|
|
104053
103961
|
return null;
|
|
104054
|
-
let textDocument = (
|
|
103962
|
+
let textDocument = (_a42 = this.documentManager.get(params.textDocument.uri)) === null || _a42 === void 0 ? void 0 : _a42.textDocument;
|
|
104055
103963
|
if (!textDocument)
|
|
104056
103964
|
return null;
|
|
104057
103965
|
let ranges = (0, htmlTagNames_1.getHtmlElementNameRanges)(node, ancestors, params, textDocument);
|
|
@@ -104098,14 +104006,14 @@ var require_LinkedEditingRangesProvider = __commonJS({
|
|
|
104098
104006
|
];
|
|
104099
104007
|
}
|
|
104100
104008
|
async linkedEditingRanges(params) {
|
|
104101
|
-
var
|
|
104009
|
+
var _a42;
|
|
104102
104010
|
let document2 = this.documentManager.get(params.textDocument.uri);
|
|
104103
104011
|
if (!document2 || document2.type !== theme_check_common_1.SourceCodeType.LiquidHtml)
|
|
104104
104012
|
return null;
|
|
104105
104013
|
let currentNode = null, ancestors = null;
|
|
104106
104014
|
document2.ast instanceof Error || ([currentNode, ancestors] = (0, theme_check_common_2.findCurrentNode)(document2.ast, document2.textDocument.offsetAt(params.position)));
|
|
104107
104015
|
let promises = this.providers.map((p) => p.linkedEditingRanges(currentNode, ancestors, params).catch(() => null));
|
|
104108
|
-
return (
|
|
104016
|
+
return (_a42 = (await Promise.all(promises)).find(Boolean)) !== null && _a42 !== void 0 ? _a42 : null;
|
|
104109
104017
|
}
|
|
104110
104018
|
};
|
|
104111
104019
|
exports2.LinkedEditingRangesProvider = LinkedEditingRangesProvider;
|
|
@@ -104124,8 +104032,8 @@ var require_HtmlTagNameRenameProvider = __commonJS({
|
|
|
104124
104032
|
this.documentManager = documentManager;
|
|
104125
104033
|
}
|
|
104126
104034
|
async prepare(node, ancestors, params) {
|
|
104127
|
-
var
|
|
104128
|
-
let textDocument = (
|
|
104035
|
+
var _a42;
|
|
104036
|
+
let textDocument = (_a42 = this.documentManager.get(params.textDocument.uri)) === null || _a42 === void 0 ? void 0 : _a42.textDocument;
|
|
104129
104037
|
if (!textDocument || !node || !ancestors)
|
|
104130
104038
|
return null;
|
|
104131
104039
|
let ranges = (0, htmlTagNames_1.getHtmlElementNameRanges)(node, ancestors, params, textDocument);
|
|
@@ -104135,8 +104043,8 @@ var require_HtmlTagNameRenameProvider = __commonJS({
|
|
|
104135
104043
|
};
|
|
104136
104044
|
}
|
|
104137
104045
|
async rename(node, ancestors, params) {
|
|
104138
|
-
var
|
|
104139
|
-
let textDocument = (
|
|
104046
|
+
var _a42;
|
|
104047
|
+
let textDocument = (_a42 = this.documentManager.get(params.textDocument.uri)) === null || _a42 === void 0 ? void 0 : _a42.textDocument;
|
|
104140
104048
|
if (!textDocument || !node || !ancestors)
|
|
104141
104049
|
return null;
|
|
104142
104050
|
let ranges = (0, htmlTagNames_1.getHtmlElementNameRanges)(node, ancestors, params, textDocument);
|
|
@@ -104216,8 +104124,8 @@ var require_LiquidVariableRenameProvider = __commonJS({
|
|
|
104216
104124
|
AssignMarkup: replaceRange,
|
|
104217
104125
|
ForMarkup: replaceRange,
|
|
104218
104126
|
TextNode: (node2, ancestors2) => {
|
|
104219
|
-
var
|
|
104220
|
-
if (((
|
|
104127
|
+
var _a42;
|
|
104128
|
+
if (((_a42 = ancestors2.at(-1)) === null || _a42 === void 0 ? void 0 : _a42.type) === liquid_html_parser_1.NodeTypes.LiquidDocParamNode)
|
|
104221
104129
|
return liquidDocParamUpdated = !0, replaceRange(node2, ancestors2);
|
|
104222
104130
|
}
|
|
104223
104131
|
});
|
|
@@ -104239,11 +104147,11 @@ var require_LiquidVariableRenameProvider = __commonJS({
|
|
|
104239
104147
|
return !!parentNode && parentNode.type === liquid_html_parser_1.NodeTypes.LiquidDocParamNode && parentNode.paramName === node && node.type === liquid_html_parser_1.NodeTypes.TextNode;
|
|
104240
104148
|
}
|
|
104241
104149
|
function variableName(node) {
|
|
104242
|
-
var
|
|
104150
|
+
var _a42, _b;
|
|
104243
104151
|
switch (node.type) {
|
|
104244
104152
|
case liquid_html_parser_1.NodeTypes.VariableLookup:
|
|
104245
104153
|
case liquid_html_parser_1.NodeTypes.AssignMarkup:
|
|
104246
|
-
return (
|
|
104154
|
+
return (_a42 = node.name) !== null && _a42 !== void 0 ? _a42 : "";
|
|
104247
104155
|
case liquid_html_parser_1.NodeTypes.ForMarkup:
|
|
104248
104156
|
return (_b = node.variableName) !== null && _b !== void 0 ? _b : "";
|
|
104249
104157
|
case liquid_html_parser_1.NodeTypes.TextNode:
|
|
@@ -104277,7 +104185,7 @@ var require_LiquidVariableRenameProvider = __commonJS({
|
|
|
104277
104185
|
};
|
|
104278
104186
|
}
|
|
104279
104187
|
async function updateRenderTags(connection, liquidSourceCodes, snippetName, oldParamName, newParamName) {
|
|
104280
|
-
var
|
|
104188
|
+
var _a42;
|
|
104281
104189
|
let editLabel = `Rename snippet parameter '${oldParamName}' to '${newParamName}'`, annotationId = "renameSnippetParameter", workspaceEdit = {
|
|
104282
104190
|
documentChanges: [],
|
|
104283
104191
|
changeAnnotations: {
|
|
@@ -104292,7 +104200,7 @@ var require_LiquidVariableRenameProvider = __commonJS({
|
|
|
104292
104200
|
continue;
|
|
104293
104201
|
let textDocument = sourceCode.textDocument, edits = (0, theme_check_common_1.visit)(sourceCode.ast, {
|
|
104294
104202
|
RenderMarkup(node) {
|
|
104295
|
-
var
|
|
104203
|
+
var _a43;
|
|
104296
104204
|
if (node.snippet.type !== liquid_html_parser_1.NodeTypes.String || node.snippet.value !== snippetName)
|
|
104297
104205
|
return;
|
|
104298
104206
|
let renamedNameParamNode = node.args.find((arg) => arg.name === oldParamName);
|
|
@@ -104301,7 +104209,7 @@ var require_LiquidVariableRenameProvider = __commonJS({
|
|
|
104301
104209
|
newText: `${newParamName}: `,
|
|
104302
104210
|
range: vscode_languageserver_1.Range.create(textDocument.positionAt(renamedNameParamNode.position.start), textDocument.positionAt(renamedNameParamNode.value.position.start))
|
|
104303
104211
|
};
|
|
104304
|
-
if (((
|
|
104212
|
+
if (((_a43 = node.alias) === null || _a43 === void 0 ? void 0 : _a43.value) === oldParamName && node.variable) {
|
|
104305
104213
|
let match2 = /as\s+([^\s,]+)/g.exec(node.source.slice(node.position.start, node.position.end));
|
|
104306
104214
|
return match2 ? {
|
|
104307
104215
|
newText: `as ${newParamName}`,
|
|
@@ -104313,7 +104221,7 @@ var require_LiquidVariableRenameProvider = __commonJS({
|
|
|
104313
104221
|
edits.length !== 0 && workspaceEdit.documentChanges.push({
|
|
104314
104222
|
textDocument: {
|
|
104315
104223
|
uri: textDocument.uri,
|
|
104316
|
-
version: (
|
|
104224
|
+
version: (_a42 = sourceCode.version) !== null && _a42 !== void 0 ? _a42 : null
|
|
104317
104225
|
},
|
|
104318
104226
|
annotationId,
|
|
104319
104227
|
edits
|
|
@@ -104347,21 +104255,21 @@ var require_RenameProvider = __commonJS({
|
|
|
104347
104255
|
}
|
|
104348
104256
|
/** Prepare is for telling if you can rename this thing or not, and what text to rename */
|
|
104349
104257
|
async prepare(params) {
|
|
104350
|
-
var
|
|
104258
|
+
var _a42;
|
|
104351
104259
|
let [currentNode, ancestors] = this.nodes(params);
|
|
104352
104260
|
if (currentNode === null || ancestors === null)
|
|
104353
104261
|
return null;
|
|
104354
104262
|
let promises = this.providers.map((provider) => provider.prepare(currentNode, ancestors, params).catch(() => null));
|
|
104355
|
-
return (
|
|
104263
|
+
return (_a42 = (await Promise.all(promises)).find(Boolean)) !== null && _a42 !== void 0 ? _a42 : null;
|
|
104356
104264
|
}
|
|
104357
104265
|
/** Rename is for actually renaming something */
|
|
104358
104266
|
async rename(params) {
|
|
104359
|
-
var
|
|
104267
|
+
var _a42;
|
|
104360
104268
|
let [currentNode, ancestors] = this.nodes(params);
|
|
104361
104269
|
if (currentNode === null || ancestors === null)
|
|
104362
104270
|
return null;
|
|
104363
104271
|
let promises = this.providers.map((provider) => provider.rename(currentNode, ancestors, params).catch(() => null));
|
|
104364
|
-
return (
|
|
104272
|
+
return (_a42 = (await Promise.all(promises)).find(Boolean)) !== null && _a42 !== void 0 ? _a42 : null;
|
|
104365
104273
|
}
|
|
104366
104274
|
/** a helper for getting the node under the cursor and its ancestry */
|
|
104367
104275
|
nodes(params) {
|
|
@@ -104385,7 +104293,7 @@ var require_AssetRenameHandler = __commonJS({
|
|
|
104385
104293
|
this.documentManager = documentManager, this.connection = connection, this.capabilities = capabilities, this.findThemeRootURI = findThemeRootURI;
|
|
104386
104294
|
}
|
|
104387
104295
|
async onDidRenameFiles(params) {
|
|
104388
|
-
var
|
|
104296
|
+
var _a42;
|
|
104389
104297
|
if (!this.capabilities.hasApplyEditSupport)
|
|
104390
104298
|
return;
|
|
104391
104299
|
let relevantRenames = params.files.filter((file) => (0, uri_1.isAsset)(file.oldUri) && (0, uri_1.isAsset)(file.newUri));
|
|
@@ -104423,7 +104331,7 @@ var require_AssetRenameHandler = __commonJS({
|
|
|
104423
104331
|
edits.length !== 0 && workspaceEdit.documentChanges.push({
|
|
104424
104332
|
textDocument: {
|
|
104425
104333
|
uri: textDocument.uri,
|
|
104426
|
-
version: (
|
|
104334
|
+
version: (_a42 = sourceCode.version) !== null && _a42 !== void 0 ? _a42 : null
|
|
104427
104335
|
},
|
|
104428
104336
|
annotationId,
|
|
104429
104337
|
edits
|
|
@@ -104624,11 +104532,11 @@ var require_BlockRenameHandler = __commonJS({
|
|
|
104624
104532
|
};
|
|
104625
104533
|
}
|
|
104626
104534
|
function documentChanges(sourceCode, edits) {
|
|
104627
|
-
var
|
|
104535
|
+
var _a42;
|
|
104628
104536
|
return {
|
|
104629
104537
|
textDocument: {
|
|
104630
104538
|
uri: sourceCode.uri,
|
|
104631
|
-
version: (
|
|
104539
|
+
version: (_a42 = sourceCode.version) !== null && _a42 !== void 0 ? _a42 : null
|
|
104632
104540
|
},
|
|
104633
104541
|
edits
|
|
104634
104542
|
};
|
|
@@ -104744,11 +104652,11 @@ var require_SectionRenameHandler = __commonJS({
|
|
|
104744
104652
|
};
|
|
104745
104653
|
exports2.SectionRenameHandler = SectionRenameHandler;
|
|
104746
104654
|
function documentChanges(sourceCode, edits) {
|
|
104747
|
-
var
|
|
104655
|
+
var _a42;
|
|
104748
104656
|
return {
|
|
104749
104657
|
textDocument: {
|
|
104750
104658
|
uri: sourceCode.uri,
|
|
104751
|
-
version: (
|
|
104659
|
+
version: (_a42 = sourceCode.version) !== null && _a42 !== void 0 ? _a42 : null
|
|
104752
104660
|
},
|
|
104753
104661
|
edits
|
|
104754
104662
|
};
|
|
@@ -104768,7 +104676,7 @@ var require_SnippetRenameHandler = __commonJS({
|
|
|
104768
104676
|
this.documentManager = documentManager, this.connection = connection, this.capabilities = capabilities, this.findThemeRootURI = findThemeRootURI;
|
|
104769
104677
|
}
|
|
104770
104678
|
async onDidRenameFiles(params) {
|
|
104771
|
-
var
|
|
104679
|
+
var _a42;
|
|
104772
104680
|
if (!this.capabilities.hasApplyEditSupport)
|
|
104773
104681
|
return;
|
|
104774
104682
|
let relevantRenames = params.files.filter((file) => (0, uri_1.isSnippet)(file.oldUri) && (0, uri_1.isSnippet)(file.newUri));
|
|
@@ -104809,7 +104717,7 @@ var require_SnippetRenameHandler = __commonJS({
|
|
|
104809
104717
|
edits.length !== 0 && workspaceEdit.documentChanges.push({
|
|
104810
104718
|
textDocument: {
|
|
104811
104719
|
uri: textDocument.uri,
|
|
104812
|
-
version: (
|
|
104720
|
+
version: (_a42 = sourceCode.version) !== null && _a42 !== void 0 ? _a42 : null
|
|
104813
104721
|
},
|
|
104814
104722
|
annotationId,
|
|
104815
104723
|
edits
|
|
@@ -104950,7 +104858,7 @@ var require_Configuration = __commonJS({
|
|
|
104950
104858
|
"../../node_modules/.pnpm/@shopify+theme-language-server-common@2.20.0/node_modules/@shopify/theme-language-server-common/dist/server/Configuration.js"(exports2) {
|
|
104951
104859
|
"use strict";
|
|
104952
104860
|
init_cjs_shims();
|
|
104953
|
-
var
|
|
104861
|
+
var _a42, _b, _c, _d;
|
|
104954
104862
|
Object.defineProperty(exports2, "__esModule", { value: !0 });
|
|
104955
104863
|
exports2.Configuration = exports2.ConfigurationKeys = exports2.PRELOAD_ON_BOOT = exports2.CHECK_ON_CHANGE = exports2.CHECK_ON_SAVE = exports2.CHECK_ON_OPEN = void 0;
|
|
104956
104864
|
var theme_check_common_1 = require_dist2(), vscode_languageserver_1 = require_main6();
|
|
@@ -104966,7 +104874,7 @@ var require_Configuration = __commonJS({
|
|
|
104966
104874
|
];
|
|
104967
104875
|
var Configuration = class {
|
|
104968
104876
|
constructor(connection, capabilities) {
|
|
104969
|
-
this.connection = connection, this.capabilities = capabilities, this[
|
|
104877
|
+
this.connection = connection, this.capabilities = capabilities, this[_a42] = !0, this[_b] = !0, this[_c] = !0, this[_d] = !0, this.fetchConfiguration = (0, theme_check_common_1.memo)(async () => {
|
|
104970
104878
|
if (!this.capabilities.hasWorkspaceConfigurationSupport)
|
|
104971
104879
|
return;
|
|
104972
104880
|
let configs = await this.connection.workspace.getConfiguration(exports2.ConfigurationKeys.map((key) => ({ section: key })));
|
|
@@ -105002,7 +104910,7 @@ var require_Configuration = __commonJS({
|
|
|
105002
104910
|
}
|
|
105003
104911
|
};
|
|
105004
104912
|
exports2.Configuration = Configuration;
|
|
105005
|
-
|
|
104913
|
+
_a42 = exports2.CHECK_ON_OPEN, _b = exports2.CHECK_ON_SAVE, _c = exports2.CHECK_ON_CHANGE, _d = exports2.PRELOAD_ON_BOOT;
|
|
105006
104914
|
}
|
|
105007
104915
|
});
|
|
105008
104916
|
|
|
@@ -107960,13 +107868,13 @@ var require_utils12 = __commonJS({
|
|
|
107960
107868
|
}
|
|
107961
107869
|
exports2.exists = exists2;
|
|
107962
107870
|
async function acceptsLocalBlocks(sectionType, deps) {
|
|
107963
|
-
var
|
|
107871
|
+
var _a42;
|
|
107964
107872
|
let sectionSchema = await deps.getSectionSchema(sectionType).catch((_2) => {
|
|
107965
107873
|
});
|
|
107966
107874
|
if (!sectionSchema)
|
|
107967
107875
|
return new Error("Section does not exist");
|
|
107968
107876
|
let validSchema = sectionSchema.validSchema;
|
|
107969
|
-
return validSchema instanceof Error ? validSchema : ((
|
|
107877
|
+
return validSchema instanceof Error ? validSchema : ((_a42 = validSchema.blocks) !== null && _a42 !== void 0 ? _a42 : []).some((block) => block.type && "name" in block && block.name);
|
|
107970
107878
|
}
|
|
107971
107879
|
exports2.acceptsLocalBlocks = acceptsLocalBlocks;
|
|
107972
107880
|
}
|
|
@@ -108055,13 +107963,13 @@ var require_augment = __commonJS({
|
|
|
108055
107963
|
exports2.augmentDependencies = void 0;
|
|
108056
107964
|
var theme_check_common_1 = require_dist2(), toSourceCode_1 = require_toSourceCode(), utils_1 = require_utils12();
|
|
108057
107965
|
function augmentDependencies(rootUri, ideps) {
|
|
108058
|
-
var
|
|
107966
|
+
var _a42;
|
|
108059
107967
|
return {
|
|
108060
107968
|
fs: ideps.fs,
|
|
108061
107969
|
getBlockSchema: (0, theme_check_common_1.memoize)(ideps.getBlockSchema, utils_1.identity),
|
|
108062
107970
|
getSectionSchema: (0, theme_check_common_1.memoize)(ideps.getSectionSchema, utils_1.identity),
|
|
108063
107971
|
// parse at most once
|
|
108064
|
-
getSourceCode: (0, theme_check_common_1.memoize)((
|
|
107972
|
+
getSourceCode: (0, theme_check_common_1.memoize)((_a42 = ideps.getSourceCode) !== null && _a42 !== void 0 ? _a42 : async function(uri) {
|
|
108065
107973
|
let contents = await ideps.fs.readFile(uri);
|
|
108066
107974
|
return (0, toSourceCode_1.toSourceCode)(uri, contents);
|
|
108067
107975
|
}, utils_1.identity),
|
|
@@ -108986,7 +108894,7 @@ var require_ThemeGraphManager = __commonJS({
|
|
|
108986
108894
|
}));
|
|
108987
108895
|
}
|
|
108988
108896
|
async getDependencies(uri, offset, { includeIndirect = !0, includePreset = !0 } = {}) {
|
|
108989
|
-
var
|
|
108897
|
+
var _a42;
|
|
108990
108898
|
let graph = await this.getThemeGraphForURI(uri);
|
|
108991
108899
|
if (!graph)
|
|
108992
108900
|
return [];
|
|
@@ -108997,7 +108905,7 @@ var require_ThemeGraphManager = __commonJS({
|
|
|
108997
108905
|
"direct",
|
|
108998
108906
|
includeIndirect ? "indirect" : void 0,
|
|
108999
108907
|
includePreset ? "preset" : void 0
|
|
109000
|
-
], deps = (
|
|
108908
|
+
], deps = (_a42 = module3.dependencies.filter((dep) => includedTypes.includes(dep.type))) !== null && _a42 !== void 0 ? _a42 : [];
|
|
109001
108909
|
return Promise.all(deps.map(async (dep) => {
|
|
109002
108910
|
let [source, target] = await Promise.all([
|
|
109003
108911
|
this.augmentedLocation(dep.source),
|
|
@@ -109011,12 +108919,12 @@ var require_ThemeGraphManager = __commonJS({
|
|
|
109011
108919
|
}));
|
|
109012
108920
|
}
|
|
109013
108921
|
async augmentedLocation(loc) {
|
|
109014
|
-
var
|
|
108922
|
+
var _a42;
|
|
109015
108923
|
let sourceCode = await this.getSourceCode(loc.uri).catch(() => {
|
|
109016
108924
|
}), { uri, range } = loc;
|
|
109017
108925
|
if (!sourceCode || !range)
|
|
109018
108926
|
return { exists: !!sourceCode, ...loc };
|
|
109019
|
-
let doc = (
|
|
108927
|
+
let doc = (_a42 = this.documentManager.get(loc.uri)) === null || _a42 === void 0 ? void 0 : _a42.textDocument;
|
|
109020
108928
|
return doc || (doc = vscode_languageserver_textdocument_1.TextDocument.create(sourceCode.uri, sourceCode.type, 0, sourceCode.source)), {
|
|
109021
108929
|
uri,
|
|
109022
108930
|
range,
|
|
@@ -109169,21 +109077,21 @@ var require_startServer = __commonJS({
|
|
|
109169
109077
|
}
|
|
109170
109078
|
let getDefaultLocaleFileUri = (0, theme_check_common_1.makeGetDefaultLocaleFileUri)(fs4);
|
|
109171
109079
|
async function getDefaultLocaleSourceCode(uri) {
|
|
109172
|
-
var
|
|
109080
|
+
var _a42;
|
|
109173
109081
|
let rootUri = await findThemeRootURI(uri);
|
|
109174
109082
|
if (!rootUri)
|
|
109175
109083
|
return null;
|
|
109176
109084
|
let defaultLocaleFileUri = await getDefaultLocaleFileUri(rootUri);
|
|
109177
|
-
return defaultLocaleFileUri && (
|
|
109085
|
+
return defaultLocaleFileUri && (_a42 = documentManager.get(defaultLocaleFileUri)) !== null && _a42 !== void 0 ? _a42 : null;
|
|
109178
109086
|
}
|
|
109179
109087
|
let getDefaultSchemaLocaleFileUri = (0, theme_check_common_1.makeGetDefaultSchemaLocaleFileUri)(fs4);
|
|
109180
109088
|
async function getDefaultSchemaLocaleSourceCode(uri) {
|
|
109181
|
-
var
|
|
109089
|
+
var _a42;
|
|
109182
109090
|
let rootUri = await findThemeRootURI(uri);
|
|
109183
109091
|
if (!rootUri)
|
|
109184
109092
|
return null;
|
|
109185
109093
|
let defaultLocaleFileUri = await getDefaultSchemaLocaleFileUri(rootUri);
|
|
109186
|
-
return defaultLocaleFileUri && (
|
|
109094
|
+
return defaultLocaleFileUri && (_a42 = documentManager.get(defaultLocaleFileUri)) !== null && _a42 !== void 0 ? _a42 : null;
|
|
109187
109095
|
}
|
|
109188
109096
|
let definitionsProvider = new DefinitionProvider_1.DefinitionProvider(documentManager, getDefaultLocaleSourceCode, getDefaultSchemaLocaleSourceCode), jsonLanguageService = new JSONLanguageService_1.JSONLanguageService(documentManager, jsonValidationSet, getSchemaTranslationsForURI, getModeForURI, getThemeBlockNames, getThemeBlockSchema, findThemeRootURI), completionsProvider = new completions_1.CompletionsProvider({
|
|
109189
109097
|
documentManager,
|
|
@@ -109324,18 +109232,18 @@ var require_startServer = __commonJS({
|
|
|
109324
109232
|
}), connection.onDefinition(async (params) => hasUnsupportedDocument(params) ? [] : definitionsProvider.definitions(params)), connection.onCodeAction(async (params) => codeActionsProvider.codeActions(params)), connection.onExecuteCommand(async (params) => {
|
|
109325
109233
|
await executeCommandProvider.execute(params);
|
|
109326
109234
|
}), connection.onCompletion(async (params) => {
|
|
109327
|
-
var
|
|
109328
|
-
return hasUnsupportedDocument(params) ? [] : (_b = (
|
|
109235
|
+
var _a42, _b;
|
|
109236
|
+
return hasUnsupportedDocument(params) ? [] : (_b = (_a42 = await cssLanguageService.completions(params)) !== null && _a42 !== void 0 ? _a42 : await jsonLanguageService.completions(params)) !== null && _b !== void 0 ? _b : await completionsProvider.completions(params);
|
|
109329
109237
|
}), connection.onHover(async (params) => {
|
|
109330
|
-
var
|
|
109331
|
-
return hasUnsupportedDocument(params) ? null : (_b = (
|
|
109238
|
+
var _a42, _b;
|
|
109239
|
+
return hasUnsupportedDocument(params) ? null : (_b = (_a42 = await cssLanguageService.hover(params)) !== null && _a42 !== void 0 ? _a42 : await jsonLanguageService.hover(params)) !== null && _b !== void 0 ? _b : await hoverProvider.hover(params);
|
|
109332
109240
|
}), connection.onDocumentOnTypeFormatting(async (params) => hasUnsupportedDocument(params) ? null : onTypeFormattingProvider.onTypeFormatting(params)), connection.onDocumentHighlight(async (params) => hasUnsupportedDocument(params) ? [] : documentHighlightProvider.documentHighlights(params)), connection.onPrepareRename(async (params) => hasUnsupportedDocument(params) ? null : renameProvider.prepare(params)), connection.onRenameRequest(async (params) => hasUnsupportedDocument(params) ? null : renameProvider.rename(params)), connection.languages.onLinkedEditingRange(async (params) => hasUnsupportedDocument(params) ? null : linkedEditingRangesProvider.linkedEditingRanges(params)), connection.workspace.onDidRenameFiles(async (params) => {
|
|
109333
109241
|
let triggerUris = params.files.map((fileRename) => fileRename.newUri);
|
|
109334
109242
|
for (let { oldUri, newUri } of params.files)
|
|
109335
109243
|
documentManager.rename(oldUri, newUri), fs4.readDirectory.invalidate(theme_check_common_1.path.dirname(oldUri)), fs4.readDirectory.invalidate(theme_check_common_1.path.dirname(newUri)), fs4.readFile.invalidate(oldUri), fs4.readFile.invalidate(newUri), fs4.stat.invalidate(oldUri), fs4.stat.invalidate(newUri), themeGraphManager.rename(oldUri, newUri);
|
|
109336
109244
|
await renameHandler.onDidRenameFiles(params), runChecks.force(triggerUris);
|
|
109337
109245
|
}), connection.onDidChangeWatchedFiles(async (params) => {
|
|
109338
|
-
var
|
|
109246
|
+
var _a42;
|
|
109339
109247
|
if (params.changes.length === 0)
|
|
109340
109248
|
return;
|
|
109341
109249
|
let triggerUris = params.changes.map((change) => change.uri), updates = [];
|
|
@@ -109353,7 +109261,7 @@ var require_startServer = __commonJS({
|
|
|
109353
109261
|
fs4.readDirectory.invalidate(theme_check_common_1.path.dirname(change.uri)), fs4.readFile.invalidate(change.uri), fs4.stat.invalidate(change.uri), themeGraphManager.create(change.uri), updates.push(documentManager.changeFromDisk(change.uri));
|
|
109354
109262
|
break;
|
|
109355
109263
|
case vscode_languageserver_1.FileChangeType.Changed:
|
|
109356
|
-
fs4.readFile.invalidate(change.uri), fs4.stat.invalidate(change.uri), themeGraphManager.change(change.uri), ((
|
|
109264
|
+
fs4.readFile.invalidate(change.uri), fs4.stat.invalidate(change.uri), themeGraphManager.change(change.uri), ((_a42 = documentManager.get(change.uri)) === null || _a42 === void 0 ? void 0 : _a42.version) === void 0 && updates.push(documentManager.changeFromDisk(change.uri));
|
|
109357
109265
|
break;
|
|
109358
109266
|
case vscode_languageserver_1.FileChangeType.Deleted:
|
|
109359
109267
|
fs4.readDirectory.invalidate(theme_check_common_1.path.dirname(change.uri)), fs4.readFile.invalidate(change.uri), fs4.stat.invalidate(change.uri), themeGraphManager.delete(change.uri), documentManager.delete(change.uri);
|
|
@@ -170150,9 +170058,9 @@ var require_prop_types = __commonJS({
|
|
|
170150
170058
|
}
|
|
170151
170059
|
});
|
|
170152
170060
|
|
|
170153
|
-
// ../../node_modules/.pnpm/@babel+runtime@7.
|
|
170061
|
+
// ../../node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/interopRequireDefault.js
|
|
170154
170062
|
var require_interopRequireDefault = __commonJS({
|
|
170155
|
-
"../../node_modules/.pnpm/@babel+runtime@7.
|
|
170063
|
+
"../../node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/interopRequireDefault.js"(exports2, module2) {
|
|
170156
170064
|
init_cjs_shims();
|
|
170157
170065
|
function _interopRequireDefault(e) {
|
|
170158
170066
|
return e && e.__esModule ? e : {
|
|
@@ -191046,7 +190954,7 @@ async function buildJSFunctionWithTasks(fun, options, builder, deps) {
|
|
|
191046
190954
|
}
|
|
191047
190955
|
async function buildGraphqlTypes(fun, options) {
|
|
191048
190956
|
if (!fun.isJavaScript)
|
|
191049
|
-
throw new
|
|
190957
|
+
throw new AbortError("GraphQL types can only be built for JavaScript functions");
|
|
191050
190958
|
return runWithTimer("cmd_all_timing_network_ms")(async () => exec("npm", ["exec", "--", "graphql-code-generator", "--config", "package.json"], {
|
|
191051
190959
|
cwd: fun.directory,
|
|
191052
190960
|
stderr: options.stderr,
|
|
@@ -191274,24 +191182,6 @@ async function build(options) {
|
|
|
191274
191182
|
}
|
|
191275
191183
|
var build_default = build;
|
|
191276
191184
|
|
|
191277
|
-
// ../app/dist/cli/prompts/deprecation-warnings.js
|
|
191278
|
-
init_cjs_shims();
|
|
191279
|
-
|
|
191280
|
-
// ../app/dist/cli/metadata.js
|
|
191281
|
-
init_cjs_shims();
|
|
191282
|
-
var metadata = createRuntimeMetadataContainer({
|
|
191283
|
-
cmd_app_warning_api_key_deprecation_displayed: !1
|
|
191284
|
-
}), metadata_default = metadata;
|
|
191285
|
-
|
|
191286
|
-
// ../app/dist/cli/prompts/deprecation-warnings.js
|
|
191287
|
-
async function showApiKeyDeprecationWarning() {
|
|
191288
|
-
await metadata_default.addPublicMetadata(() => ({
|
|
191289
|
-
cmd_app_warning_api_key_deprecation_displayed: !0
|
|
191290
|
-
})), renderWarning({
|
|
191291
|
-
body: ["The flag", { command: "api-key" }, "has been deprecated in favor of", { command: "client-id" }]
|
|
191292
|
-
});
|
|
191293
|
-
}
|
|
191294
|
-
|
|
191295
191185
|
// ../app/dist/cli/services/app-context.js
|
|
191296
191186
|
init_cjs_shims();
|
|
191297
191187
|
|
|
@@ -191623,6 +191513,7 @@ var WebhookSubscriptionSchema = z.object({
|
|
|
191623
191513
|
topics: z.array(z.string({ invalid_type_error: "Values within array must be a string" }), {
|
|
191624
191514
|
invalid_type_error: "Value must be string[]"
|
|
191625
191515
|
}).optional(),
|
|
191516
|
+
actions: z.array(z.string({ invalid_type_error: "Value must be a string" })).optional(),
|
|
191626
191517
|
uri: z.preprocess((arg) => removeTrailingSlash(arg), WebhookSubscriptionUriValidation, {
|
|
191627
191518
|
required_error: "Missing value at"
|
|
191628
191519
|
}),
|
|
@@ -191741,7 +191632,10 @@ var WebConfigurationAuthCallbackPathSchema = z.preprocess(ensurePathStartsWithSl
|
|
|
191741
191632
|
this.idEnvironmentVariableName = "SHOPIFY_API_KEY", this.name = name, this.directory = directory, this.packageManager = packageManager, this.configuration = configuration, this.nodeDependencies = nodeDependencies, this.webs = webs, this.dotenv = dotenv, this.realExtensions = modules, this.errors = errors, this.usesWorkspaces = usesWorkspaces2, this.specifications = specifications, this.configSchema = configSchema ?? AppSchema, this.remoteFlags = remoteFlags ?? [], this._hiddenConfig = hiddenConfig, devApplicationURLs && this.setDevApplicationURLs(devApplicationURLs);
|
|
191742
191633
|
}
|
|
191743
191634
|
get allExtensions() {
|
|
191744
|
-
return this.includeConfigOnDeploy === !1 ? this.
|
|
191635
|
+
return this.includeConfigOnDeploy === !1 ? this.nonConfigExtensions : this.realExtensions;
|
|
191636
|
+
}
|
|
191637
|
+
get nonConfigExtensions() {
|
|
191638
|
+
return this.realExtensions.filter((ext) => !ext.isAppConfigExtension);
|
|
191745
191639
|
}
|
|
191746
191640
|
get draftableExtensions() {
|
|
191747
191641
|
return this.realExtensions.filter((ext) => ext.isUUIDStrategyExtension || ext.specification.identifier === AppAccessSpecIdentifier);
|
|
@@ -191871,7 +191765,7 @@ var WebConfigurationAuthCallbackPathSchema = z.preprocess(ensurePathStartsWithSl
|
|
|
191871
191765
|
if (hasAppSpecificWebhooks && usesLegacyInstallFlow)
|
|
191872
191766
|
throw new AbortError("App-specific webhook subscriptions are not supported when use_legacy_install_flow is enabled.", `To use app-specific webhooks, you need to:
|
|
191873
191767
|
1. Remove 'use_legacy_install_flow = true' from your configuration
|
|
191874
|
-
2. Run 'shopify app deploy' to sync your scopes with the
|
|
191768
|
+
2. Run 'shopify app deploy' to sync your scopes with the Developer Dashboard
|
|
191875
191769
|
|
|
191876
191770
|
Alternatively, continue using shop-specific webhooks with the legacy install flow.
|
|
191877
191771
|
|
|
@@ -191958,6 +191852,12 @@ function parseHumanReadableError(issues) {
|
|
|
191958
191852
|
}), humanReadableError;
|
|
191959
191853
|
}
|
|
191960
191854
|
|
|
191855
|
+
// ../app/dist/cli/metadata.js
|
|
191856
|
+
init_cjs_shims();
|
|
191857
|
+
var metadata = createRuntimeMetadataContainer({
|
|
191858
|
+
cmd_app_warning_api_key_deprecation_displayed: !1
|
|
191859
|
+
}), metadata_default = metadata;
|
|
191860
|
+
|
|
191961
191861
|
// ../app/dist/cli/models/extensions/extension-instance.js
|
|
191962
191862
|
init_cjs_shims();
|
|
191963
191863
|
|
|
@@ -192242,6 +192142,7 @@ var WebhooksSpecIdentifier = "webhooks", WebhookTransformConfig = {
|
|
|
192242
192142
|
init_cjs_shims();
|
|
192243
192143
|
var WebhookSubscriptionSpecIdentifier = "webhook_subscription", SingleWebhookSubscriptionSchema = z.object({
|
|
192244
192144
|
topic: z.string(),
|
|
192145
|
+
actions: z.array(z.string({ invalid_type_error: "Value must be a string" })).optional(),
|
|
192245
192146
|
api_version: z.string(),
|
|
192246
192147
|
uri: z.preprocess(removeTrailingSlash, WebhookSubscriptionUriValidation, {
|
|
192247
192148
|
required_error: "Missing value at"
|
|
@@ -192558,6 +192459,123 @@ async function runCommand(buildCommand, extension, options) {
|
|
|
192558
192459
|
});
|
|
192559
192460
|
}
|
|
192560
192461
|
|
|
192462
|
+
// ../cli-kit/dist/public/node/import-extractor.js
|
|
192463
|
+
init_cjs_shims();
|
|
192464
|
+
function extractImportPaths(filePath) {
|
|
192465
|
+
let content = readFileSync(filePath).toString();
|
|
192466
|
+
switch (filePath.substring(filePath.lastIndexOf("."))) {
|
|
192467
|
+
case ".js":
|
|
192468
|
+
case ".mjs":
|
|
192469
|
+
case ".cjs":
|
|
192470
|
+
case ".ts":
|
|
192471
|
+
case ".tsx":
|
|
192472
|
+
case ".jsx":
|
|
192473
|
+
return extractJSLikeImports(content, filePath);
|
|
192474
|
+
case ".rs":
|
|
192475
|
+
return extractRustImports(content, filePath);
|
|
192476
|
+
default:
|
|
192477
|
+
return [];
|
|
192478
|
+
}
|
|
192479
|
+
}
|
|
192480
|
+
function extractImportPathsRecursively(filePath, visited = /* @__PURE__ */ new Set()) {
|
|
192481
|
+
if (visited.has(filePath))
|
|
192482
|
+
return [];
|
|
192483
|
+
visited.add(filePath);
|
|
192484
|
+
let directImports = extractImportPaths(filePath), allImports = [filePath, ...directImports];
|
|
192485
|
+
for (let importedFile of directImports)
|
|
192486
|
+
try {
|
|
192487
|
+
if (fileExistsSync(importedFile) && !isDirectorySync(importedFile)) {
|
|
192488
|
+
let nestedImports = extractImportPathsRecursively(importedFile, visited);
|
|
192489
|
+
allImports.push(...nestedImports);
|
|
192490
|
+
}
|
|
192491
|
+
} catch (error) {
|
|
192492
|
+
if (error instanceof Error && error.message.includes("ENOENT"))
|
|
192493
|
+
continue;
|
|
192494
|
+
throw error;
|
|
192495
|
+
}
|
|
192496
|
+
return [...new Set(allImports)];
|
|
192497
|
+
}
|
|
192498
|
+
function extractJSImports(content, filePath) {
|
|
192499
|
+
return extractJSLikeImports(content, filePath);
|
|
192500
|
+
}
|
|
192501
|
+
function extractJSLikeImports(content, filePath) {
|
|
192502
|
+
let imports = [], patterns = [
|
|
192503
|
+
// ES6 imports: import ... from './path'
|
|
192504
|
+
/import\s+(?:[\s\S]*?)\s+from\s+['"](\.\.?\/[^'"]+)['"]/gm,
|
|
192505
|
+
// ES6 side-effect imports: import './path'
|
|
192506
|
+
/import\s+['"](\.\.?\/[^'"]+)['"]/g,
|
|
192507
|
+
// ES6 exports: export ... from './path'
|
|
192508
|
+
/export\s+(?:[\s\S]*?)\s+from\s+['"](\.\.?\/[^'"]+)['"]/gm,
|
|
192509
|
+
// Dynamic imports: import('./path')
|
|
192510
|
+
/import\s*\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g,
|
|
192511
|
+
// CommonJS requires: require('./path')
|
|
192512
|
+
/require\s*\(\s*['"](\.\.?\/[^'"]+)['"]\s*\)/g
|
|
192513
|
+
];
|
|
192514
|
+
for (let pattern of patterns) {
|
|
192515
|
+
let match2;
|
|
192516
|
+
for (; (match2 = pattern.exec(content)) !== null; ) {
|
|
192517
|
+
let importPath = match2[1];
|
|
192518
|
+
if (importPath && importPath.startsWith(".")) {
|
|
192519
|
+
let resolvedPath = resolveJSImport(importPath, filePath);
|
|
192520
|
+
resolvedPath && imports.push(resolvedPath);
|
|
192521
|
+
}
|
|
192522
|
+
}
|
|
192523
|
+
}
|
|
192524
|
+
return [...new Set(imports)];
|
|
192525
|
+
}
|
|
192526
|
+
function extractRustImports(content, filePath) {
|
|
192527
|
+
let imports = [], modPattern = /^\s*(?:pub\s+)?mod\s+([a-z_][a-z0-9_]*)\s*;/gm, match2;
|
|
192528
|
+
for (; (match2 = modPattern.exec(content)) !== null; ) {
|
|
192529
|
+
let modName = match2[1];
|
|
192530
|
+
if (modName) {
|
|
192531
|
+
let modPath = resolveRustModule(modName, filePath);
|
|
192532
|
+
modPath && imports.push(modPath);
|
|
192533
|
+
}
|
|
192534
|
+
}
|
|
192535
|
+
let pathPattern = /#\[path\s*=\s*"([^"]+)"\]/g;
|
|
192536
|
+
for (; (match2 = pathPattern.exec(content)) !== null; ) {
|
|
192537
|
+
let pathValue = match2[1];
|
|
192538
|
+
if (pathValue) {
|
|
192539
|
+
let resolvedPath = joinPath(dirname(filePath), pathValue);
|
|
192540
|
+
fileExistsSync(resolvedPath) && imports.push(resolvedPath);
|
|
192541
|
+
}
|
|
192542
|
+
}
|
|
192543
|
+
return [...new Set(imports)];
|
|
192544
|
+
}
|
|
192545
|
+
function resolveJSImport(importPath, fromFile) {
|
|
192546
|
+
let basePath = fileExistsSync(fromFile) && isDirectorySync(fromFile) ? fromFile : dirname(fromFile), resolvedPath = joinPath(basePath, importPath);
|
|
192547
|
+
if (fileExistsSync(resolvedPath) && isDirectorySync(resolvedPath)) {
|
|
192548
|
+
let indexPaths = [
|
|
192549
|
+
joinPath(resolvedPath, "index.js"),
|
|
192550
|
+
joinPath(resolvedPath, "index.ts"),
|
|
192551
|
+
joinPath(resolvedPath, "index.tsx"),
|
|
192552
|
+
joinPath(resolvedPath, "index.jsx")
|
|
192553
|
+
];
|
|
192554
|
+
for (let indexPath of indexPaths)
|
|
192555
|
+
if (fileExistsSync(indexPath) && !isDirectorySync(indexPath))
|
|
192556
|
+
return indexPath;
|
|
192557
|
+
return null;
|
|
192558
|
+
}
|
|
192559
|
+
let possiblePaths = [
|
|
192560
|
+
resolvedPath,
|
|
192561
|
+
`${resolvedPath}.js`,
|
|
192562
|
+
`${resolvedPath}.ts`,
|
|
192563
|
+
`${resolvedPath}.tsx`,
|
|
192564
|
+
`${resolvedPath}.jsx`
|
|
192565
|
+
];
|
|
192566
|
+
for (let path of possiblePaths)
|
|
192567
|
+
if (fileExistsSync(path) && !isDirectorySync(path))
|
|
192568
|
+
return path;
|
|
192569
|
+
return null;
|
|
192570
|
+
}
|
|
192571
|
+
function resolveRustModule(modName, fromFile) {
|
|
192572
|
+
let basePath = dirname(fromFile), possiblePaths = [joinPath(basePath, `${modName}.rs`), joinPath(basePath, modName, "mod.rs")];
|
|
192573
|
+
for (let path of possiblePaths)
|
|
192574
|
+
if (fileExistsSync(path))
|
|
192575
|
+
return path;
|
|
192576
|
+
return null;
|
|
192577
|
+
}
|
|
192578
|
+
|
|
192561
192579
|
// ../app/dist/cli/models/extensions/extension-instance.js
|
|
192562
192580
|
var CONFIG_EXTENSION_IDS = [
|
|
192563
192581
|
AppAccessSpecIdentifier,
|
|
@@ -192698,25 +192716,29 @@ var CONFIG_EXTENSION_IDS = [
|
|
|
192698
192716
|
get buildCommand() {
|
|
192699
192717
|
return this.configuration.build?.command;
|
|
192700
192718
|
}
|
|
192701
|
-
|
|
192702
|
-
|
|
192719
|
+
/**
|
|
192720
|
+
* Default entry paths to be watched in a dev session.
|
|
192721
|
+
* It returns the entry source file path if defined,
|
|
192722
|
+
* or the list of files generated from the bundle content (UI extensions).
|
|
192723
|
+
* @returns Array of strings with the paths to be watched
|
|
192724
|
+
*/
|
|
192725
|
+
devSessionDefaultWatchPaths() {
|
|
192726
|
+
if (this.specification.identifier === "ui_extension") {
|
|
192727
|
+
let { main, assets } = this.getBundleExtensionStdinContent(), mainPaths = extractJSImports(main, this.directory), assetPaths = assets?.flatMap((asset) => extractJSImports(asset.content, this.directory)) ?? [];
|
|
192728
|
+
return mainPaths.concat(...assetPaths);
|
|
192729
|
+
}
|
|
192730
|
+
return [this.entrySourceFilePath];
|
|
192731
|
+
}
|
|
192732
|
+
// Custom paths to be watched in a dev session
|
|
192733
|
+
// Return undefiend if there aren't custom configured paths (everything is watched)
|
|
192703
192734
|
// If there are, include some default paths.
|
|
192704
|
-
get
|
|
192735
|
+
get devSessionCustomWatchPaths() {
|
|
192705
192736
|
let config2 = this.configuration;
|
|
192706
192737
|
if (!config2.build || !config2.build.watch)
|
|
192707
192738
|
return;
|
|
192708
192739
|
let watchPaths = [config2.build.watch].flat().map((path) => joinPath(this.directory, path));
|
|
192709
192740
|
return watchPaths.push(joinPath(this.directory, "locales", "**.json")), watchPaths.push(joinPath(this.directory, "**", "!(.)*.graphql")), watchPaths.push(joinPath(this.directory, "**.toml")), watchPaths;
|
|
192710
192741
|
}
|
|
192711
|
-
get watchBuildPaths() {
|
|
192712
|
-
if (this.isFunctionExtension) {
|
|
192713
|
-
let config2 = this.configuration, configuredPaths = config2.build?.watch ? [config2.build.watch].flat() : [];
|
|
192714
|
-
if (!this.isJavaScript && configuredPaths.length === 0)
|
|
192715
|
-
return null;
|
|
192716
|
-
let watchPaths = configuredPaths ?? [];
|
|
192717
|
-
return this.isJavaScript && configuredPaths.length === 0 && watchPaths.push(joinPath("src", "**", "*.{js,ts}")), watchPaths.push(joinPath("**", "!(.)*.graphql")), watchPaths.map((path) => joinPath(this.directory, path));
|
|
192718
|
-
} else return this.isESBuildExtension ? [joinPath(this.directory, "src", "**", "*.{ts,tsx,js,jsx}")] : this.isThemeExtension ? [joinPath(this.directory, "*", "*")] : [];
|
|
192719
|
-
}
|
|
192720
192742
|
async watchConfigurationPaths() {
|
|
192721
192743
|
if (this.isAppConfigExtension)
|
|
192722
192744
|
return [this.configurationPath];
|
|
@@ -192803,6 +192825,46 @@ var CONFIG_EXTENSION_IDS = [
|
|
|
192803
192825
|
async contributeToSharedTypeFile(typeDefinitionsByFile) {
|
|
192804
192826
|
await this.specification.contributeToSharedTypeFile?.(this, typeDefinitionsByFile);
|
|
192805
192827
|
}
|
|
192828
|
+
/**
|
|
192829
|
+
* Returns all files that need to be watched for this extension
|
|
192830
|
+
* This includes files in the extension directory (respecting watch paths and gitignore)
|
|
192831
|
+
* as well as any imported files from outside the extension directory
|
|
192832
|
+
*/
|
|
192833
|
+
watchedFiles() {
|
|
192834
|
+
let watchedFiles = [], files = (this.devSessionCustomWatchPaths ?? ["**/*"]).flatMap((pattern) => globSync(pattern, {
|
|
192835
|
+
cwd: this.directory,
|
|
192836
|
+
absolute: !0,
|
|
192837
|
+
followSymbolicLinks: !1,
|
|
192838
|
+
ignore: ["**/node_modules/**", "**/.git/**", "**/dist/**", "**/*.swp", "**/generated/**"]
|
|
192839
|
+
}));
|
|
192840
|
+
if (watchedFiles.push(...files.flat()), !this.devSessionCustomWatchPaths) {
|
|
192841
|
+
let importedFiles = this.scanImports();
|
|
192842
|
+
watchedFiles.push(...importedFiles);
|
|
192843
|
+
}
|
|
192844
|
+
return [...new Set(watchedFiles.map((file) => normalizePath(file)))];
|
|
192845
|
+
}
|
|
192846
|
+
/**
|
|
192847
|
+
* Rescans imports for this extension and updates the cached import paths
|
|
192848
|
+
* Returns true if the imports changed
|
|
192849
|
+
*/
|
|
192850
|
+
async rescanImports() {
|
|
192851
|
+
let oldImportPaths = this.cachedImportPaths;
|
|
192852
|
+
return this.cachedImportPaths = void 0, this.scanImports(), oldImportPaths !== this.cachedImportPaths;
|
|
192853
|
+
}
|
|
192854
|
+
/**
|
|
192855
|
+
* Scans for imports in this extension's entry files
|
|
192856
|
+
* Returns absolute paths of imported files that are outside the extension directory
|
|
192857
|
+
*/
|
|
192858
|
+
scanImports() {
|
|
192859
|
+
if (this.cachedImportPaths !== void 0)
|
|
192860
|
+
return this.cachedImportPaths;
|
|
192861
|
+
try {
|
|
192862
|
+
let imports = this.devSessionDefaultWatchPaths().flatMap((entryFile) => extractImportPathsRecursively(entryFile).map((importPath) => normalizePath(resolvePath(importPath))));
|
|
192863
|
+
return this.cachedImportPaths = uniq(imports) ?? [], outputDebug(`Found ${this.cachedImportPaths.length} external imports (recursively) for extension ${this.handle}`), this.cachedImportPaths;
|
|
192864
|
+
} catch (error) {
|
|
192865
|
+
return outputDebug(`Failed to scan imports for extension ${this.handle}: ${error}`), this.cachedImportPaths = [], this.cachedImportPaths;
|
|
192866
|
+
}
|
|
192867
|
+
}
|
|
192806
192868
|
buildHandle() {
|
|
192807
192869
|
switch (this.specification.uidStrategy) {
|
|
192808
192870
|
case "single":
|
|
@@ -194249,7 +194311,7 @@ async function fetchApiVersions(session, preferredBehaviour) {
|
|
|
194249
194311
|
let storeName = session.storeFqdn.replace(".myshopify.com", "");
|
|
194250
194312
|
throw new AbortError(outputContent`Looks like you don't have access this dev store: (${outputToken.link(storeName, `https://${session.storeFqdn}`)})`, outputContent`If you're not the owner, create a dev store staff account for yourself`);
|
|
194251
194313
|
}
|
|
194252
|
-
throw error instanceof ClientError && (error.response.status === 401 || error.response.status === 404) ? new AbortError(`Error connecting to your store ${session.storeFqdn}: ${error.message} ${error.response.status} ${error.response.data}`) : new BugError(`Unknown error connecting to your store ${session.storeFqdn}: ${error instanceof Error ? error.message : String(error)}`);
|
|
194314
|
+
throw error instanceof ClientError && (error.response.status === 401 || error.response.status === 404) ? new AbortError(`Error connecting to your store ${session.storeFqdn}: ${error.message} ${error.response.status} ${error.response.data}`) : isNetworkError(error) ? new AbortError(`Network error connecting to your store ${session.storeFqdn}: ${error instanceof Error ? error.message : String(error)}`, "Check your internet connection and try again.") : new BugError(`Unknown error connecting to your store ${session.storeFqdn}: ${error instanceof Error ? error.message : String(error)}`);
|
|
194253
194315
|
}
|
|
194254
194316
|
}
|
|
194255
194317
|
function adminUrl(store, version, session) {
|
|
@@ -194336,7 +194398,7 @@ var dependency5 = "@shopify/checkout-ui-extensions", validatePoints = (config2)
|
|
|
194336
194398
|
},
|
|
194337
194399
|
validate: async (config2, path, directory) => validateUIExtensionPointConfig(directory, config2.extension_points, path),
|
|
194338
194400
|
deployConfig: async (config2, directory) => {
|
|
194339
|
-
let transformedExtensionPoints = config2.extension_points
|
|
194401
|
+
let transformedExtensionPoints = config2.extension_points?.map(addDistPathToAssets) ?? [];
|
|
194340
194402
|
return {
|
|
194341
194403
|
api_version: config2.api_version,
|
|
194342
194404
|
extension_points: transformedExtensionPoints,
|
|
@@ -194348,9 +194410,9 @@ var dependency5 = "@shopify/checkout-ui-extensions", validatePoints = (config2)
|
|
|
194348
194410
|
};
|
|
194349
194411
|
},
|
|
194350
194412
|
getBundleExtensionStdinContent: (config2) => {
|
|
194351
|
-
let shouldIncludeShopifyExtend = isRemoteDomExtension(config2),
|
|
194413
|
+
let shouldIncludeShopifyExtend = isRemoteDomExtension(config2), extensionPoints = config2.extension_points || [], main = extensionPoints.map(({ target, module: module2 }, index) => shouldIncludeShopifyExtend ? `import Target_${index} from '${module2}';shopify.extend('${target}', (...args) => Target_${index}(...args));` : `import '${module2}';`).join(`
|
|
194352
194414
|
`), assets = {};
|
|
194353
|
-
|
|
194415
|
+
extensionPoints.forEach((extensionPoint) => {
|
|
194354
194416
|
Object.entries(extensionPoint.build_manifest.assets).forEach(([identifier, asset]) => {
|
|
194355
194417
|
identifier !== AssetIdentifier.Main && (assets[identifier] = {
|
|
194356
194418
|
identifier,
|
|
@@ -194365,7 +194427,7 @@ var dependency5 = "@shopify/checkout-ui-extensions", validatePoints = (config2)
|
|
|
194365
194427
|
...assetsArray.length ? { assets: assetsArray } : {}
|
|
194366
194428
|
};
|
|
194367
194429
|
},
|
|
194368
|
-
hasExtensionPointTarget: (config2, requestedTarget) => config2.extension_points
|
|
194430
|
+
hasExtensionPointTarget: (config2, requestedTarget) => config2.extension_points?.find((extensionPoint) => extensionPoint.target === requestedTarget) !== void 0,
|
|
194369
194431
|
contributeToSharedTypeFile: async (extension, typeDefinitionsByFile) => {
|
|
194370
194432
|
if (!isRemoteDomExtension(extension.configuration))
|
|
194371
194433
|
return;
|
|
@@ -194961,7 +195023,7 @@ function loadFwConfigFile(rootPath, fwConfigFileName, fwConfigFiles = {}) {
|
|
|
194961
195023
|
|
|
194962
195024
|
// ../cli-kit/dist/public/node/toml.js
|
|
194963
195025
|
init_cjs_shims();
|
|
194964
|
-
var toml = __toESM(require_toml());
|
|
195026
|
+
var toml = __toESM(require_toml(), 1);
|
|
194965
195027
|
function decodeToml(input) {
|
|
194966
195028
|
let normalizedInput = input.replace(/\r\n$/g, `
|
|
194967
195029
|
`);
|
|
@@ -195077,7 +195139,7 @@ var AppLoader = class {
|
|
|
195077
195139
|
async loaded() {
|
|
195078
195140
|
let { configuration, directory, configurationLoadResultMetadata, configSchema } = this.loadedConfiguration;
|
|
195079
195141
|
await logMetadataFromAppLoadingProcess(configurationLoadResultMetadata);
|
|
195080
|
-
let dotenv = await loadDotEnv(directory, configuration.path), extensions = await this.loadExtensions(directory, configuration), packageJSONPath = joinPath(directory, "package.json"), name = this.previousApp?.name ??
|
|
195142
|
+
let dotenv = await loadDotEnv(directory, configuration.path), extensions = await this.loadExtensions(directory, configuration), packageJSONPath = joinPath(directory, "package.json"), configName = configuration.name, configHandle = configuration.handle, name = this.previousApp?.name ?? configHandle ?? configName ?? "", nodeDependencies = this.previousApp?.nodeDependencies ?? await getDependencies(packageJSONPath), packageManager = this.previousApp?.packageManager ?? await getPackageManager(directory), usesWorkspaces2 = this.previousApp?.usesWorkspaces ?? await usesWorkspaces(directory), hiddenConfig = await loadHiddenConfig(directory, configuration);
|
|
195081
195143
|
this.previousApp || await showMultipleCLIWarningIfNeeded(directory, nodeDependencies);
|
|
195082
195144
|
let { webs, usedCustomLayout: usedCustomLayoutForWeb } = await this.loadWebs(directory, configuration.web_directories), appClass = new App({
|
|
195083
195145
|
name,
|
|
@@ -195117,7 +195179,11 @@ var AppLoader = class {
|
|
|
195117
195179
|
validateWebs(webs) {
|
|
195118
195180
|
[WebType.Backend, WebType.Frontend].forEach((webType) => {
|
|
195119
195181
|
let websOfType = webs.filter((web2) => web2.configuration.roles.includes(webType));
|
|
195120
|
-
|
|
195182
|
+
if (websOfType.length > 1) {
|
|
195183
|
+
let conflictingPaths = websOfType.map((web2) => joinPath(web2.directory, configurationFileNames.web)), pathsList = conflictingPaths.map((path) => ` ${path}`).join(`
|
|
195184
|
+
`), lastConflictingPath = conflictingPaths[conflictingPaths.length - 1];
|
|
195185
|
+
this.abortOrReport(outputContent`You can only have one "web" configuration file with the ${outputToken.yellow(webType)} role in your app.\n\nConflicting configurations found at:\n${pathsList}`, void 0, lastConflictingPath);
|
|
195186
|
+
}
|
|
195121
195187
|
});
|
|
195122
195188
|
}
|
|
195123
195189
|
async loadWeb(WebConfigurationFile) {
|
|
@@ -195202,9 +195268,13 @@ var AppLoader = class {
|
|
|
195202
195268
|
return specification.appModuleFeatures().includes("single_js_entry_path") ? (entryPath = (await Promise.all(["index"].flatMap((name) => [`${name}.js`, `${name}.jsx`, `${name}.ts`, `${name}.tsx`]).flatMap((fileName) => [`src/${fileName}`, fileName]).map((relativePath2) => joinPath(directory, relativePath2)).map(async (sourcePath) => await fileExists(sourcePath) ? sourcePath : void 0))).find((sourcePath) => sourcePath !== void 0), entryPath || this.abortOrReport(outputContent`Couldn't find an index.{js,jsx,ts,tsx} file in the directories ${outputToken.path(directory)} or ${outputToken.path(joinPath(directory, "src"))}`, void 0, directory)) : specification.identifier === "function" && (entryPath = (await Promise.all(["src/index.js", "src/index.ts", "src/main.rs"].map((relativePath2) => joinPath(directory, relativePath2)).map(async (sourcePath) => await fileExists(sourcePath) ? sourcePath : void 0))).find((sourcePath) => sourcePath !== void 0)), entryPath;
|
|
195203
195269
|
}
|
|
195204
195270
|
abortOrReport(errorMessage, fallback, configurationPath) {
|
|
195205
|
-
|
|
195206
|
-
|
|
195207
|
-
|
|
195271
|
+
switch (this.mode) {
|
|
195272
|
+
case "strict":
|
|
195273
|
+
case "local":
|
|
195274
|
+
throw new AbortError(errorMessage);
|
|
195275
|
+
case "report":
|
|
195276
|
+
return this.errors.addError(configurationPath, errorMessage), fallback;
|
|
195277
|
+
}
|
|
195208
195278
|
}
|
|
195209
195279
|
getDevApplicationURLs(currentConfiguration, webs) {
|
|
195210
195280
|
let previousDevUrls = this.previousApp?.devApplicationURLs;
|
|
@@ -195371,10 +195441,6 @@ async function loadHiddenConfig(appDirectory, configuration) {
|
|
|
195371
195441
|
return {};
|
|
195372
195442
|
}
|
|
195373
195443
|
}
|
|
195374
|
-
async function loadAppName(appDirectory) {
|
|
195375
|
-
let packageJSONPath = joinPath(appDirectory, "package.json");
|
|
195376
|
-
return await getPackageName(packageJSONPath) ?? basename(appDirectory);
|
|
195377
|
-
}
|
|
195378
195444
|
async function getProjectType(webs) {
|
|
195379
195445
|
let backendWebs = webs.filter((web2) => isWebType(web2, WebType.Backend)), frontendWebs = webs.filter((web2) => isWebType(web2, WebType.Frontend));
|
|
195380
195446
|
if (backendWebs.length > 1) {
|
|
@@ -195531,7 +195597,7 @@ async function selectStorePrompt({ stores, hasMorePages = !1, onSearchForStoresB
|
|
|
195531
195597
|
}
|
|
195532
195598
|
async function confirmConversionToTransferDisabledStorePrompt() {
|
|
195533
195599
|
return renderConfirmationPrompt({
|
|
195534
|
-
message: "Make this store transfer-disabled? For security, once you use a
|
|
195600
|
+
message: "Make this store transfer-disabled? For security, once you use a dev store to preview an app locally, the store can never be transferred to a merchant to use as a production store.",
|
|
195535
195601
|
confirmationMessage: "Yes, make this store transfer-disabled permanently",
|
|
195536
195602
|
cancellationMessage: "No, select another store",
|
|
195537
195603
|
defaultValue: !1
|
|
@@ -200951,7 +201017,7 @@ function getAppIdentifiers({ app }, systemEnvironment = process.env) {
|
|
|
200951
201017
|
// ../app/dist/cli/services/context.js
|
|
200952
201018
|
var InvalidApiKeyErrorMessage = (apiKey) => ({
|
|
200953
201019
|
message: outputContent`Invalid Client ID: ${apiKey}`,
|
|
200954
|
-
tryMessage: outputContent`You can find the Client ID in the app settings in the
|
|
201020
|
+
tryMessage: outputContent`You can find the Client ID in the app settings in the Developer Dashboard.`
|
|
200955
201021
|
}), resetHelpMessage = [
|
|
200956
201022
|
"You can pass",
|
|
200957
201023
|
{ command: "--reset" },
|
|
@@ -201744,7 +201810,7 @@ var import_core2 = __toESM(require_lib2()), BaseCommand = class extends import_c
|
|
|
201744
201810
|
return error.skipOclifErrorHandling = !0, await errorHandler(error, this.config), import_core2.Errors.handle(error);
|
|
201745
201811
|
}
|
|
201746
201812
|
async init() {
|
|
201747
|
-
return this.exitWithTimestampWhenEnvVariablePresent(), setCurrentCommandId(this.id ?? ""), isDevelopment() || await registerCleanBugsnagErrorsFromWithinPlugins(this.config), this.showNpmFlagWarning(), await showNotificationsIfNeeded(), super.init();
|
|
201813
|
+
return this.exitWithTimestampWhenEnvVariablePresent(), setCurrentCommandId(this.id ?? ""), isDevelopment() || await registerCleanBugsnagErrorsFromWithinPlugins(this.config), await removeDuplicatedPlugins(this.config), this.showNpmFlagWarning(), await showNotificationsIfNeeded(), super.init();
|
|
201748
201814
|
}
|
|
201749
201815
|
// NPM creates an environment variable for every flag passed to a script.
|
|
201750
201816
|
// This function checks for the presence of any of the available CLI flags
|
|
@@ -201863,6 +201929,23 @@ function argsFromEnvironment(environment, options, noDefaultsResult) {
|
|
|
201863
201929
|
function commandSupportsFlag(flags, flagName) {
|
|
201864
201930
|
return !!flags && Object.prototype.hasOwnProperty.call(flags, flagName);
|
|
201865
201931
|
}
|
|
201932
|
+
async function removeDuplicatedPlugins(config2) {
|
|
201933
|
+
let plugins = Array.from(config2.plugins.values()), bundlePlugins = ["@shopify/app", "@shopify/plugin-cloudflare"], pluginsToRemove = plugins.filter((plugin) => bundlePlugins.includes(plugin.name));
|
|
201934
|
+
if (pluginsToRemove.length > 0) {
|
|
201935
|
+
let commandsToRun = pluginsToRemove.map((plugin) => ` - shopify plugins remove ${plugin.name}`).join(`
|
|
201936
|
+
`);
|
|
201937
|
+
renderWarning({
|
|
201938
|
+
headline: `Unsupported plugins detected: ${pluginsToRemove.map((plugin) => plugin.name).join(", ")}`,
|
|
201939
|
+
body: [
|
|
201940
|
+
"They are already included in the CLI and installing them as custom plugins can cause conflicts.",
|
|
201941
|
+
`You can fix it by running:
|
|
201942
|
+
${commandsToRun}`
|
|
201943
|
+
]
|
|
201944
|
+
});
|
|
201945
|
+
}
|
|
201946
|
+
let filteredPlugins = plugins.filter((plugin) => !bundlePlugins.includes(plugin.name));
|
|
201947
|
+
config2.plugins = new Map(filteredPlugins.map((plugin) => [plugin.name, plugin]));
|
|
201948
|
+
}
|
|
201866
201949
|
var base_command_default = BaseCommand;
|
|
201867
201950
|
|
|
201868
201951
|
// ../app/dist/cli/utilities/app-command.js
|
|
@@ -201886,7 +201969,7 @@ init_cjs_shims();
|
|
|
201886
201969
|
init_cjs_shims();
|
|
201887
201970
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
201888
201971
|
async function launchCLI(options) {
|
|
201889
|
-
let { errorHandler: errorHandler2 } = await import("./error-handler-
|
|
201972
|
+
let { errorHandler: errorHandler2 } = await import("./error-handler-OMN5NZFN.js"), { isDevelopment: isDevelopment2 } = await import("./local-XH6K2UZK.js"), oclif = await import("./lib-IF6LVQLE.js"), { ShopifyConfig } = await import("./custom-oclif-loader-TBJQ73OQ.js");
|
|
201890
201973
|
isDevelopment2() && (oclif.default.settings.debug = !0);
|
|
201891
201974
|
try {
|
|
201892
201975
|
let config2 = new ShopifyConfig({ root: fileURLToPath2(options.moduleURL) });
|
|
@@ -201901,7 +201984,7 @@ var import_core3 = __toESM(require_lib2());
|
|
|
201901
201984
|
async function exitIfOldNodeVersion(versions2 = process.versions) {
|
|
201902
201985
|
let nodeVersion = versions2.node, nodeMajorVersion = Number(nodeVersion.split(".")[0]);
|
|
201903
201986
|
if (nodeMajorVersion < 18) {
|
|
201904
|
-
let { renderError: renderError2 } = await import("./ui-
|
|
201987
|
+
let { renderError: renderError2 } = await import("./ui-ROZ5MAUS.js");
|
|
201905
201988
|
renderError2({
|
|
201906
201989
|
headline: "Upgrade to a supported Node version now.",
|
|
201907
201990
|
body: [
|
|
@@ -201928,7 +202011,7 @@ async function runCLI(options, launchCLI2 = launchCLI, argv = process.argv, env
|
|
|
201928
202011
|
return setupEnvironmentVariables(options, argv, env), options.runInCreateMode && await addInitToArgvWhenRunningCreateCLI(options, argv), forceNoColor(argv, env), await exitIfOldNodeVersion(versions2), launchCLI2({ moduleURL: options.moduleURL });
|
|
201929
202012
|
}
|
|
201930
202013
|
async function addInitToArgvWhenRunningCreateCLI(options, argv = process.argv) {
|
|
201931
|
-
let { findUpAndReadPackageJson: findUpAndReadPackageJson2 } = await import("./node-package-manager-
|
|
202014
|
+
let { findUpAndReadPackageJson: findUpAndReadPackageJson2 } = await import("./node-package-manager-5EX7KILU.js"), { moduleDirectory: moduleDirectory2 } = await import("./path-COZT77T2.js"), name = (await findUpAndReadPackageJson2(moduleDirectory2(options.moduleURL))).content.name.replace("@shopify/create-", "");
|
|
201932
202015
|
if (argv.findIndex((arg) => arg.includes("init")) === -1) {
|
|
201933
202016
|
let initIndex2 = argv.findIndex((arg) => arg.match(new RegExp(`bin(\\/|\\\\)+(create-${name}|dev|run)`))) + 1;
|
|
201934
202017
|
argv.splice(initIndex2, 0, "init");
|
|
@@ -201961,9 +202044,7 @@ var globalFlags = {
|
|
|
201961
202044
|
// ../app/dist/cli/commands/app/build.js
|
|
201962
202045
|
var _a, Build = class extends AppUnlinkedCommand {
|
|
201963
202046
|
async run() {
|
|
201964
|
-
let { flags } = await this.parse(_a);
|
|
201965
|
-
flags["api-key"] && await showApiKeyDeprecationWarning();
|
|
201966
|
-
let apiKey = flags["client-id"] ?? flags["api-key"];
|
|
202047
|
+
let { flags } = await this.parse(_a), clientId = flags["client-id"];
|
|
201967
202048
|
await addPublicMetadata(() => ({
|
|
201968
202049
|
cmd_app_dependency_installation_skipped: flags["skip-dependencies-installation"]
|
|
201969
202050
|
}));
|
|
@@ -201971,7 +202052,7 @@ var _a, Build = class extends AppUnlinkedCommand {
|
|
|
201971
202052
|
directory: flags.path,
|
|
201972
202053
|
userProvidedConfigName: flags.config
|
|
201973
202054
|
});
|
|
201974
|
-
return await build_default({ app, skipDependenciesInstallation: flags["skip-dependencies-installation"], apiKey }), { app };
|
|
202055
|
+
return await build_default({ app, skipDependenciesInstallation: flags["skip-dependencies-installation"], apiKey: clientId }), { app };
|
|
201975
202056
|
}
|
|
201976
202057
|
};
|
|
201977
202058
|
_a = Build;
|
|
@@ -201986,12 +202067,6 @@ Build.flags = {
|
|
|
201986
202067
|
description: "Skips the installation of dependencies. Deprecated, use workspaces instead.",
|
|
201987
202068
|
env: "SHOPIFY_FLAG_SKIP_DEPENDENCIES_INSTALLATION",
|
|
201988
202069
|
default: !1
|
|
201989
|
-
}),
|
|
201990
|
-
"api-key": import_core4.Flags.string({
|
|
201991
|
-
hidden: !0,
|
|
201992
|
-
description: "Application's API key that will be exposed at build time.",
|
|
201993
|
-
env: "SHOPIFY_FLAG_API_KEY",
|
|
201994
|
-
exclusive: ["config"]
|
|
201995
202070
|
})
|
|
201996
202071
|
};
|
|
201997
202072
|
var build_default2 = Build;
|
|
@@ -202021,8 +202096,8 @@ var _a2, ConfigLink = class extends AppLinkedCommand {
|
|
|
202021
202096
|
}
|
|
202022
202097
|
};
|
|
202023
202098
|
_a2 = ConfigLink;
|
|
202024
|
-
ConfigLink.summary = "Fetch your app configuration from the
|
|
202025
|
-
ConfigLink.descriptionWithMarkdown = `Pulls app configuration from the
|
|
202099
|
+
ConfigLink.summary = "Fetch your app configuration from the Developer Dashboard.";
|
|
202100
|
+
ConfigLink.descriptionWithMarkdown = `Pulls app configuration from the Developer Dashboard and creates or overwrites a configuration file. You can create a new app with this command to start with a default configuration file.
|
|
202026
202101
|
|
|
202027
202102
|
For more information on the format of the created TOML configuration file, refer to the [App configuration](https://shopify.dev/docs/apps/tools/cli/configuration) page.
|
|
202028
202103
|
`;
|
|
@@ -202085,54 +202160,43 @@ function endHRTimeInMs(startTime) {
|
|
|
202085
202160
|
// ../app/dist/cli/services/dev/app-events/file-watcher.js
|
|
202086
202161
|
var import_ignore2 = __toESM(require_ignore2(), 1), DEFAULT_DEBOUNCE_TIME_IN_MS = 200, EXTENSION_CREATION_TIMEOUT_IN_MS = 6e4, EXTENSION_CREATION_CHECK_INTERVAL_IN_MS = 200, FILE_DELETE_TIMEOUT_IN_MS = 500, FileWatcher = class {
|
|
202087
202162
|
constructor(app, options, debounceTime = DEFAULT_DEBOUNCE_TIME_IN_MS) {
|
|
202088
|
-
this.currentEvents = [], this.extensionPaths = [], this.ignored = {}, this.emitEvents = () => {
|
|
202163
|
+
this.currentEvents = [], this.extensionPaths = [], this.ignored = {}, this.extensionWatchedFiles = /* @__PURE__ */ new Map(), this.emitEvents = () => {
|
|
202089
202164
|
let events = this.currentEvents;
|
|
202090
202165
|
this.currentEvents = [];
|
|
202091
202166
|
let message = `\u{1F509} ${events.length} EVENTS EMITTED in files: ${events.map((event) => event.path).join(`
|
|
202092
202167
|
`)}`;
|
|
202093
202168
|
outputDebug(message, this.options.stdout), this.onChangeCallback?.(events);
|
|
202094
202169
|
}, this.handleFileEvent = (event, path) => {
|
|
202095
|
-
let startTime = startHRTime(),
|
|
202170
|
+
let startTime = startHRTime(), normalizedPath = normalizePath(path), isConfigAppPath = path === this.app.configuration.path, isExtensionToml = path.endsWith(".extension.toml");
|
|
202096
202171
|
if (outputDebug(`\u{1F300}: ${event} ${path.replace(this.app.directory, "")}
|
|
202097
|
-
`),
|
|
202098
|
-
|
|
202099
|
-
|
|
202100
|
-
|
|
202101
|
-
|
|
202102
|
-
|
|
202103
|
-
|
|
202104
|
-
case "add":
|
|
202105
|
-
if (!isExtensionToml) {
|
|
202106
|
-
this.pushEvent({ type: "file_created", path, extensionPath, startTime });
|
|
202107
|
-
break;
|
|
202108
|
-
}
|
|
202109
|
-
let totalWaitedTime = 0, realPath = dirname(path), intervalId = setInterval(() => {
|
|
202110
|
-
fileExistsSync(joinPath(realPath, configurationFileNames.lockFile)) ? (outputDebug(`Waiting for extension to complete creation: ${path}
|
|
202111
|
-
`), totalWaitedTime += EXTENSION_CREATION_CHECK_INTERVAL_IN_MS) : (clearInterval(intervalId), this.extensionPaths.push(realPath), this.pushEvent({ type: "extension_folder_created", path: realPath, extensionPath, startTime })), totalWaitedTime >= EXTENSION_CREATION_TIMEOUT_IN_MS && (clearInterval(intervalId), this.options.stderr.write(`Error loading new extension at path: ${path}.
|
|
202112
|
-
Please restart the process.`));
|
|
202113
|
-
}, EXTENSION_CREATION_CHECK_INTERVAL_IN_MS);
|
|
202114
|
-
break;
|
|
202115
|
-
case "unlink":
|
|
202116
|
-
if (path.endsWith(configurationFileNames.lockFile))
|
|
202117
|
-
break;
|
|
202118
|
-
isConfigAppPath ? this.pushEvent({ type: "app_config_deleted", path, extensionPath, startTime }) : isExtensionToml ? (this.extensionPaths = this.extensionPaths.filter((extPath) => extPath !== extensionPath), this.pushEvent({ type: "extension_folder_deleted", path: extensionPath, extensionPath, startTime })) : setTimeout(() => {
|
|
202119
|
-
this.extensionPaths.includes(extensionPath) && this.pushEvent({ type: "file_deleted", path, extensionPath, startTime });
|
|
202120
|
-
}, FILE_DELETE_TIMEOUT_IN_MS);
|
|
202121
|
-
break;
|
|
202122
|
-
// These events are ignored
|
|
202123
|
-
case "addDir":
|
|
202124
|
-
case "unlinkDir":
|
|
202125
|
-
break;
|
|
202172
|
+
`), isConfigAppPath)
|
|
202173
|
+
this.handleEventForExtension(event, path, this.app.directory, startTime, !1);
|
|
202174
|
+
else {
|
|
202175
|
+
let affectedExtensions = this.extensionWatchedFiles.get(normalizedPath), isUnknownExtension = affectedExtensions === void 0 || affectedExtensions.size === 0;
|
|
202176
|
+
if (isUnknownExtension && !isExtensionToml && !isConfigAppPath) {
|
|
202177
|
+
outputDebug(`\u{1F300}: File ${path} is not watched by any extension`, this.options.stdout);
|
|
202178
|
+
return;
|
|
202126
202179
|
}
|
|
202180
|
+
for (let extensionPath of affectedExtensions ?? [])
|
|
202181
|
+
this.handleEventForExtension(event, path, extensionPath, startTime, !1);
|
|
202182
|
+
isUnknownExtension && this.handleEventForExtension(event, path, this.app.directory, startTime, !0);
|
|
202183
|
+
}
|
|
202184
|
+
this.debouncedEmit();
|
|
202127
202185
|
}, this.close = () => {
|
|
202128
|
-
outputDebug("Closing file watcher", this.options.stdout), this.watcher
|
|
202186
|
+
this.watcher && (outputDebug("Closing file watcher", this.options.stdout), this.watcher.close().then(() => outputDebug("File watching closed", this.options.stdout)).catch((error) => outputDebug(`File watching failed to close: ${error.message}`, this.options.stderr)));
|
|
202129
202187
|
}, this.app = app, this.options = options, this.debouncedEmit = debounce(this.emitEvents.bind(this), debounceTime, { leading: !0, trailing: !0 }), this.updateApp(app);
|
|
202130
202188
|
}
|
|
202131
202189
|
onChange(listener) {
|
|
202132
202190
|
this.onChangeCallback = listener;
|
|
202133
202191
|
}
|
|
202192
|
+
/**
|
|
202193
|
+
* Starts a new file watcher, and closes the previous one if it exists.
|
|
202194
|
+
* This ensures the watcher picks up any changes in what files need to be watched.
|
|
202195
|
+
*/
|
|
202134
202196
|
async start() {
|
|
202135
|
-
let
|
|
202197
|
+
let fullExtensionDirectories = [...this.app.configuration.extension_directories ?? ["extensions"]].map((directory) => joinPath(this.app.directory, directory)), watchPaths = [this.app.configuration.path, ...fullExtensionDirectories], allWatchedFiles = this.getAllWatchedFiles();
|
|
202198
|
+
watchPaths.push(...allWatchedFiles), this.close();
|
|
202199
|
+
let { default: chokidar } = await import("./chokidar-HTKREZL3.js");
|
|
202136
202200
|
this.watcher = chokidar.watch(watchPaths, {
|
|
202137
202201
|
ignored: [
|
|
202138
202202
|
"**/node_modules/**",
|
|
@@ -202145,14 +202209,37 @@ var import_ignore2 = __toESM(require_ignore2(), 1), DEFAULT_DEBOUNCE_TIME_IN_MS
|
|
|
202145
202209
|
],
|
|
202146
202210
|
persistent: !0,
|
|
202147
202211
|
ignoreInitial: !0
|
|
202148
|
-
}), this.watcher.on("all", this.handleFileEvent), this.
|
|
202212
|
+
}), this.watcher.on("all", this.handleFileEvent), this.addAbortListener(), outputDebug(`File watcher started with ${watchPaths.length} paths`, this.options.stdout);
|
|
202149
202213
|
}
|
|
202150
202214
|
updateApp(app) {
|
|
202151
|
-
this.app = app, this.extensionPaths = this.app.
|
|
202152
|
-
var
|
|
202153
|
-
(
|
|
202215
|
+
this.app = app, this.extensionPaths = this.app.nonConfigExtensions.map((ext) => normalizePath(ext.directory)).filter((dir) => dir !== this.app.directory), this.extensionPaths.forEach((path) => {
|
|
202216
|
+
var _a42;
|
|
202217
|
+
(_a42 = this.ignored)[path] ?? (_a42[path] = this.createIgnoreInstance(path));
|
|
202154
202218
|
});
|
|
202155
202219
|
}
|
|
202220
|
+
addAbortListener() {
|
|
202221
|
+
this.options.signal.removeEventListener("abort", this.close), this.options.signal.addEventListener("abort", this.close);
|
|
202222
|
+
}
|
|
202223
|
+
/**
|
|
202224
|
+
* Gets all files that need to be watched from all extensions
|
|
202225
|
+
*/
|
|
202226
|
+
getAllWatchedFiles() {
|
|
202227
|
+
this.extensionWatchedFiles.clear();
|
|
202228
|
+
let extensionResults = this.app.nonConfigExtensions.map((extension) => ({
|
|
202229
|
+
extension,
|
|
202230
|
+
watchedFiles: extension.watchedFiles()
|
|
202231
|
+
})), allFiles = /* @__PURE__ */ new Set();
|
|
202232
|
+
for (let { extension, watchedFiles } of extensionResults) {
|
|
202233
|
+
let extensionDir = normalizePath(extension.directory);
|
|
202234
|
+
for (let file of watchedFiles) {
|
|
202235
|
+
let normalizedPath = normalizePath(file);
|
|
202236
|
+
allFiles.add(normalizedPath);
|
|
202237
|
+
let extensionsSet = this.extensionWatchedFiles.get(normalizedPath) ?? /* @__PURE__ */ new Set();
|
|
202238
|
+
extensionsSet.add(extensionDir), this.extensionWatchedFiles.set(normalizedPath, extensionsSet);
|
|
202239
|
+
}
|
|
202240
|
+
}
|
|
202241
|
+
return Array.from(allFiles);
|
|
202242
|
+
}
|
|
202156
202243
|
/**
|
|
202157
202244
|
* Adds a new event to the current events list and schedules the debounced emit function.
|
|
202158
202245
|
* If the event is already in the list, it will not be added again.
|
|
@@ -202160,7 +202247,7 @@ var import_ignore2 = __toESM(require_ignore2(), 1), DEFAULT_DEBOUNCE_TIME_IN_MS
|
|
|
202160
202247
|
* @param event - The event to be added
|
|
202161
202248
|
*/
|
|
202162
202249
|
pushEvent(event) {
|
|
202163
|
-
this.shouldIgnoreEvent(event) || (event.type === "extension_folder_created" && (this.ignored[event.path] = this.createIgnoreInstance(event.path)), !this.currentEvents.some((extEvent) => extEvent.path === event.path && extEvent.type === event.type) &&
|
|
202250
|
+
this.shouldIgnoreEvent(event) || (event.type === "extension_folder_created" && (this.ignored[event.path] = this.createIgnoreInstance(event.path)), !this.currentEvents.some((extEvent) => extEvent.path === event.path && extEvent.type === event.type && extEvent.extensionPath === event.extensionPath) && this.currentEvents.push(event));
|
|
202164
202251
|
}
|
|
202165
202252
|
/**
|
|
202166
202253
|
* Whether an event should be ignored or not based on the extension's watch paths and gitignore file.
|
|
@@ -202173,7 +202260,7 @@ var import_ignore2 = __toESM(require_ignore2(), 1), DEFAULT_DEBOUNCE_TIME_IN_MS
|
|
|
202173
202260
|
shouldIgnoreEvent(event) {
|
|
202174
202261
|
if (event.type === "extension_folder_deleted" || event.type === "extension_folder_created")
|
|
202175
202262
|
return !1;
|
|
202176
|
-
let watchPaths = this.app.realExtensions.find((ext) => ext.directory === event.extensionPath)?.
|
|
202263
|
+
let watchPaths = this.app.realExtensions.find((ext) => ext.directory === event.extensionPath)?.watchedFiles(), ignoreInstance = this.ignored[event.extensionPath];
|
|
202177
202264
|
if (watchPaths)
|
|
202178
202265
|
return !watchPaths.some((pattern) => matchGlob(event.path, pattern));
|
|
202179
202266
|
if (ignoreInstance) {
|
|
@@ -202182,6 +202269,38 @@ var import_ignore2 = __toESM(require_ignore2(), 1), DEFAULT_DEBOUNCE_TIME_IN_MS
|
|
|
202182
202269
|
}
|
|
202183
202270
|
return !1;
|
|
202184
202271
|
}
|
|
202272
|
+
handleEventForExtension(event, path, extensionPath, startTime, isUnknownExtension) {
|
|
202273
|
+
let isExtensionToml = path.endsWith(".extension.toml"), isConfigAppPath = path === this.app.configuration.path;
|
|
202274
|
+
switch (event) {
|
|
202275
|
+
case "change":
|
|
202276
|
+
if (isUnknownExtension)
|
|
202277
|
+
break;
|
|
202278
|
+
isExtensionToml || isConfigAppPath ? this.pushEvent({ type: "extensions_config_updated", path, extensionPath, startTime }) : this.pushEvent({ type: "file_updated", path, extensionPath, startTime });
|
|
202279
|
+
break;
|
|
202280
|
+
case "add":
|
|
202281
|
+
if (!isExtensionToml) {
|
|
202282
|
+
this.pushEvent({ type: "file_created", path, extensionPath, startTime });
|
|
202283
|
+
break;
|
|
202284
|
+
}
|
|
202285
|
+
let totalWaitedTime = 0, realPath = dirname(path), intervalId = setInterval(() => {
|
|
202286
|
+
fileExistsSync(joinPath(realPath, configurationFileNames.lockFile)) ? (outputDebug(`Waiting for extension to complete creation: ${path}
|
|
202287
|
+
`), totalWaitedTime += EXTENSION_CREATION_CHECK_INTERVAL_IN_MS) : (clearInterval(intervalId), this.extensionPaths.push(realPath), this.pushEvent({ type: "extension_folder_created", path: realPath, extensionPath, startTime }), this.debouncedEmit()), totalWaitedTime >= EXTENSION_CREATION_TIMEOUT_IN_MS && (clearInterval(intervalId), this.options.stderr.write(`Error loading new extension at path: ${path}.
|
|
202288
|
+
Please restart the process.`));
|
|
202289
|
+
}, EXTENSION_CREATION_CHECK_INTERVAL_IN_MS);
|
|
202290
|
+
break;
|
|
202291
|
+
case "unlink":
|
|
202292
|
+
if (path.endsWith(configurationFileNames.lockFile))
|
|
202293
|
+
break;
|
|
202294
|
+
isConfigAppPath ? this.pushEvent({ type: "app_config_deleted", path, extensionPath, startTime }) : isExtensionToml ? (this.extensionPaths = this.extensionPaths.filter((extPath) => extPath !== extensionPath), this.pushEvent({ type: "extension_folder_deleted", path: extensionPath, extensionPath, startTime })) : setTimeout(() => {
|
|
202295
|
+
this.extensionPaths.includes(extensionPath) && (this.pushEvent({ type: "file_deleted", path, extensionPath, startTime }), this.debouncedEmit());
|
|
202296
|
+
}, FILE_DELETE_TIMEOUT_IN_MS);
|
|
202297
|
+
break;
|
|
202298
|
+
// These events are ignored
|
|
202299
|
+
case "addDir":
|
|
202300
|
+
case "unlinkDir":
|
|
202301
|
+
break;
|
|
202302
|
+
}
|
|
202303
|
+
}
|
|
202185
202304
|
// Creates an "Ignore" instance for the given path if a .gitignore file exists, otherwise undefined
|
|
202186
202305
|
createIgnoreInstance(path) {
|
|
202187
202306
|
let gitIgnorePath = joinPath(path, ".gitignore");
|
|
@@ -202367,7 +202486,7 @@ var AppEventWatcher = class extends EventEmitter {
|
|
|
202367
202486
|
handleWatcherEvents(events, this.app, this.options).then(async (appEvent) => {
|
|
202368
202487
|
if (appEvent?.extensionEvents.length === 0 && outputDebug("Change detected, but no extensions were affected"), !appEvent)
|
|
202369
202488
|
return;
|
|
202370
|
-
this.app = appEvent.app, appEvent.appWasReloaded && this.fileWatcher?.updateApp(this.app), await this.esbuildManager.updateContexts(appEvent);
|
|
202489
|
+
this.app = appEvent.app, appEvent.appWasReloaded && this.fileWatcher?.updateApp(this.app), await this.esbuildManager.updateContexts(appEvent), await this.rescanImports(appEvent);
|
|
202371
202490
|
let buildableEvents = appEvent.extensionEvents.filter((extEvent) => extEvent.type !== EventType.Deleted);
|
|
202372
202491
|
await this.buildExtensions(buildableEvents), await this.deleteExtensionsBuildOutput(appEvent), this.emit("all", appEvent);
|
|
202373
202492
|
}).catch((error) => {
|
|
@@ -202421,29 +202540,39 @@ var AppEventWatcher = class extends EventEmitter {
|
|
|
202421
202540
|
* buildForBundle method.
|
|
202422
202541
|
*/
|
|
202423
202542
|
async buildExtensions(extensionEvents) {
|
|
202424
|
-
let
|
|
202425
|
-
|
|
202426
|
-
|
|
202427
|
-
|
|
202428
|
-
|
|
202429
|
-
} catch (error) {
|
|
202430
|
-
let errors = error.errors ?? [], errorMessage = error.message, errorFile;
|
|
202431
|
-
if (errors.length) {
|
|
202432
|
-
let firstError = errors[0];
|
|
202433
|
-
errorMessage = firstError?.text, errorFile = firstError?.location?.file, formatMessagesSync2(errors, { kind: "error", color: !isUnitTest() }).forEach((error2) => {
|
|
202434
|
-
this.options.stderr.write(error2);
|
|
202435
|
-
});
|
|
202436
|
-
} else
|
|
202437
|
-
this.options.stderr.write(error.message);
|
|
202438
|
-
extEvent.buildResult = {
|
|
202439
|
-
status: "error",
|
|
202440
|
-
error: errorMessage,
|
|
202441
|
-
file: errorFile,
|
|
202442
|
-
uid: ext.uid
|
|
202443
|
-
};
|
|
202444
|
-
}
|
|
202543
|
+
let groupedByUid = groupBy(extensionEvents, (event) => event.extension.uid), groupedExtensionEvents = [];
|
|
202544
|
+
for (let events of Object.values(groupedByUid))
|
|
202545
|
+
events.length > 0 && events[0] && groupedExtensionEvents.push({
|
|
202546
|
+
extension: events[0].extension,
|
|
202547
|
+
events
|
|
202445
202548
|
});
|
|
202446
|
-
})
|
|
202549
|
+
let promises = groupedExtensionEvents.map(async ({ extension: ext, events }) => useConcurrentOutputContext({ outputPrefix: ext.handle, stripAnsi: !1 }, async () => {
|
|
202550
|
+
try {
|
|
202551
|
+
this.esbuildManager.contexts?.[ext.uid]?.length ? (await this.esbuildManager.rebuildContext(ext), this.options.stdout.write("Build successful")) : await this.buildExtension(ext);
|
|
202552
|
+
let buildResult = { status: "ok", uid: ext.uid };
|
|
202553
|
+
events.forEach((event) => {
|
|
202554
|
+
event.buildResult = buildResult;
|
|
202555
|
+
});
|
|
202556
|
+
} catch (error) {
|
|
202557
|
+
let errors = error.errors ?? [], errorMessage = error.message, errorFile;
|
|
202558
|
+
if (errors.length) {
|
|
202559
|
+
let firstError = errors[0];
|
|
202560
|
+
errorMessage = firstError?.text, errorFile = firstError?.location?.file, formatMessagesSync2(errors, { kind: "error", color: !isUnitTest() }).forEach((error2) => {
|
|
202561
|
+
this.options.stderr.write(error2);
|
|
202562
|
+
});
|
|
202563
|
+
} else
|
|
202564
|
+
this.options.stderr.write(error.message);
|
|
202565
|
+
let buildResult = {
|
|
202566
|
+
status: "error",
|
|
202567
|
+
error: errorMessage,
|
|
202568
|
+
file: errorFile,
|
|
202569
|
+
uid: ext.uid
|
|
202570
|
+
};
|
|
202571
|
+
events.forEach((event) => {
|
|
202572
|
+
event.buildResult = buildResult;
|
|
202573
|
+
});
|
|
202574
|
+
}
|
|
202575
|
+
}));
|
|
202447
202576
|
return Promise.all(promises);
|
|
202448
202577
|
}
|
|
202449
202578
|
/**
|
|
@@ -202461,6 +202590,16 @@ var AppEventWatcher = class extends EventEmitter {
|
|
|
202461
202590
|
};
|
|
202462
202591
|
await extension.buildForBundle(buildOptions, this.buildOutputPath);
|
|
202463
202592
|
}
|
|
202593
|
+
/**
|
|
202594
|
+
* Handles import rescanning for affected extensions
|
|
202595
|
+
* Returns true if the imports changed
|
|
202596
|
+
*/
|
|
202597
|
+
async rescanImports(appEvent) {
|
|
202598
|
+
if (appEvent.path.endsWith(".toml"))
|
|
202599
|
+
return;
|
|
202600
|
+
let affectedExtensions = appEvent.extensionEvents.filter((extEvent) => extEvent.type !== EventType.Deleted).map((extEvent) => extEvent.extension);
|
|
202601
|
+
affectedExtensions.length > 0 && (await Promise.all(affectedExtensions.map(async (ext) => ext.rescanImports()))).some((changed) => changed) && await this.fileWatcher?.start();
|
|
202602
|
+
}
|
|
202464
202603
|
};
|
|
202465
202604
|
|
|
202466
202605
|
// ../app/dist/cli/commands/app/demo/watcher.js
|
|
@@ -202542,11 +202681,14 @@ async function zip(options) {
|
|
|
202542
202681
|
let dirName = dir.endsWith("/") ? dir : `${dir}/`;
|
|
202543
202682
|
archive.append(Buffer.alloc(0), { name: dirName });
|
|
202544
202683
|
}
|
|
202545
|
-
|
|
202546
|
-
|
|
202547
|
-
|
|
202548
|
-
|
|
202549
|
-
|
|
202684
|
+
let addFilesPromises = pathsToZip.map(async (filePath) => {
|
|
202685
|
+
await archiveFile(inputDirectory, filePath, archive);
|
|
202686
|
+
});
|
|
202687
|
+
Promise.all(addFilesPromises).then(() => {
|
|
202688
|
+
archive.finalize();
|
|
202689
|
+
}).catch((error) => {
|
|
202690
|
+
reject(error);
|
|
202691
|
+
});
|
|
202550
202692
|
});
|
|
202551
202693
|
}
|
|
202552
202694
|
function collectParentDirectories(fileRelativePath, accumulator) {
|
|
@@ -202559,6 +202701,13 @@ function collectParentDirectories(fileRelativePath, accumulator) {
|
|
|
202559
202701
|
currentDir = parent;
|
|
202560
202702
|
}
|
|
202561
202703
|
}
|
|
202704
|
+
async function archiveFile(inputDirectory, filePath, archive) {
|
|
202705
|
+
let fileRelativePath = relativePath(inputDirectory, filePath);
|
|
202706
|
+
if (!filePath || !fileRelativePath)
|
|
202707
|
+
return;
|
|
202708
|
+
let fileContent = await readFile(filePath);
|
|
202709
|
+
archive.append(fileContent, { name: fileRelativePath });
|
|
202710
|
+
}
|
|
202562
202711
|
async function brotliCompress(options) {
|
|
202563
202712
|
let tempTarPath = joinPath(tmpdir(), `${randomUUID2()}.tar`);
|
|
202564
202713
|
try {
|
|
@@ -202569,13 +202718,14 @@ async function brotliCompress(options) {
|
|
|
202569
202718
|
absolute: !0,
|
|
202570
202719
|
dot: !0,
|
|
202571
202720
|
followSymbolicLinks: !1
|
|
202572
|
-
}).then((pathsToZip) => {
|
|
202573
|
-
|
|
202574
|
-
|
|
202575
|
-
|
|
202576
|
-
|
|
202577
|
-
|
|
202578
|
-
|
|
202721
|
+
}).then(async (pathsToZip) => {
|
|
202722
|
+
let addFilesPromises = pathsToZip.map(async (filePath) => {
|
|
202723
|
+
await archiveFile(options.inputDirectory, filePath, archive);
|
|
202724
|
+
});
|
|
202725
|
+
await Promise.all(addFilesPromises), archive.finalize();
|
|
202726
|
+
}).catch((error) => {
|
|
202727
|
+
reject(error instanceof Error ? error : new Error(String(error)));
|
|
202728
|
+
});
|
|
202579
202729
|
});
|
|
202580
202730
|
let tarContent = readFileSync3(tempTarPath), compressed = (await import("./brotli-2OKV26Y6.js")).default.compress(tarContent, {
|
|
202581
202731
|
quality: 7,
|
|
@@ -202753,7 +202903,7 @@ function partnersErrorsSections(errors) {
|
|
|
202753
202903
|
}, []).map((section) => ({
|
|
202754
202904
|
title: section.title,
|
|
202755
202905
|
body: `
|
|
202756
|
-
${section.errorCount} error${section.errorCount > 1 ? "s" : ""} found in your
|
|
202906
|
+
${section.errorCount} error${section.errorCount > 1 ? "s" : ""} found in your extensions. Fix these issues and try deploying again.`
|
|
202757
202907
|
}));
|
|
202758
202908
|
}
|
|
202759
202909
|
|
|
@@ -203417,16 +203567,16 @@ var _a4, Deploy = class extends AppLinkedCommand {
|
|
|
203417
203567
|
cmd_deploy_flag_message_used: !!flags.message,
|
|
203418
203568
|
cmd_deploy_flag_version_used: !!flags.version,
|
|
203419
203569
|
cmd_deploy_flag_source_url_used: !!flags["source-control-url"]
|
|
203420
|
-
})), validateVersion(flags.version), validateMessage(flags.message)
|
|
203421
|
-
let
|
|
203570
|
+
})), validateVersion(flags.version), validateMessage(flags.message);
|
|
203571
|
+
let clientId = flags["client-id"];
|
|
203422
203572
|
await addPublicMetadata(() => ({
|
|
203423
203573
|
cmd_app_reset_used: flags.reset
|
|
203424
203574
|
}));
|
|
203425
203575
|
let requiredNonTTYFlags = ["force"];
|
|
203426
|
-
(await getAppConfigurationState(flags.path, flags.config)).state === "template-only" && !
|
|
203576
|
+
(await getAppConfigurationState(flags.path, flags.config)).state === "template-only" && !clientId && requiredNonTTYFlags.push("client-id"), this.failMissingNonTTYFlags(flags, requiredNonTTYFlags);
|
|
203427
203577
|
let { app, remoteApp, developerPlatformClient, organization } = await linkedAppContext({
|
|
203428
203578
|
directory: flags.path,
|
|
203429
|
-
clientId
|
|
203579
|
+
clientId,
|
|
203430
203580
|
forceRelink: flags.reset,
|
|
203431
203581
|
userProvidedConfigName: flags.config
|
|
203432
203582
|
});
|
|
@@ -203449,7 +203599,7 @@ _a4 = Deploy;
|
|
|
203449
203599
|
Deploy.summary = "Deploy your Shopify app.";
|
|
203450
203600
|
Deploy.descriptionWithMarkdown = `[Builds the app](https://shopify.dev/docs/api/shopify-cli/app/app-build), then deploys your app configuration and extensions.
|
|
203451
203601
|
|
|
203452
|
-
This command creates an app version, which is a snapshot of your app configuration and all extensions
|
|
203602
|
+
This command creates an app version, which is a snapshot of your app configuration and all extensions. This version is then released to users.
|
|
203453
203603
|
|
|
203454
203604
|
This command doesn't deploy your [web app](https://shopify.dev/docs/apps/tools/cli/structure#web-components). You need to [deploy your web app](https://shopify.dev/docs/apps/deployment/web) to your own hosting solution.
|
|
203455
203605
|
`;
|
|
@@ -203457,12 +203607,6 @@ Deploy.description = _a4.descriptionWithoutMarkdown();
|
|
|
203457
203607
|
Deploy.flags = {
|
|
203458
203608
|
...globalFlags,
|
|
203459
203609
|
...appFlags,
|
|
203460
|
-
"api-key": import_core6.Flags.string({
|
|
203461
|
-
hidden: !0,
|
|
203462
|
-
description: "The API key of your app.",
|
|
203463
|
-
env: "SHOPIFY_FLAG_APP_API_KEY",
|
|
203464
|
-
exclusive: ["config"]
|
|
203465
|
-
}),
|
|
203466
203610
|
force: import_core6.Flags.boolean({
|
|
203467
203611
|
hidden: !1,
|
|
203468
203612
|
description: "Deploy without asking for confirmation.",
|
|
@@ -204261,6 +204405,7 @@ var ThemeFilesUpsert = {
|
|
|
204261
204405
|
kind: "SelectionSet",
|
|
204262
204406
|
selections: [
|
|
204263
204407
|
{ kind: "Field", name: { kind: "Name", value: "filename" } },
|
|
204408
|
+
{ kind: "Field", name: { kind: "Name", value: "checksumMd5" } },
|
|
204264
204409
|
{ kind: "Field", name: { kind: "Name", value: "__typename" } }
|
|
204265
204410
|
]
|
|
204266
204411
|
}
|
|
@@ -204771,7 +204916,11 @@ function processUploadResults(uploadResults) {
|
|
|
204771
204916
|
results.push({
|
|
204772
204917
|
key: file.filename,
|
|
204773
204918
|
success: !0,
|
|
204774
|
-
operation: Operation.Upload
|
|
204919
|
+
operation: Operation.Upload,
|
|
204920
|
+
asset: {
|
|
204921
|
+
key: file.filename,
|
|
204922
|
+
checksum: file.checksumMd5 ?? ""
|
|
204923
|
+
}
|
|
204775
204924
|
});
|
|
204776
204925
|
}), userErrors.forEach((error) => {
|
|
204777
204926
|
error.filename || unexpectedGraphQLError(`Error uploading theme files: ${error.message}`), recordError(`Asset upload failed for ${error.filename}: ${error.message}`), results.push({
|
|
@@ -207124,13 +207273,6 @@ function cleanHeader(headers) {
|
|
|
207124
207273
|
|
|
207125
207274
|
// ../theme/dist/cli/utilities/repl/evaluator.js
|
|
207126
207275
|
async function evaluate(config2) {
|
|
207127
|
-
try {
|
|
207128
|
-
return evaluateSnippet(config2);
|
|
207129
|
-
} catch (error) {
|
|
207130
|
-
outputInfo(outputContent`${outputToken.errorText(error.message)}`), outputDebug(error.stack || "Error backtrace not found");
|
|
207131
|
-
}
|
|
207132
|
-
}
|
|
207133
|
-
async function evaluateSnippet(config2) {
|
|
207134
207276
|
return await evalResult(config2) || await evalContext(config2) || await evalAssignmentContext(config2) || await evalSyntaxError(config2) || void 0;
|
|
207135
207277
|
}
|
|
207136
207278
|
async function evalResult(config2) {
|
|
@@ -208304,7 +208446,10 @@ var VANITY_CDN_PREFIX = "/cdn/", EXTENSION_CDN_PREFIX = "/ext/cdn/", CART_PATTER
|
|
|
208304
208446
|
"/web-pixels-manager",
|
|
208305
208447
|
"/web-pixels@",
|
|
208306
208448
|
"/wpm",
|
|
208307
|
-
"/services/"
|
|
208449
|
+
"/services/",
|
|
208450
|
+
"/api/collect",
|
|
208451
|
+
// Cloudflare's turnstile challenge #6416
|
|
208452
|
+
"/cdn-cgi/challenge-platform"
|
|
208308
208453
|
], SESSION_COOKIE_NAME = "_shopify_essential", SESSION_COOKIE_REGEXP = new RegExp(`${SESSION_COOKIE_NAME}=([^;]*)(;|$)`);
|
|
208309
208454
|
function getProxyHandler(_theme, ctx) {
|
|
208310
208455
|
return defineEventHandler(async (event) => {
|
|
@@ -208508,7 +208653,7 @@ var themeIdMismatchRedirects = 0, MAX_THEME_ID_MISMATCH_REDIRECTS = 5;
|
|
|
208508
208653
|
function getHtmlHandler(theme, ctx) {
|
|
208509
208654
|
return defineEventHandler((event) => {
|
|
208510
208655
|
let [browserPathname = "/", browserSearch = ""] = event.path.split("?");
|
|
208511
|
-
return ctx.options.errorOverlay !== "silent" && ctx.localThemeFileSystem.uploadErrors.size > 0 ? createErrorPageResponse(ctx, { status: 500, statusText: "Internal Server Error" }, {
|
|
208656
|
+
return ctx.lastRequestedPath = event.path, ctx.options.errorOverlay !== "silent" && ctx.localThemeFileSystem.uploadErrors.size > 0 ? createErrorPageResponse(ctx, { status: 500, statusText: "Internal Server Error" }, {
|
|
208512
208657
|
title: "Failed to Upload Theme Files",
|
|
208513
208658
|
header: "Upload Errors",
|
|
208514
208659
|
errors: Array.from(ctx.localThemeFileSystem.uploadErrors.entries()).map(([file, errors]) => ({
|
|
@@ -208590,7 +208735,7 @@ var ThemeIdMismatchError = class extends Error {
|
|
|
208590
208735
|
`URL: ${response.url}`,
|
|
208591
208736
|
"This is likely related to an issue in upstream Shopify APIs.",
|
|
208592
208737
|
"Please try again in a few minutes and report this issue:",
|
|
208593
|
-
"https://
|
|
208738
|
+
"https://community.shopify.dev/c/shopify-cli-libraries/14"
|
|
208594
208739
|
].join(`
|
|
208595
208740
|
`)), this.response = response, this.expectedThemeId = expectedThemeId, this.actualThemeId = actualThemeId;
|
|
208596
208741
|
}
|
|
@@ -208822,6 +208967,7 @@ async function contextDevServerContext(theme, extensionContext) {
|
|
|
208822
208967
|
localThemeExtensionFileSystem,
|
|
208823
208968
|
directory,
|
|
208824
208969
|
type: "theme-extension",
|
|
208970
|
+
lastRequestedPath: "",
|
|
208825
208971
|
options: {
|
|
208826
208972
|
themeEditorSync: !1,
|
|
208827
208973
|
noDelete: !1,
|
|
@@ -209120,7 +209266,14 @@ function mountThemeFileSystem(root, options) {
|
|
|
209120
209266
|
function notifyFileChange(fileKey) {
|
|
209121
209267
|
return notifier?.notify(fileKey) ?? Promise.resolve();
|
|
209122
209268
|
}
|
|
209123
|
-
let
|
|
209269
|
+
let write = async (asset) => {
|
|
209270
|
+
files.set(asset.key, buildThemeAsset({
|
|
209271
|
+
key: asset.key,
|
|
209272
|
+
checksum: asset.checksum,
|
|
209273
|
+
value: asset.value ?? "",
|
|
209274
|
+
attachment: asset.attachment ?? ""
|
|
209275
|
+
})), await writeThemeFile(root, asset);
|
|
209276
|
+
}, handleFileUpdate = (eventName, themeId, adminSession, fileKey) => {
|
|
209124
209277
|
if (isFileIgnored(fileKey))
|
|
209125
209278
|
return;
|
|
209126
209279
|
let previousChecksum = files.get(fileKey)?.checksum, contentPromise = read(fileKey).then(async () => {
|
|
@@ -209130,11 +209283,12 @@ function mountThemeFileSystem(root, options) {
|
|
|
209130
209283
|
// file.value has a fallback value of '', so we want to ignore this eslint rule
|
|
209131
209284
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
|
209132
209285
|
value: file.value || void 0,
|
|
209133
|
-
attachment: file.attachment
|
|
209286
|
+
attachment: file.attachment,
|
|
209287
|
+
checksum: file.checksum
|
|
209134
209288
|
};
|
|
209135
209289
|
}), syncPromise = contentPromise.then((content) => {
|
|
209136
209290
|
if (content)
|
|
209137
|
-
return handleSyncUpdate(unsyncedFileKeys, uploadErrors, fileKey, themeId, adminSession)(content);
|
|
209291
|
+
return handleSyncUpdate(unsyncedFileKeys, uploadErrors, fileKey, themeId, adminSession, write)(content);
|
|
209138
209292
|
}).catch(createSyncingCatchError(fileKey, "upload"));
|
|
209139
209293
|
emitEvent(eventName, {
|
|
209140
209294
|
fileKey,
|
|
@@ -209179,14 +209333,7 @@ function mountThemeFileSystem(root, options) {
|
|
|
209179
209333
|
delete: async (fileKey) => {
|
|
209180
209334
|
files.delete(fileKey), await removeThemeFile(root, fileKey);
|
|
209181
209335
|
},
|
|
209182
|
-
write
|
|
209183
|
-
files.set(asset.key, buildThemeAsset({
|
|
209184
|
-
key: asset.key,
|
|
209185
|
-
checksum: asset.checksum,
|
|
209186
|
-
value: asset.value ?? "",
|
|
209187
|
-
attachment: asset.attachment ?? ""
|
|
209188
|
-
})), await writeThemeFile(root, asset);
|
|
209189
|
-
},
|
|
209336
|
+
write,
|
|
209190
209337
|
read,
|
|
209191
209338
|
applyIgnoreFilters: (files2) => applyIgnoreFilters(files2, filterPatterns),
|
|
209192
209339
|
addEventListener: (eventName, cb) => {
|
|
@@ -209202,7 +209349,7 @@ function mountThemeFileSystem(root, options) {
|
|
|
209202
209349
|
}
|
|
209203
209350
|
};
|
|
209204
209351
|
}
|
|
209205
|
-
function handleSyncUpdate(unsyncedFileKeys, uploadErrors, fileKey, themeId, adminSession) {
|
|
209352
|
+
function handleSyncUpdate(unsyncedFileKeys, uploadErrors, fileKey, themeId, adminSession, write) {
|
|
209206
209353
|
return async (content) => {
|
|
209207
209354
|
if (!unsyncedFileKeys.has(fileKey))
|
|
209208
209355
|
return !1;
|
|
@@ -209212,7 +209359,11 @@ function handleSyncUpdate(unsyncedFileKeys, uploadErrors, fileKey, themeId, admi
|
|
|
209212
209359
|
throw uploadErrors.set(fileKey, errors), triggerBrowserFullReload(themeId, fileKey), new Error(errors.join(`
|
|
209213
209360
|
`));
|
|
209214
209361
|
}
|
|
209215
|
-
|
|
209362
|
+
if (uploadErrors.delete(fileKey) && triggerBrowserFullReload(themeId, fileKey), unsyncedFileKeys.delete(fileKey), outputSyncResult("update", fileKey), content.value && content.checksum !== result?.asset?.checksum) {
|
|
209363
|
+
let [remoteAsset] = await fetchThemeAssets(Number(themeId), [fileKey], adminSession);
|
|
209364
|
+
remoteAsset && (await write(remoteAsset), outputSyncResult("rewrite", fileKey));
|
|
209365
|
+
}
|
|
209366
|
+
return !0;
|
|
209216
209367
|
};
|
|
209217
209368
|
}
|
|
209218
209369
|
async function writeThemeFile(root, { key, attachment, value }) {
|
|
@@ -209289,7 +209440,8 @@ function dirPath(filePath) {
|
|
|
209289
209440
|
return filePath.substring(0, fileNameIndex);
|
|
209290
209441
|
}
|
|
209291
209442
|
function outputSyncResult(action, fileKey) {
|
|
209292
|
-
|
|
209443
|
+
let content;
|
|
209444
|
+
action === "rewrite" ? content = outputContent`• ${timestampDateFormat.format(/* @__PURE__ */ new Date())} Overwritten ${fileKey}` : content = outputContent`• ${timestampDateFormat.format(/* @__PURE__ */ new Date())} Synced ${outputToken.raw("\xBB")} ${action} ${fileKey}`, outputInfo(content);
|
|
209293
209445
|
}
|
|
209294
209446
|
function inferLocalHotReloadScriptPath() {
|
|
209295
209447
|
let envVar = process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD;
|
|
@@ -209500,16 +209652,101 @@ async function reconcileAndPollThemeEditorChanges(targetTheme, session, remoteCh
|
|
|
209500
209652
|
|
|
209501
209653
|
// ../theme/dist/cli/utilities/theme-uploader.js
|
|
209502
209654
|
init_cjs_shims();
|
|
209655
|
+
|
|
209656
|
+
// ../theme/dist/cli/utilities/theme-downloader.js
|
|
209657
|
+
init_cjs_shims();
|
|
209658
|
+
async function downloadTheme(theme, session, remoteChecksums, themeFileSystem, options, context) {
|
|
209659
|
+
let deleteTasks = buildDeleteTasks(remoteChecksums, themeFileSystem, options), downloadTasks = buildDownloadTasks(remoteChecksums, theme, themeFileSystem, session), tasks = [...deleteTasks, ...downloadTasks, { title: "Theme download complete", task: async () => {
|
|
209660
|
+
} }];
|
|
209661
|
+
tasks.length > 0 && await renderTasks(tasks, {
|
|
209662
|
+
renderOptions: { stdout: context?.stdout ?? process.stdout },
|
|
209663
|
+
noProgressBar: options.multiEnvironment
|
|
209664
|
+
});
|
|
209665
|
+
}
|
|
209666
|
+
function buildDeleteTasks(remoteChecksums, themeFileSystem, options) {
|
|
209667
|
+
if (options.nodelete)
|
|
209668
|
+
return [];
|
|
209669
|
+
let remoteKeys = new Set(remoteChecksums.map((checksum) => checksum.key));
|
|
209670
|
+
return themeFileSystem.applyIgnoreFilters([...themeFileSystem.files.values()]).map(({ key }) => key).filter((key) => !remoteKeys.has(key)).map((key) => ({
|
|
209671
|
+
title: `Cleaning your local directory (removing ${key})`,
|
|
209672
|
+
task: async () => themeFileSystem.delete(key)
|
|
209673
|
+
}));
|
|
209674
|
+
}
|
|
209675
|
+
function buildDownloadTasks(remoteChecksums, theme, themeFileSystem, session) {
|
|
209676
|
+
let checksums = themeFileSystem.applyIgnoreFilters(remoteChecksums);
|
|
209677
|
+
checksums = checksums.filter((checksum) => {
|
|
209678
|
+
let remoteChecksumValue = checksum.checksum;
|
|
209679
|
+
return themeFileSystem.files.get(checksum.key)?.checksum !== remoteChecksumValue;
|
|
209680
|
+
});
|
|
209681
|
+
let filenames = checksums.map((checksum) => checksum.key), getProgress = (params) => params.total === 0 ? "[100%]" : `[${Math.round(params.current / params.total * 100)}%]`;
|
|
209682
|
+
return batchedTasks(filenames, MAX_GRAPHQL_THEME_FILES, (batchedFilenames, i) => ({
|
|
209683
|
+
title: `Downloading files from remote theme ${getProgress({
|
|
209684
|
+
current: i,
|
|
209685
|
+
total: filenames.length
|
|
209686
|
+
})}`,
|
|
209687
|
+
task: async () => downloadFiles(theme, themeFileSystem, batchedFilenames, session)
|
|
209688
|
+
}));
|
|
209689
|
+
}
|
|
209690
|
+
async function downloadFiles(theme, fileSystem, filenames, session) {
|
|
209691
|
+
let assets = await fetchThemeAssets(theme.id, filenames, session);
|
|
209692
|
+
assets && assets.forEach(async (asset) => {
|
|
209693
|
+
await fileSystem.write(asset);
|
|
209694
|
+
});
|
|
209695
|
+
}
|
|
209696
|
+
|
|
209697
|
+
// ../theme/dist/cli/utilities/theme-uploader.js
|
|
209503
209698
|
var MAX_BATCH_FILE_COUNT = 20, MAX_BATCH_BYTESIZE = 1024 * 1024, MAX_UPLOAD_RETRY_COUNT = 2;
|
|
209504
209699
|
function uploadTheme(theme, session, checksums, themeFileSystem, options = {}, context) {
|
|
209505
|
-
let remoteChecksums = rejectGeneratedStaticAssets(checksums), uploadResults = /* @__PURE__ */ new Map(), getProgress = (params) => params.total === 0 ? "[100%]" : `[${Math.round(params.current / params.total * 100)}%]`, themeCreationPromise = ensureThemeCreation(theme, session, remoteChecksums), uploadJobPromise = Promise.all([themeFileSystem.ready(), themeCreationPromise]).then(() => buildUploadJob(remoteChecksums, themeFileSystem, theme, session, uploadResults)), deleteJobPromise = uploadJobPromise.then((result) => result.promise).then(() => buildDeleteJob(remoteChecksums, themeFileSystem, theme, session, options, uploadResults)), workPromise = options?.deferPartialWork ? themeCreationPromise
|
|
209506
|
-
|
|
209700
|
+
let remoteChecksums = rejectGeneratedStaticAssets(checksums), uploadResults = /* @__PURE__ */ new Map(), getProgress = (params) => params.total === 0 ? "[100%]" : `[${Math.round(params.current / params.total * 100)}%]`, themeCreationPromise = ensureThemeCreation(theme, session, remoteChecksums), uploadJobPromise = Promise.all([themeFileSystem.ready(), themeCreationPromise]).then(() => buildUploadJob(remoteChecksums, themeFileSystem, theme, session, uploadResults)), deleteJobPromise = uploadJobPromise.then((result) => result.promise).then(() => buildDeleteJob(remoteChecksums, themeFileSystem, theme, session, options, uploadResults)), workPromise = options?.deferPartialWork ? themeCreationPromise.then(() => {
|
|
209701
|
+
}) : deleteJobPromise.then((result) => result.promise);
|
|
209702
|
+
options?.backgroundWorkCatch && Promise.all([
|
|
209507
209703
|
themeCreationPromise,
|
|
209508
209704
|
uploadJobPromise.then((result) => result.promise),
|
|
209509
209705
|
deleteJobPromise.then((result) => result.promise)
|
|
209510
|
-
]).catch(options.backgroundWorkCatch)
|
|
209706
|
+
]).catch(options.backgroundWorkCatch);
|
|
209707
|
+
let syncRewrittenFilesPromise = options?.handleRewrittenFiles ? Promise.all([themeFileSystem.ready(), themeCreationPromise, uploadJobPromise, deleteJobPromise]).then(async () => {
|
|
209708
|
+
let filesDifferentFromRemote = [];
|
|
209709
|
+
for (let uploadResult of uploadResults.values()) {
|
|
209710
|
+
if (!uploadResult.key.endsWith(".liquid"))
|
|
209711
|
+
continue;
|
|
209712
|
+
let localFile = themeFileSystem.files.get(uploadResult.key);
|
|
209713
|
+
localFile?.value && uploadResult.success && uploadResult.asset?.checksum && uploadResult.asset.checksum !== localFile.checksum && filesDifferentFromRemote.push(uploadResult.key);
|
|
209714
|
+
}
|
|
209715
|
+
filesDifferentFromRemote.length > 0 && (options.handleRewrittenFiles === "fix" ? (renderInfo({
|
|
209716
|
+
headline: "Updated Liquid files to conform to latest Liquid standards.",
|
|
209717
|
+
body: [
|
|
209718
|
+
"The following Liquid files were updated locally and remotely:",
|
|
209719
|
+
{
|
|
209720
|
+
list: {
|
|
209721
|
+
items: filesDifferentFromRemote
|
|
209722
|
+
}
|
|
209723
|
+
}
|
|
209724
|
+
]
|
|
209725
|
+
}), await downloadFiles(theme, themeFileSystem, filesDifferentFromRemote, session)) : options.handleRewrittenFiles === "warn" && renderInfo({
|
|
209726
|
+
headline: "Liquid files were updated remotely to conform to latest Liquid standards.",
|
|
209727
|
+
body: [
|
|
209728
|
+
"The following Liquid files were updated remotely:",
|
|
209729
|
+
{
|
|
209730
|
+
list: {
|
|
209731
|
+
items: filesDifferentFromRemote
|
|
209732
|
+
}
|
|
209733
|
+
}
|
|
209734
|
+
],
|
|
209735
|
+
nextSteps: [
|
|
209736
|
+
[
|
|
209737
|
+
"Fetch the latest files using",
|
|
209738
|
+
{
|
|
209739
|
+
command: "shopify theme pull"
|
|
209740
|
+
},
|
|
209741
|
+
"to sync them locally."
|
|
209742
|
+
]
|
|
209743
|
+
]
|
|
209744
|
+
}));
|
|
209745
|
+
}) : Promise.resolve();
|
|
209746
|
+
return {
|
|
209511
209747
|
uploadResults,
|
|
209512
209748
|
workPromise,
|
|
209749
|
+
syncRewrittenFilesPromise,
|
|
209513
209750
|
renderThemeSyncProgress: async () => {
|
|
209514
209751
|
if (options?.deferPartialWork)
|
|
209515
209752
|
return;
|
|
@@ -209601,7 +209838,7 @@ var MINIMUM_THEME_ASSETS = [
|
|
|
209601
209838
|
];
|
|
209602
209839
|
async function ensureThemeCreation(theme, session, remoteChecksums) {
|
|
209603
209840
|
let remoteAssetKeys = new Set(remoteChecksums.map((checksum) => checksum.key)), missingAssets = MINIMUM_THEME_ASSETS.filter(({ key }) => !remoteAssetKeys.has(key));
|
|
209604
|
-
missingAssets.length
|
|
209841
|
+
return missingAssets.length === 0 ? Promise.resolve([]) : bulkUploadThemeAssets(theme.id, missingAssets, session);
|
|
209605
209842
|
}
|
|
209606
209843
|
function buildUploadJob(remoteChecksums, themeFileSystem, theme, session, uploadResults) {
|
|
209607
209844
|
let filesToUpload = selectUploadableFiles(themeFileSystem, remoteChecksums);
|
|
@@ -209726,7 +209963,8 @@ function setupDevServer(theme, ctx) {
|
|
|
209726
209963
|
workPromise,
|
|
209727
209964
|
serverStart: server.start,
|
|
209728
209965
|
dispatchEvent: server.dispatch,
|
|
209729
|
-
renderDevSetupProgress: envSetup.renderProgress
|
|
209966
|
+
renderDevSetupProgress: envSetup.renderProgress,
|
|
209967
|
+
syncRewrittenFilesPromise: () => envSetup.syncRewrittenFilesPromise
|
|
209730
209968
|
};
|
|
209731
209969
|
}
|
|
209732
209970
|
function ensureThemeEnvironmentSetup(theme, ctx) {
|
|
@@ -209735,7 +209973,8 @@ function ensureThemeEnvironmentSetup(theme, ctx) {
|
|
|
209735
209973
|
return uploadTheme(theme, ctx.session, updatedRemoteChecksums, ctx.localThemeFileSystem, {
|
|
209736
209974
|
nodelete: ctx.options.noDelete,
|
|
209737
209975
|
deferPartialWork: !0,
|
|
209738
|
-
backgroundWorkCatch: abort2
|
|
209976
|
+
backgroundWorkCatch: abort2,
|
|
209977
|
+
handleRewrittenFiles: "fix"
|
|
209739
209978
|
});
|
|
209740
209979
|
}).catch(abort2);
|
|
209741
209980
|
return {
|
|
@@ -209754,7 +209993,8 @@ function ensureThemeEnvironmentSetup(theme, ctx) {
|
|
|
209754
209993
|
}
|
|
209755
209994
|
let { renderThemeSyncProgress } = await uploadPromise;
|
|
209756
209995
|
await renderThemeSyncProgress();
|
|
209757
|
-
}
|
|
209996
|
+
},
|
|
209997
|
+
syncRewrittenFilesPromise: uploadPromise.then((result) => result.syncRewrittenFilesPromise).catch(abort2)
|
|
209758
209998
|
};
|
|
209759
209999
|
}
|
|
209760
210000
|
function handleThemeEditorSync(theme, ctx, remoteChecksums) {
|
|
@@ -210074,6 +210314,7 @@ async function dev(options) {
|
|
|
210074
210314
|
localThemeExtensionFileSystem,
|
|
210075
210315
|
directory: options.directory,
|
|
210076
210316
|
type: "theme",
|
|
210317
|
+
lastRequestedPath: "",
|
|
210077
210318
|
options: {
|
|
210078
210319
|
themeEditorSync: options["theme-editor-sync"],
|
|
210079
210320
|
host: host2,
|
|
@@ -210087,8 +210328,8 @@ async function dev(options) {
|
|
|
210087
210328
|
}
|
|
210088
210329
|
};
|
|
210089
210330
|
options["theme-editor-sync"] && (session.storefrontPassword = await storefrontPasswordPromise);
|
|
210090
|
-
let { serverStart, renderDevSetupProgress } = setupDevServer(options.theme, ctx);
|
|
210091
|
-
options["theme-editor-sync"] || (session.storefrontPassword = await storefrontPasswordPromise), await renderDevSetupProgress(), await serverStart(), renderLinks(urls), options.open && openURLSafely(urls.local, "development server"), readline.emitKeypressEvents(process.stdin), process.stdin.isTTY && process.stdin.setRawMode(!0), process.stdin.on("keypress", (_str, key) => {
|
|
210331
|
+
let { serverStart, renderDevSetupProgress, syncRewrittenFilesPromise } = setupDevServer(options.theme, ctx);
|
|
210332
|
+
options["theme-editor-sync"] || (session.storefrontPassword = await storefrontPasswordPromise), await renderDevSetupProgress(), await serverStart(), await syncRewrittenFilesPromise(), renderLinks(urls), options.open && openURLSafely(urls.local, "development server"), readline.emitKeypressEvents(process.stdin), process.stdin.isTTY && process.stdin.setRawMode(!0), process.stdin.on("keypress", (_str, key) => {
|
|
210092
210333
|
switch (key.ctrl && key.name === "c" && process.exit(), key.name) {
|
|
210093
210334
|
case "t":
|
|
210094
210335
|
openURLSafely(urls.local, "localhost");
|
|
@@ -210097,7 +210338,7 @@ async function dev(options) {
|
|
|
210097
210338
|
openURLSafely(urls.preview, "theme preview");
|
|
210098
210339
|
break;
|
|
210099
210340
|
case "e":
|
|
210100
|
-
openURLSafely(urls.themeEditor
|
|
210341
|
+
openURLSafely(ctx.lastRequestedPath === "/" ? urls.themeEditor : `${urls.themeEditor}&previewPath=${encodeURIComponent(ctx.lastRequestedPath)}`, "theme editor");
|
|
210101
210342
|
break;
|
|
210102
210343
|
case "g":
|
|
210103
210344
|
openURLSafely(urls.giftCard, "gift card preview");
|
|
@@ -214034,14 +214275,23 @@ var esm_default = gitInstanceFactory;
|
|
|
214034
214275
|
// ../cli-kit/dist/public/node/git.js
|
|
214035
214276
|
var import_ignore3 = __toESM(require_ignore2());
|
|
214036
214277
|
async function initializeGitRepository(directory, initialBranch = "main") {
|
|
214037
|
-
outputDebug(outputContent`Initializing git repository at ${outputToken.path(directory)}...`), await ensureGitIsPresentOrAbort()
|
|
214038
|
-
|
|
214039
|
-
|
|
214278
|
+
outputDebug(outputContent`Initializing git repository at ${outputToken.path(directory)}...`), await ensureGitIsPresentOrAbort(), await withGit({ directory }, async (repo) => {
|
|
214279
|
+
await repo.init(), await repo.checkoutLocalBranch(initialBranch);
|
|
214280
|
+
});
|
|
214040
214281
|
}
|
|
214041
214282
|
async function downloadGitRepository(cloneOptions) {
|
|
214042
214283
|
return runWithTimer("cmd_all_timing_network_ms")(async () => {
|
|
214043
214284
|
let { repoUrl, destination, progressUpdater, shallow, latestTag } = cloneOptions;
|
|
214044
|
-
outputDebug(outputContent`Git-cloning repository ${repoUrl} into ${outputToken.path(destination)}...`), await ensureGitIsPresentOrAbort()
|
|
214285
|
+
if (outputDebug(outputContent`Git-cloning repository ${repoUrl} into ${outputToken.path(destination)}...`), await ensureGitIsPresentOrAbort(), await fileExists(destination)) {
|
|
214286
|
+
if (!await isDirectory(destination))
|
|
214287
|
+
throw new AbortError(outputContent`Can't clone to ${outputToken.path(destination)}`, "The path exists but isn't a directory.");
|
|
214288
|
+
if ((await glob(["*", ".*"], {
|
|
214289
|
+
cwd: destination,
|
|
214290
|
+
deep: 1,
|
|
214291
|
+
onlyFiles: !1
|
|
214292
|
+
})).length > 0)
|
|
214293
|
+
throw new AbortError(outputContent`Directory ${outputToken.path(destination)} already exists and is not empty`, outputContent`Choose a different name or remove the existing directory first.`);
|
|
214294
|
+
}
|
|
214045
214295
|
let [repository, branch] = repoUrl.split("#"), options = { "--recurse-submodules": null };
|
|
214046
214296
|
if (branch && latestTag)
|
|
214047
214297
|
throw new AbortError("Error cloning the repository. Git can't clone the latest release with a 'branch'.");
|
|
@@ -214056,10 +214306,10 @@ async function downloadGitRepository(cloneOptions) {
|
|
|
214056
214306
|
...!isTerminalInteractive() && { config: ["core.askpass=true"] }
|
|
214057
214307
|
};
|
|
214058
214308
|
try {
|
|
214059
|
-
|
|
214060
|
-
let
|
|
214309
|
+
await esm_default(simpleGitOptions).clone(repository, destination, options), latestTag && await withGit({ directory: destination }, async (localGitRepository) => {
|
|
214310
|
+
let latestTag2 = await getLocalLatestTag(localGitRepository, repoUrl);
|
|
214061
214311
|
await localGitRepository.checkout(latestTag2);
|
|
214062
|
-
}
|
|
214312
|
+
});
|
|
214063
214313
|
} catch (err2) {
|
|
214064
214314
|
if (err2 instanceof Error) {
|
|
214065
214315
|
let abortError = new AbortError(err2.message);
|
|
@@ -214080,19 +214330,31 @@ async function ensureGitIsPresentOrAbort() {
|
|
|
214080
214330
|
throw new AbortError("Git is necessary in the environment to continue", outputContent`Install ${outputToken.link("git", "https://git-scm.com/book/en/v2/Getting-Started-Installing-Git")}`);
|
|
214081
214331
|
}
|
|
214082
214332
|
async function insideGitDirectory(directory) {
|
|
214083
|
-
return
|
|
214333
|
+
return withGit({ directory }, (repo) => repo.checkIsRepo());
|
|
214084
214334
|
}
|
|
214085
214335
|
async function isClean(directory) {
|
|
214086
|
-
return (await
|
|
214336
|
+
return (await withGit({ directory }, (git) => git.status())).isClean();
|
|
214087
214337
|
}
|
|
214088
214338
|
async function removeGitRemote(directory, remoteName = "origin") {
|
|
214089
|
-
outputDebug(outputContent`Removing git remote ${remoteName} from ${outputToken.path(directory)}...`), await ensureGitIsPresentOrAbort()
|
|
214090
|
-
|
|
214091
|
-
|
|
214092
|
-
|
|
214093
|
-
|
|
214339
|
+
outputDebug(outputContent`Removing git remote ${remoteName} from ${outputToken.path(directory)}...`), await ensureGitIsPresentOrAbort(), await withGit({ directory }, async (repo) => {
|
|
214340
|
+
if (!(await repo.getRemotes()).some((remote) => remote.name === remoteName)) {
|
|
214341
|
+
outputDebug(outputContent`Remote ${remoteName} does not exist, no action needed`);
|
|
214342
|
+
return;
|
|
214343
|
+
}
|
|
214344
|
+
await repo.removeRemote(remoteName);
|
|
214345
|
+
});
|
|
214346
|
+
}
|
|
214347
|
+
async function withGit({ directory }, callback) {
|
|
214348
|
+
let repo = esm_default({ baseDir: directory });
|
|
214349
|
+
try {
|
|
214350
|
+
return await callback(repo);
|
|
214351
|
+
} catch (err2) {
|
|
214352
|
+
if (err2 instanceof Error) {
|
|
214353
|
+
let abortError = new AbortError(err2.message);
|
|
214354
|
+
throw abortError.stack = err2.stack, abortError;
|
|
214355
|
+
}
|
|
214356
|
+
throw err2;
|
|
214094
214357
|
}
|
|
214095
|
-
await repo.removeRemote(remoteName);
|
|
214096
214358
|
}
|
|
214097
214359
|
|
|
214098
214360
|
// ../theme/dist/cli/services/init.js
|
|
@@ -214632,49 +214894,6 @@ init_cjs_shims();
|
|
|
214632
214894
|
|
|
214633
214895
|
// ../theme/dist/cli/services/pull.js
|
|
214634
214896
|
init_cjs_shims();
|
|
214635
|
-
|
|
214636
|
-
// ../theme/dist/cli/utilities/theme-downloader.js
|
|
214637
|
-
init_cjs_shims();
|
|
214638
|
-
async function downloadTheme(theme, session, remoteChecksums, themeFileSystem, options, context) {
|
|
214639
|
-
let deleteTasks = buildDeleteTasks(remoteChecksums, themeFileSystem, options), downloadTasks = buildDownloadTasks(remoteChecksums, theme, themeFileSystem, session), tasks = [...deleteTasks, ...downloadTasks, { title: "Theme download complete", task: async () => {
|
|
214640
|
-
} }];
|
|
214641
|
-
tasks.length > 0 && await renderTasks(tasks, {
|
|
214642
|
-
renderOptions: { stdout: context?.stdout ?? process.stdout },
|
|
214643
|
-
noProgressBar: options.multiEnvironment
|
|
214644
|
-
});
|
|
214645
|
-
}
|
|
214646
|
-
function buildDeleteTasks(remoteChecksums, themeFileSystem, options) {
|
|
214647
|
-
if (options.nodelete)
|
|
214648
|
-
return [];
|
|
214649
|
-
let remoteKeys = new Set(remoteChecksums.map((checksum) => checksum.key));
|
|
214650
|
-
return themeFileSystem.applyIgnoreFilters([...themeFileSystem.files.values()]).map(({ key }) => key).filter((key) => !remoteKeys.has(key)).map((key) => ({
|
|
214651
|
-
title: `Cleaning your local directory (removing ${key})`,
|
|
214652
|
-
task: async () => themeFileSystem.delete(key)
|
|
214653
|
-
}));
|
|
214654
|
-
}
|
|
214655
|
-
function buildDownloadTasks(remoteChecksums, theme, themeFileSystem, session) {
|
|
214656
|
-
let checksums = themeFileSystem.applyIgnoreFilters(remoteChecksums);
|
|
214657
|
-
checksums = checksums.filter((checksum) => {
|
|
214658
|
-
let remoteChecksumValue = checksum.checksum;
|
|
214659
|
-
return themeFileSystem.files.get(checksum.key)?.checksum !== remoteChecksumValue;
|
|
214660
|
-
});
|
|
214661
|
-
let filenames = checksums.map((checksum) => checksum.key), getProgress = (params) => params.total === 0 ? "[100%]" : `[${Math.round(params.current / params.total * 100)}%]`;
|
|
214662
|
-
return batchedTasks(filenames, MAX_GRAPHQL_THEME_FILES, (batchedFilenames, i) => ({
|
|
214663
|
-
title: `Downloading files from remote theme ${getProgress({
|
|
214664
|
-
current: i,
|
|
214665
|
-
total: filenames.length
|
|
214666
|
-
})}`,
|
|
214667
|
-
task: async () => downloadFiles(theme, themeFileSystem, batchedFilenames, session)
|
|
214668
|
-
}));
|
|
214669
|
-
}
|
|
214670
|
-
async function downloadFiles(theme, fileSystem, filenames, session) {
|
|
214671
|
-
let assets = await fetchThemeAssets(theme.id, filenames, session);
|
|
214672
|
-
assets && assets.forEach(async (asset) => {
|
|
214673
|
-
await fileSystem.write(asset);
|
|
214674
|
-
});
|
|
214675
|
-
}
|
|
214676
|
-
|
|
214677
|
-
// ../theme/dist/cli/services/pull.js
|
|
214678
214897
|
async function pull(flags, session, multiEnvironment, context) {
|
|
214679
214898
|
recordTiming("theme-service:pull:setup"), configureCLIEnvironment({ verbose: flags.verbose, noColor: flags.noColor });
|
|
214680
214899
|
let adminSession = session ?? await ensureAuthenticatedThemes(ensureThemeStore({ store: flags.store }), flags.password), developmentThemeManager = new DevelopmentThemeManager(adminSession), developmentTheme = await (flags.development ? developmentThemeManager.find() : developmentThemeManager.fetch()), { path, nodelete, live, development, only, ignore: ignore4, force, environment } = flags;
|
|
@@ -214822,8 +215041,11 @@ async function executePush(theme, session, options, context) {
|
|
|
214822
215041
|
recordTiming("theme-service:push:file-system");
|
|
214823
215042
|
let themeChecksums = await fetchChecksums(theme.id, session), themeFileSystem = mountThemeFileSystem(options.path, { filters: options });
|
|
214824
215043
|
recordTiming("theme-service:push:file-system");
|
|
214825
|
-
let { uploadResults, renderThemeSyncProgress } = uploadTheme(theme, session, themeChecksums, themeFileSystem,
|
|
214826
|
-
|
|
215044
|
+
let { uploadResults, renderThemeSyncProgress, syncRewrittenFilesPromise } = uploadTheme(theme, session, themeChecksums, themeFileSystem, {
|
|
215045
|
+
...options,
|
|
215046
|
+
handleRewrittenFiles: "warn"
|
|
215047
|
+
}, context);
|
|
215048
|
+
await renderThemeSyncProgress(), await syncRewrittenFilesPromise, options.publish && await themePublish(theme.id, session), await handlePushOutput(uploadResults, theme, session, options);
|
|
214827
215049
|
}
|
|
214828
215050
|
function hasUploadErrors(results) {
|
|
214829
215051
|
for (let [_key, result] of results.entries())
|
|
@@ -217105,7 +217327,7 @@ var import_react6 = __toESM(require_react(), 1), import_server8 = __toESM(requir
|
|
|
217105
217327
|
import_polaris2.BlockStack,
|
|
217106
217328
|
{ gap: "200" },
|
|
217107
217329
|
import_react6.default.createElement(import_polaris2.Text, { variant: "headingMd", as: "h2" }, "Install your app to access GraphiQL"),
|
|
217108
|
-
import_react6.default.createElement("p", null, "The GraphiQL Explorer relies on your app being installed on your
|
|
217330
|
+
import_react6.default.createElement("p", null, "The GraphiQL Explorer relies on your app being installed on your dev store to access its data."),
|
|
217109
217331
|
import_react6.default.createElement(
|
|
217110
217332
|
"p",
|
|
217111
217333
|
{ id: "card-cta" },
|
|
@@ -218333,7 +218555,7 @@ init_cjs_shims();
|
|
|
218333
218555
|
import * as http from "http";
|
|
218334
218556
|
import * as https from "https";
|
|
218335
218557
|
async function getProxyingWebServer(rules, abortSignal, localhostCert, stdout) {
|
|
218336
|
-
let proxy = (await import("./http-proxy-node16-
|
|
218558
|
+
let proxy = (await import("./http-proxy-node16-VGGP6PLA.js")).default.createProxyServer(), requestListener = getProxyServerRequestListener(rules, proxy, stdout), server = localhostCert ? https.createServer(localhostCert, requestListener) : http.createServer(requestListener);
|
|
218337
218559
|
return server.on("upgrade", getProxyServerWebsocketUpgradeListener(rules, proxy, stdout)), abortSignal.addEventListener("abort", () => {
|
|
218338
218560
|
outputDebug("Closing reverse HTTP proxy"), server.close();
|
|
218339
218561
|
}), { server };
|
|
@@ -218785,9 +219007,14 @@ var TAB_WIDTH_PERCENTAGE = 0.9, TabPanel = ({ tabs, initialActiveTab }) => {
|
|
|
218785
219007
|
var import_react10 = __toESM(require_react(), 1);
|
|
218786
219008
|
var DevSessionUI = ({ abortController, processes, devSessionStatusManager, shopFqdn, appURL, appName, organizationName, configPath, onAbort }) => {
|
|
218787
219009
|
let { isRawModeSupported: canUseShortcuts } = use_stdin_default(), [isShuttingDownMessage, setIsShuttingDownMessage] = (0, import_react10.useState)(void 0), [error, setError] = (0, import_react10.useState)(void 0), [status, setStatus] = (0, import_react10.useState)(devSessionStatusManager.status), [shouldShowPersistentDevInfo, setShouldShowPersistentDevInfo] = (0, import_react10.useState)(!1), { isAborted } = useAbortSignal(abortController.signal, async (err2) => {
|
|
218788
|
-
err2 && setError(typeof err2 == "string" ? err2 : err2.message), devSessionStatusManager.status.isReady ? setShouldShowPersistentDevInfo(!0) : (setIsShuttingDownMessage("Shutting down dev ..."), await onAbort()),
|
|
218789
|
-
|
|
218790
|
-
|
|
219010
|
+
if (err2 && setError(typeof err2 == "string" ? err2 : err2.message), devSessionStatusManager.status.isReady ? setShouldShowPersistentDevInfo(!0) : (setIsShuttingDownMessage("Shutting down dev ..."), await onAbort()), isUnitTest())
|
|
219011
|
+
return;
|
|
219012
|
+
let totalTime = 0;
|
|
219013
|
+
setInterval(() => {
|
|
219014
|
+
(postRunHookHasCompleted() || totalTime > 5e3) && treeKill(process.pid, "SIGINT", !1, () => {
|
|
219015
|
+
process.exit(0);
|
|
219016
|
+
}), totalTime += 100;
|
|
219017
|
+
}, 100);
|
|
218791
219018
|
}), errorHandledProcesses = (0, import_react10.useMemo)(() => processes.map((process2) => ({
|
|
218792
219019
|
...process2,
|
|
218793
219020
|
action: async (stdout, stderr, signal) => {
|
|
@@ -219502,9 +219729,7 @@ var _a23, Dev3 = class extends AppLinkedCommand {
|
|
|
219502
219729
|
return "app dev stop";
|
|
219503
219730
|
}
|
|
219504
219731
|
async run() {
|
|
219505
|
-
let { flags } = await this.parse(_a23)
|
|
219506
|
-
!flags["api-key"] && process.env.SHOPIFY_API_KEY && (flags["api-key"] = process.env.SHOPIFY_API_KEY), flags["api-key"] && await showApiKeyDeprecationWarning();
|
|
219507
|
-
let tunnelMode = await getTunnelMode({
|
|
219732
|
+
let { flags } = await this.parse(_a23), tunnelMode = await getTunnelMode({
|
|
219508
219733
|
useLocalhost: flags["use-localhost"],
|
|
219509
219734
|
tunnelUrl: flags["tunnel-url"],
|
|
219510
219735
|
localhostPort: flags["localhost-port"]
|
|
@@ -219516,7 +219741,7 @@ var _a23, Dev3 = class extends AppLinkedCommand {
|
|
|
219516
219741
|
})), await checkFolderIsValidApp(flags.path);
|
|
219517
219742
|
let appContextResult = await linkedAppContext({
|
|
219518
219743
|
directory: flags.path,
|
|
219519
|
-
clientId: flags["client-id"]
|
|
219744
|
+
clientId: flags["client-id"],
|
|
219520
219745
|
forceRelink: flags.reset,
|
|
219521
219746
|
userProvidedConfigName: flags.config
|
|
219522
219747
|
}), store = await storeContext({
|
|
@@ -219544,17 +219769,11 @@ var _a23, Dev3 = class extends AppLinkedCommand {
|
|
|
219544
219769
|
};
|
|
219545
219770
|
_a23 = Dev3;
|
|
219546
219771
|
Dev3.summary = "Run the app.";
|
|
219547
|
-
Dev3.descriptionWithMarkdown = "Builds and previews your app on a
|
|
219772
|
+
Dev3.descriptionWithMarkdown = "Builds and previews your app on a dev store, and watches for changes. [Read more about testing apps locally](https://shopify.dev/docs/apps/build/cli-for-apps/test-apps-locally).";
|
|
219548
219773
|
Dev3.description = _a23.descriptionWithoutMarkdown();
|
|
219549
219774
|
Dev3.flags = {
|
|
219550
219775
|
...globalFlags,
|
|
219551
219776
|
...appFlags,
|
|
219552
|
-
"api-key": import_core24.Flags.string({
|
|
219553
|
-
hidden: !0,
|
|
219554
|
-
description: "The API key of your app.",
|
|
219555
|
-
env: "SHOPIFY_FLAG_APP_API_KEY",
|
|
219556
|
-
exclusive: ["config"]
|
|
219557
|
-
}),
|
|
219558
219777
|
store: import_core24.Flags.string({
|
|
219559
219778
|
char: "s",
|
|
219560
219779
|
description: "Store URL. Must be an existing development or Shopify Plus sandbox store.",
|
|
@@ -219567,7 +219786,7 @@ Dev3.flags = {
|
|
|
219567
219786
|
default: !1
|
|
219568
219787
|
}),
|
|
219569
219788
|
"no-update": import_core24.Flags.boolean({
|
|
219570
|
-
description: "
|
|
219789
|
+
description: "Uses the app URL from the toml file instead an autogenerated URL for dev.",
|
|
219571
219790
|
env: "SHOPIFY_FLAG_NO_UPDATE",
|
|
219572
219791
|
default: !1
|
|
219573
219792
|
}),
|
|
@@ -220086,11 +220305,11 @@ function renderAppLogsConfigInfo(appName, storeFqdn, storeFqdns, configFile, org
|
|
|
220086
220305
|
var import_core25 = __toESM(require_lib2(), 1);
|
|
220087
220306
|
var _a24, Logs2 = class extends AppLinkedCommand {
|
|
220088
220307
|
async run() {
|
|
220089
|
-
let { flags } = await this.parse(_a24)
|
|
220308
|
+
let { flags } = await this.parse(_a24);
|
|
220090
220309
|
await checkFolderIsValidApp(flags.path);
|
|
220091
220310
|
let appContextResult = await linkedAppContext({
|
|
220092
220311
|
directory: flags.path,
|
|
220093
|
-
clientId:
|
|
220312
|
+
clientId: flags["client-id"],
|
|
220094
220313
|
forceRelink: flags.reset,
|
|
220095
220314
|
userProvidedConfigName: flags.config
|
|
220096
220315
|
}), primaryStore = await storeContext({
|
|
@@ -220116,7 +220335,6 @@ Logs2.flags = {
|
|
|
220116
220335
|
...globalFlags,
|
|
220117
220336
|
...appFlags,
|
|
220118
220337
|
...jsonFlag,
|
|
220119
|
-
"api-key": dev_default2.flags["api-key"],
|
|
220120
220338
|
store: import_core25.Flags.string({
|
|
220121
220339
|
char: "s",
|
|
220122
220340
|
description: "Store URL. Must be an existing development or Shopify Plus sandbox store.",
|
|
@@ -220994,11 +221212,9 @@ function getAllFunctionRunFileNames(functionRunsDir) {
|
|
|
220994
221212
|
// ../app/dist/cli/commands/app/function/replay.js
|
|
220995
221213
|
var import_core28 = __toESM(require_lib2(), 1), _a29, FunctionReplay = class extends AppLinkedCommand {
|
|
220996
221214
|
async run() {
|
|
220997
|
-
let { flags } = await this.parse(_a29)
|
|
220998
|
-
flags["api-key"] && await showApiKeyDeprecationWarning();
|
|
220999
|
-
let { app } = await linkedAppContext({
|
|
221215
|
+
let { flags } = await this.parse(_a29), { app } = await linkedAppContext({
|
|
221000
221216
|
directory: flags.path,
|
|
221001
|
-
clientId: flags["client-id"]
|
|
221217
|
+
clientId: flags["client-id"],
|
|
221002
221218
|
forceRelink: flags.reset,
|
|
221003
221219
|
userProvidedConfigName: flags.config
|
|
221004
221220
|
}), ourFunction = await chooseFunction(app, flags.path);
|
|
@@ -221021,12 +221237,6 @@ FunctionReplay.flags = {
|
|
|
221021
221237
|
...appFlags,
|
|
221022
221238
|
...functionFlags,
|
|
221023
221239
|
...jsonFlag,
|
|
221024
|
-
"api-key": import_core28.Flags.string({
|
|
221025
|
-
hidden: !0,
|
|
221026
|
-
description: "Application's API key",
|
|
221027
|
-
env: "SHOPIFY_FLAG_API_KEY",
|
|
221028
|
-
exclusive: ["config"]
|
|
221029
|
-
}),
|
|
221030
221240
|
log: import_core28.Flags.string({
|
|
221031
221241
|
char: "l",
|
|
221032
221242
|
description: "Specifies a log identifier to replay instead of selecting from a list. The identifier is provided in the output of `shopify app dev` and is the suffix of the log file name.",
|
|
@@ -221109,11 +221319,9 @@ init_cjs_shims();
|
|
|
221109
221319
|
var import_core30 = __toESM(require_lib2(), 1);
|
|
221110
221320
|
var _a31, FetchSchema = class extends AppLinkedCommand {
|
|
221111
221321
|
async run() {
|
|
221112
|
-
let { flags } = await this.parse(_a31)
|
|
221113
|
-
flags["api-key"] && await showApiKeyDeprecationWarning();
|
|
221114
|
-
let apiKey = flags["client-id"] ?? flags["api-key"], { app, developerPlatformClient, organization } = await linkedAppContext({
|
|
221322
|
+
let { flags } = await this.parse(_a31), { app, developerPlatformClient, organization } = await linkedAppContext({
|
|
221115
221323
|
directory: flags.path,
|
|
221116
|
-
clientId:
|
|
221324
|
+
clientId: flags["client-id"],
|
|
221117
221325
|
forceRelink: flags.reset,
|
|
221118
221326
|
userProvidedConfigName: flags.config
|
|
221119
221327
|
}), ourFunction = await chooseFunction(app, flags.path);
|
|
@@ -221134,13 +221342,6 @@ FetchSchema.flags = {
|
|
|
221134
221342
|
...globalFlags,
|
|
221135
221343
|
...appFlags,
|
|
221136
221344
|
...functionFlags,
|
|
221137
|
-
"api-key": import_core30.Flags.string({
|
|
221138
|
-
hidden: !0,
|
|
221139
|
-
name: "API key",
|
|
221140
|
-
description: "The API key to fetch the schema with.",
|
|
221141
|
-
env: "SHOPIFY_FLAG_APP_API_KEY",
|
|
221142
|
-
exclusive: ["config"]
|
|
221143
|
-
}),
|
|
221144
221345
|
stdout: import_core30.Flags.boolean({
|
|
221145
221346
|
description: "Output the schema to stdout instead of writing to a file.",
|
|
221146
221347
|
required: !1,
|
|
@@ -221319,7 +221520,7 @@ async function functionExtensionInit({ directory, url, app, name, extensionFlavo
|
|
|
221319
221520
|
}), templateLanguage === "javascript" && taskList.push({
|
|
221320
221521
|
title: "Installing additional dependencies",
|
|
221321
221522
|
task: async () => {
|
|
221322
|
-
app.usesWorkspaces &&
|
|
221523
|
+
app.usesWorkspaces && await installNodeModules({ packageManager: app.packageManager, directory: app.directory });
|
|
221323
221524
|
let requiredDependencies = getFunctionRuntimeDependencies(templateLanguage);
|
|
221324
221525
|
await addNPMDependenciesIfNeeded(requiredDependencies, {
|
|
221325
221526
|
packageManager: app.packageManager,
|
|
@@ -221515,7 +221716,7 @@ var _a33, AppGenerateExtension = class extends AppLinkedCommand {
|
|
|
221515
221716
|
}
|
|
221516
221717
|
async run() {
|
|
221517
221718
|
let { flags } = await this.parse(_a33);
|
|
221518
|
-
|
|
221719
|
+
await metadata_default.addPublicMetadata(() => ({
|
|
221519
221720
|
cmd_scaffold_required_auth: !0,
|
|
221520
221721
|
cmd_scaffold_template_custom: flags["clone-url"] !== void 0,
|
|
221521
221722
|
cmd_scaffold_type_owner: "@shopify/app"
|
|
@@ -221525,7 +221726,7 @@ var _a33, AppGenerateExtension = class extends AppLinkedCommand {
|
|
|
221525
221726
|
}), process.exit(2)), await checkFolderIsValidApp(flags.path);
|
|
221526
221727
|
let { app, specifications, remoteApp, developerPlatformClient } = await linkedAppContext({
|
|
221527
221728
|
directory: flags.path,
|
|
221528
|
-
clientId: flags["client-id"]
|
|
221729
|
+
clientId: flags["client-id"],
|
|
221529
221730
|
forceRelink: flags.reset,
|
|
221530
221731
|
userProvidedConfigName: flags.config
|
|
221531
221732
|
});
|
|
@@ -221582,12 +221783,6 @@ AppGenerateExtension.flags = {
|
|
|
221582
221783
|
description: "Choose a starting template for your extension, where applicable",
|
|
221583
221784
|
options: ["vanilla-js", "react", "typescript", "typescript-react", "wasm", "rust"],
|
|
221584
221785
|
env: "SHOPIFY_FLAG_FLAVOR"
|
|
221585
|
-
}),
|
|
221586
|
-
"api-key": import_core31.Flags.string({
|
|
221587
|
-
hidden: !0,
|
|
221588
|
-
description: "The API key of your app.",
|
|
221589
|
-
env: "SHOPIFY_FLAG_APP_API_KEY",
|
|
221590
|
-
exclusive: ["config"]
|
|
221591
221786
|
})
|
|
221592
221787
|
};
|
|
221593
221788
|
var extension_default2 = AppGenerateExtension;
|
|
@@ -221836,7 +222031,7 @@ _a35 = AppInfo2;
|
|
|
221836
222031
|
AppInfo2.summary = "Print basic information about your app and extensions.";
|
|
221837
222032
|
AppInfo2.descriptionWithMarkdown = `The information returned includes the following:
|
|
221838
222033
|
|
|
221839
|
-
- The app and
|
|
222034
|
+
- The app and dev store that's used when you run the [dev](https://shopify.dev/docs/api/shopify-cli/app/app-dev) command. You can reset these configurations using [\`dev --reset\`](https://shopify.dev/docs/api/shopify-cli/app/app-dev#flags-propertydetail-reset).
|
|
221840
222035
|
- The [structure](https://shopify.dev/docs/apps/tools/cli/structure) of your app project.
|
|
221841
222036
|
- The [access scopes](https://shopify.dev/docs/api/usage) your app has requested.
|
|
221842
222037
|
- System information, including the package manager and version of Shopify CLI used in the project.`;
|
|
@@ -222333,17 +222528,15 @@ ${versionDetails.message}` : ""
|
|
|
222333
222528
|
var import_core35 = __toESM(require_lib2(), 1);
|
|
222334
222529
|
var _a37, Release = class extends AppLinkedCommand {
|
|
222335
222530
|
async run() {
|
|
222336
|
-
let { flags } = await this.parse(_a37);
|
|
222337
|
-
flags["api-key"] && await showApiKeyDeprecationWarning();
|
|
222338
|
-
let apiKey = flags["client-id"] ?? flags["api-key"];
|
|
222531
|
+
let { flags } = await this.parse(_a37), clientId = flags["client-id"];
|
|
222339
222532
|
await addPublicMetadata(() => ({
|
|
222340
222533
|
cmd_app_reset_used: flags.reset
|
|
222341
222534
|
}));
|
|
222342
222535
|
let requiredNonTTYFlags = ["force"];
|
|
222343
|
-
(await getAppConfigurationState(flags.path, flags.config)).state === "template-only" && !
|
|
222536
|
+
(await getAppConfigurationState(flags.path, flags.config)).state === "template-only" && !clientId && requiredNonTTYFlags.push("client-id"), this.failMissingNonTTYFlags(flags, requiredNonTTYFlags);
|
|
222344
222537
|
let { app, remoteApp, developerPlatformClient } = await linkedAppContext({
|
|
222345
222538
|
directory: flags.path,
|
|
222346
|
-
clientId
|
|
222539
|
+
clientId,
|
|
222347
222540
|
forceRelink: flags.reset,
|
|
222348
222541
|
userProvidedConfigName: flags.config
|
|
222349
222542
|
});
|
|
@@ -222364,12 +222557,6 @@ Release.description = _a37.descriptionWithoutMarkdown();
|
|
|
222364
222557
|
Release.flags = {
|
|
222365
222558
|
...globalFlags,
|
|
222366
222559
|
...appFlags,
|
|
222367
|
-
"api-key": import_core35.Flags.string({
|
|
222368
|
-
hidden: !0,
|
|
222369
|
-
description: "The API key of your app.",
|
|
222370
|
-
env: "SHOPIFY_FLAG_APP_API_KEY",
|
|
222371
|
-
exclusive: ["config"]
|
|
222372
|
-
}),
|
|
222373
222560
|
force: import_core35.Flags.boolean({
|
|
222374
222561
|
hidden: !1,
|
|
222375
222562
|
description: "Release without asking for confirmation.",
|
|
@@ -222450,13 +222637,11 @@ async function versionList(options) {
|
|
|
222450
222637
|
}
|
|
222451
222638
|
|
|
222452
222639
|
// ../app/dist/cli/commands/app/versions/list.js
|
|
222453
|
-
var
|
|
222640
|
+
var _a38, VersionsList = class extends AppLinkedCommand {
|
|
222454
222641
|
async run() {
|
|
222455
|
-
let { flags } = await this.parse(_a38)
|
|
222456
|
-
flags["api-key"] && await showApiKeyDeprecationWarning();
|
|
222457
|
-
let apiKey = flags["client-id"] ?? flags["api-key"], { app, remoteApp, developerPlatformClient, organization } = await linkedAppContext({
|
|
222642
|
+
let { flags } = await this.parse(_a38), { app, remoteApp, developerPlatformClient, organization } = await linkedAppContext({
|
|
222458
222643
|
directory: flags.path,
|
|
222459
|
-
clientId:
|
|
222644
|
+
clientId: flags["client-id"],
|
|
222460
222645
|
forceRelink: flags.reset,
|
|
222461
222646
|
userProvidedConfigName: flags.config
|
|
222462
222647
|
});
|
|
@@ -222476,13 +222661,7 @@ VersionsList.description = _a38.descriptionWithoutMarkdown();
|
|
|
222476
222661
|
VersionsList.flags = {
|
|
222477
222662
|
...globalFlags,
|
|
222478
222663
|
...appFlags,
|
|
222479
|
-
...jsonFlag
|
|
222480
|
-
"api-key": import_core36.Flags.string({
|
|
222481
|
-
hidden: !0,
|
|
222482
|
-
description: "Application's API key to fetch versions for.",
|
|
222483
|
-
env: "SHOPIFY_FLAG_API_KEY",
|
|
222484
|
-
exclusive: ["config"]
|
|
222485
|
-
})
|
|
222664
|
+
...jsonFlag
|
|
222486
222665
|
};
|
|
222487
222666
|
var list_default2 = VersionsList;
|
|
222488
222667
|
|
|
@@ -222621,7 +222800,7 @@ function formatErrors(errors) {
|
|
|
222621
222800
|
}
|
|
222622
222801
|
|
|
222623
222802
|
// ../app/dist/cli/commands/app/webhook/trigger.js
|
|
222624
|
-
var
|
|
222803
|
+
var import_core36 = __toESM(require_lib2(), 1);
|
|
222625
222804
|
var _a39, WebhookTrigger = class extends AppLinkedCommand {
|
|
222626
222805
|
async run() {
|
|
222627
222806
|
let { flags } = await this.parse(_a39);
|
|
@@ -222672,44 +222851,44 @@ WebhookTrigger.descriptionWithMarkdown = `
|
|
|
222672
222851
|
WebhookTrigger.description = _a39.descriptionWithoutMarkdown();
|
|
222673
222852
|
WebhookTrigger.flags = {
|
|
222674
222853
|
...appFlags,
|
|
222675
|
-
help:
|
|
222854
|
+
help: import_core36.Flags.help({
|
|
222676
222855
|
required: !1,
|
|
222677
222856
|
hidden: !1,
|
|
222678
222857
|
env: "SHOPIFY_FLAG_HELP",
|
|
222679
222858
|
description: "This help. When you run the trigger command the CLI will prompt you for any information that isn't passed using flags."
|
|
222680
222859
|
}),
|
|
222681
|
-
topic:
|
|
222860
|
+
topic: import_core36.Flags.string({
|
|
222682
222861
|
required: !1,
|
|
222683
222862
|
hidden: !1,
|
|
222684
222863
|
env: "SHOPIFY_FLAG_TOPIC",
|
|
222685
222864
|
description: "The requested webhook topic."
|
|
222686
222865
|
}),
|
|
222687
|
-
"api-version":
|
|
222866
|
+
"api-version": import_core36.Flags.string({
|
|
222688
222867
|
required: !1,
|
|
222689
222868
|
hidden: !1,
|
|
222690
222869
|
env: "SHOPIFY_FLAG_API_VERSION",
|
|
222691
222870
|
description: "The API Version of the webhook topic."
|
|
222692
222871
|
}),
|
|
222693
|
-
"delivery-method":
|
|
222872
|
+
"delivery-method": import_core36.Flags.string({
|
|
222694
222873
|
required: !1,
|
|
222695
222874
|
hidden: !1,
|
|
222696
222875
|
options: [DELIVERY_METHOD.HTTP, DELIVERY_METHOD.PUBSUB, DELIVERY_METHOD.EVENTBRIDGE],
|
|
222697
222876
|
env: "SHOPIFY_FLAG_DELIVERY_METHOD",
|
|
222698
222877
|
description: "Method chosen to deliver the topic payload. If not passed, it's inferred from the address."
|
|
222699
222878
|
}),
|
|
222700
|
-
"shared-secret":
|
|
222879
|
+
"shared-secret": import_core36.Flags.string({
|
|
222701
222880
|
required: !1,
|
|
222702
222881
|
hidden: !1,
|
|
222703
222882
|
env: "SHOPIFY_FLAG_SHARED_SECRET",
|
|
222704
222883
|
description: "Deprecated. Please use client-secret."
|
|
222705
222884
|
}),
|
|
222706
|
-
"client-secret":
|
|
222885
|
+
"client-secret": import_core36.Flags.string({
|
|
222707
222886
|
required: !1,
|
|
222708
222887
|
hidden: !1,
|
|
222709
222888
|
env: "SHOPIFY_FLAG_CLIENT_SECRET",
|
|
222710
222889
|
description: "Your app's client secret. This secret allows us to return the X-Shopify-Hmac-SHA256 header that lets you validate the origin of the response that you receive."
|
|
222711
222890
|
}),
|
|
222712
|
-
address:
|
|
222891
|
+
address: import_core36.Flags.string({
|
|
222713
222892
|
required: !1,
|
|
222714
222893
|
hidden: !1,
|
|
222715
222894
|
env: "SHOPIFY_FLAG_ADDRESS",
|
|
@@ -222775,7 +222954,7 @@ async function devClean(options) {
|
|
|
222775
222954
|
}
|
|
222776
222955
|
|
|
222777
222956
|
// ../app/dist/cli/commands/app/dev/clean.js
|
|
222778
|
-
var
|
|
222957
|
+
var import_core37 = __toESM(require_lib2(), 1);
|
|
222779
222958
|
var _a40, DevClean = class extends AppLinkedCommand {
|
|
222780
222959
|
async run() {
|
|
222781
222960
|
let { flags } = await this.parse(_a40), appContextResult = await linkedAppContext({
|
|
@@ -222801,7 +222980,7 @@ DevClean.description = _a40.descriptionWithoutMarkdown();
|
|
|
222801
222980
|
DevClean.flags = {
|
|
222802
222981
|
...globalFlags,
|
|
222803
222982
|
...appFlags,
|
|
222804
|
-
store:
|
|
222983
|
+
store: import_core37.Flags.string({
|
|
222805
222984
|
hidden: !1,
|
|
222806
222985
|
char: "s",
|
|
222807
222986
|
description: "Store URL. Must be an existing development store.",
|
|
@@ -222811,6 +222990,132 @@ DevClean.flags = {
|
|
|
222811
222990
|
};
|
|
222812
222991
|
var clean_default = DevClean;
|
|
222813
222992
|
|
|
222993
|
+
// ../app/dist/cli/commands/app/function/info.js
|
|
222994
|
+
init_cjs_shims();
|
|
222995
|
+
|
|
222996
|
+
// ../app/dist/cli/services/function/info.js
|
|
222997
|
+
init_cjs_shims();
|
|
222998
|
+
function buildTargetingData(config2, functionDirectory) {
|
|
222999
|
+
let targeting = {};
|
|
223000
|
+
return config2.targeting?.forEach((target) => {
|
|
223001
|
+
target.target && (targeting[target.target] = {
|
|
223002
|
+
...target.input_query && { inputQueryPath: `${functionDirectory}/${target.input_query}` },
|
|
223003
|
+
...target.export && { export: target.export }
|
|
223004
|
+
});
|
|
223005
|
+
}), targeting;
|
|
223006
|
+
}
|
|
223007
|
+
function formatAsJson(ourFunction, config2, targeting, functionRunnerPath, schemaPath) {
|
|
223008
|
+
return JSON.stringify({
|
|
223009
|
+
handle: config2.handle,
|
|
223010
|
+
name: ourFunction.name,
|
|
223011
|
+
apiVersion: config2.api_version,
|
|
223012
|
+
targeting,
|
|
223013
|
+
schemaPath,
|
|
223014
|
+
wasmPath: ourFunction.outputPath,
|
|
223015
|
+
functionRunnerPath
|
|
223016
|
+
}, null, 2);
|
|
223017
|
+
}
|
|
223018
|
+
function buildConfigurationSection(config2, functionName) {
|
|
223019
|
+
return {
|
|
223020
|
+
title: `CONFIGURATION
|
|
223021
|
+
`,
|
|
223022
|
+
body: {
|
|
223023
|
+
tabularData: [
|
|
223024
|
+
["Handle", config2.handle ?? "N/A"],
|
|
223025
|
+
["Name", functionName ?? "N/A"],
|
|
223026
|
+
["API Version", config2.api_version ?? "N/A"]
|
|
223027
|
+
],
|
|
223028
|
+
firstColumnSubdued: !0
|
|
223029
|
+
}
|
|
223030
|
+
};
|
|
223031
|
+
}
|
|
223032
|
+
function buildTargetingSection(targeting) {
|
|
223033
|
+
if (Object.keys(targeting).length === 0)
|
|
223034
|
+
return null;
|
|
223035
|
+
let targetingData = [];
|
|
223036
|
+
return Object.entries(targeting).forEach(([target, config2]) => {
|
|
223037
|
+
targetingData.push([outputContent`${outputToken.cyan(target)}`.value, ""]), config2.inputQueryPath && targetingData.push([{ subdued: " Input Query Path" }, { filePath: config2.inputQueryPath }]), config2.export && targetingData.push([{ subdued: " Export" }, config2.export]);
|
|
223038
|
+
}), {
|
|
223039
|
+
title: `
|
|
223040
|
+
TARGETING
|
|
223041
|
+
`,
|
|
223042
|
+
body: {
|
|
223043
|
+
tabularData: targetingData
|
|
223044
|
+
}
|
|
223045
|
+
};
|
|
223046
|
+
}
|
|
223047
|
+
function buildBuildSection(wasmPath, schemaPath) {
|
|
223048
|
+
return {
|
|
223049
|
+
title: `
|
|
223050
|
+
BUILD
|
|
223051
|
+
`,
|
|
223052
|
+
body: {
|
|
223053
|
+
tabularData: [
|
|
223054
|
+
["Schema Path", { filePath: schemaPath ?? "N/A" }],
|
|
223055
|
+
["Wasm Path", { filePath: wasmPath }]
|
|
223056
|
+
],
|
|
223057
|
+
firstColumnSubdued: !0
|
|
223058
|
+
}
|
|
223059
|
+
};
|
|
223060
|
+
}
|
|
223061
|
+
function buildFunctionRunnerSection(functionRunnerPath) {
|
|
223062
|
+
return {
|
|
223063
|
+
title: `
|
|
223064
|
+
FUNCTION RUNNER
|
|
223065
|
+
`,
|
|
223066
|
+
body: {
|
|
223067
|
+
tabularData: [["Path", { filePath: functionRunnerPath }]],
|
|
223068
|
+
firstColumnSubdued: !0
|
|
223069
|
+
}
|
|
223070
|
+
};
|
|
223071
|
+
}
|
|
223072
|
+
function buildTextFormatSections(ourFunction, config2, targeting, functionRunnerPath, schemaPath) {
|
|
223073
|
+
let sections = [buildConfigurationSection(config2, ourFunction.name)], targetingSection = buildTargetingSection(targeting);
|
|
223074
|
+
return targetingSection && sections.push(targetingSection), sections.push(buildBuildSection(ourFunction.outputPath, schemaPath), buildFunctionRunnerSection(functionRunnerPath)), sections;
|
|
223075
|
+
}
|
|
223076
|
+
function functionInfo(ourFunction, options) {
|
|
223077
|
+
let { format: format5, functionRunnerPath, schemaPath } = options, config2 = ourFunction.configuration, targeting = buildTargetingData(config2, ourFunction.directory);
|
|
223078
|
+
return format5 === "json" ? formatAsJson(ourFunction, config2, targeting, functionRunnerPath, schemaPath) : buildTextFormatSections(ourFunction, config2, targeting, functionRunnerPath, schemaPath);
|
|
223079
|
+
}
|
|
223080
|
+
|
|
223081
|
+
// ../app/dist/cli/commands/app/function/info.js
|
|
223082
|
+
var _a41, FunctionInfo = class extends AppUnlinkedCommand {
|
|
223083
|
+
async run() {
|
|
223084
|
+
let { flags } = await this.parse(_a41), app = await localAppContext({
|
|
223085
|
+
directory: flags.path,
|
|
223086
|
+
userProvidedConfigName: flags.config
|
|
223087
|
+
}), ourFunction = await chooseFunction(app, flags.path), functionRunner = functionRunnerBinary();
|
|
223088
|
+
await downloadBinary(functionRunner);
|
|
223089
|
+
let schemaPath = await getOrGenerateSchemaPath(ourFunction, flags.path, flags["client-id"], flags.reset, flags.config), result = functionInfo(ourFunction, {
|
|
223090
|
+
format: flags.json ? "json" : "text",
|
|
223091
|
+
functionRunnerPath: functionRunner.path,
|
|
223092
|
+
schemaPath
|
|
223093
|
+
});
|
|
223094
|
+
return flags.json ? outputResult(result) : renderInfo({
|
|
223095
|
+
customSections: result
|
|
223096
|
+
}), { app };
|
|
223097
|
+
}
|
|
223098
|
+
};
|
|
223099
|
+
_a41 = FunctionInfo;
|
|
223100
|
+
FunctionInfo.summary = "Print basic information about your function.";
|
|
223101
|
+
FunctionInfo.descriptionWithMarkdown = `The information returned includes the following:
|
|
223102
|
+
|
|
223103
|
+
- The function handle
|
|
223104
|
+
- The function name
|
|
223105
|
+
- The function API version
|
|
223106
|
+
- The targeting configuration
|
|
223107
|
+
- The schema path
|
|
223108
|
+
- The WASM path
|
|
223109
|
+
- The function runner path`;
|
|
223110
|
+
FunctionInfo.description = _a41.descriptionWithoutMarkdown();
|
|
223111
|
+
FunctionInfo.flags = {
|
|
223112
|
+
...globalFlags,
|
|
223113
|
+
...appFlags,
|
|
223114
|
+
...functionFlags,
|
|
223115
|
+
...jsonFlag
|
|
223116
|
+
};
|
|
223117
|
+
var info_default3 = FunctionInfo;
|
|
223118
|
+
|
|
222814
223119
|
// ../app/dist/cli/index.js
|
|
222815
223120
|
var commands = {
|
|
222816
223121
|
"app:build": build_default2,
|
|
@@ -222831,6 +223136,7 @@ var commands = {
|
|
|
222831
223136
|
"app:function:build": build_default3,
|
|
222832
223137
|
"app:function:replay": replay_default,
|
|
222833
223138
|
"app:function:run": run_default,
|
|
223139
|
+
"app:function:info": info_default3,
|
|
222834
223140
|
"app:function:schema": schema_default,
|
|
222835
223141
|
"app:function:typegen": typegen_default,
|
|
222836
223142
|
"app:generate:extension": extension_default2,
|