@salesforce/b2c-cli 2.0.0 → 2.1.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/dist/commands/job/export.d.ts +1 -0
- package/dist/commands/job/export.js +17 -4
- package/dist/commands/job/export.js.map +1 -1
- package/dist/commands/job/import.d.ts +22 -2
- package/dist/commands/job/import.js +116 -11
- package/dist/commands/job/import.js.map +1 -1
- package/dist/commands/mrt/bundle/delete.js +8 -12
- package/dist/commands/mrt/bundle/delete.js.map +1 -1
- package/dist/commands/mrt/bundle/deploy.d.ts +33 -9
- package/dist/commands/mrt/bundle/deploy.js +141 -94
- package/dist/commands/mrt/bundle/deploy.js.map +1 -1
- package/dist/commands/mrt/bundle/download.js +7 -11
- package/dist/commands/mrt/bundle/download.js.map +1 -1
- package/dist/commands/mrt/bundle/history.js +4 -6
- package/dist/commands/mrt/bundle/history.js.map +1 -1
- package/dist/commands/mrt/bundle/list.d.ts +6 -2
- package/dist/commands/mrt/bundle/list.js +28 -7
- package/dist/commands/mrt/bundle/list.js.map +1 -1
- package/dist/commands/mrt/bundle/save.js +1 -3
- package/dist/commands/mrt/bundle/save.js.map +1 -1
- package/dist/commands/mrt/bundle/upload-v2.d.ts +4 -0
- package/dist/commands/mrt/bundle/upload-v2.js +16 -13
- package/dist/commands/mrt/bundle/upload-v2.js.map +1 -1
- package/dist/commands/mrt/env/clone.js +4 -6
- package/dist/commands/mrt/env/clone.js.map +1 -1
- package/dist/commands/mrt/env/create.js +4 -6
- package/dist/commands/mrt/env/create.js.map +1 -1
- package/dist/commands/mrt/env/delete.js +5 -9
- package/dist/commands/mrt/env/delete.js.map +1 -1
- package/dist/commands/mrt/env/invalidate.js +2 -4
- package/dist/commands/mrt/env/invalidate.js.map +1 -1
- package/dist/commands/mrt/env/redirect/clone.js +5 -7
- package/dist/commands/mrt/env/redirect/clone.js.map +1 -1
- package/dist/commands/mrt/env/redirect/create.js +5 -7
- package/dist/commands/mrt/env/redirect/create.js.map +1 -1
- package/dist/commands/mrt/env/redirect/delete.js +1 -3
- package/dist/commands/mrt/env/redirect/delete.js.map +1 -1
- package/dist/commands/mrt/env/var/delete.d.ts +3 -2
- package/dist/commands/mrt/env/var/delete.js +27 -10
- package/dist/commands/mrt/env/var/delete.js.map +1 -1
- package/dist/commands/mrt/env/var/list.d.ts +5 -4
- package/dist/commands/mrt/env/var/list.js +30 -11
- package/dist/commands/mrt/env/var/list.js.map +1 -1
- package/dist/commands/mrt/env/var/push.d.ts +5 -4
- package/dist/commands/mrt/env/var/push.js +77 -31
- package/dist/commands/mrt/env/var/push.js.map +1 -1
- package/dist/commands/mrt/env/var/set.d.ts +3 -2
- package/dist/commands/mrt/env/var/set.js +35 -18
- package/dist/commands/mrt/env/var/set.js.map +1 -1
- package/dist/commands/mrt/org/cert/create.js +6 -8
- package/dist/commands/mrt/org/cert/create.js.map +1 -1
- package/dist/commands/mrt/org/cert/delete.js +1 -3
- package/dist/commands/mrt/org/cert/delete.js.map +1 -1
- package/dist/commands/mrt/org/cert/restart-validation.js +6 -8
- package/dist/commands/mrt/org/cert/restart-validation.js.map +1 -1
- package/dist/commands/mrt/org/member/add.js +5 -7
- package/dist/commands/mrt/org/member/add.js.map +1 -1
- package/dist/commands/mrt/org/member/remove.js +1 -3
- package/dist/commands/mrt/org/member/remove.js.map +1 -1
- package/dist/commands/mrt/org/member/update.js +1 -3
- package/dist/commands/mrt/org/member/update.js.map +1 -1
- package/dist/commands/mrt/project/delete.js +1 -3
- package/dist/commands/mrt/project/delete.js.map +1 -1
- package/dist/commands/mrt/project/member/add.js +4 -6
- package/dist/commands/mrt/project/member/add.js.map +1 -1
- package/dist/commands/mrt/project/member/remove.js +1 -3
- package/dist/commands/mrt/project/member/remove.js.map +1 -1
- package/dist/commands/mrt/project/member/update.js +4 -6
- package/dist/commands/mrt/project/member/update.js.map +1 -1
- package/dist/commands/mrt/project/notification/create.js +9 -11
- package/dist/commands/mrt/project/notification/create.js.map +1 -1
- package/dist/commands/mrt/project/notification/delete.js +1 -3
- package/dist/commands/mrt/project/notification/delete.js.map +1 -1
- package/dist/commands/mrt/project/notification/update.js +1 -3
- package/dist/commands/mrt/project/notification/update.js.map +1 -1
- package/dist/commands/mrt/tail-logs.js +15 -21
- package/dist/commands/mrt/tail-logs.js.map +1 -1
- package/dist/commands/mrt/user/api-key.js +3 -5
- package/dist/commands/mrt/user/api-key.js.map +1 -1
- package/dist/commands/setup/inspect.d.ts +7 -0
- package/dist/commands/setup/inspect.js +122 -5
- package/dist/commands/setup/inspect.js.map +1 -1
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/package.json +15 -2
- package/dist/script-types/node_modules/@salesforce/b2c-script-types/plugin/index.js +24 -7
- package/oclif.manifest.json +16529 -16458
- package/package.json +2 -2
|
@@ -37,8 +37,9 @@ const SFRA_AMBIENT_MODULES = new Set([
|
|
|
37
37
|
]);
|
|
38
38
|
// Candidate suffixes appended when resolving a SFCC-style relative require to
|
|
39
39
|
// a cartridge file. SFRA convention is to omit the .js extension, so .js wins
|
|
40
|
-
// first; .json captures the occasional resource bundle import.
|
|
41
|
-
|
|
40
|
+
// first; .json captures the occasional resource bundle import; .ds covers
|
|
41
|
+
// legacy pipeline-era scripts, which the platform also resolves after .js.
|
|
42
|
+
const CANDIDATE_EXTENSIONS = ['.js', '.json', '.ds', '/index.js', '/index.ds'];
|
|
42
43
|
// Cartridges that conventionally sit at the bottom of the cartridge path when
|
|
43
44
|
// the user hasn't told us otherwise (no `cartridges` in dw.json/SFCC_CARTRIDGES).
|
|
44
45
|
// Higher rank = lower in the cartridge path. SFRA's runtime path ends with
|
|
@@ -77,7 +78,12 @@ function init({ typescript: ts }) {
|
|
|
77
78
|
const setCartridges = (list) => {
|
|
78
79
|
cartridges = list.map(({ name, src }) => {
|
|
79
80
|
const n = normalize(src);
|
|
80
|
-
|
|
81
|
+
const raw = src.replace(/\\/g, '/');
|
|
82
|
+
return {
|
|
83
|
+
name,
|
|
84
|
+
root: n.endsWith('/') ? n : n + '/',
|
|
85
|
+
srcRoot: raw.endsWith('/') ? raw : raw + '/',
|
|
86
|
+
};
|
|
81
87
|
});
|
|
82
88
|
};
|
|
83
89
|
const applyConfig = (config) => {
|
|
@@ -275,7 +281,7 @@ function init({ typescript: ts }) {
|
|
|
275
281
|
if (!subpath)
|
|
276
282
|
return undefined;
|
|
277
283
|
for (const c of order) {
|
|
278
|
-
const baseAbs = c.
|
|
284
|
+
const baseAbs = c.srcRoot + subpath;
|
|
279
285
|
for (const ext of CANDIDATE_EXTENSIONS) {
|
|
280
286
|
const candidate = baseAbs + ext;
|
|
281
287
|
if (fileExists(candidate)) {
|
|
@@ -307,7 +313,7 @@ function init({ typescript: ts }) {
|
|
|
307
313
|
const modulesCart = cartridges.find((c) => c.name === 'modules');
|
|
308
314
|
if (!modulesCart)
|
|
309
315
|
return undefined;
|
|
310
|
-
const baseAbs = modulesCart.
|
|
316
|
+
const baseAbs = modulesCart.srcRoot + moduleName;
|
|
311
317
|
for (const ext of CANDIDATE_EXTENSIONS) {
|
|
312
318
|
const candidate = baseAbs + ext;
|
|
313
319
|
if (fileExists(candidate)) {
|
|
@@ -322,7 +328,7 @@ function init({ typescript: ts }) {
|
|
|
322
328
|
if (content) {
|
|
323
329
|
const main = JSON.parse(content).main;
|
|
324
330
|
if (typeof main === 'string' && main.length > 0) {
|
|
325
|
-
const resolved = (modulesCart.
|
|
331
|
+
const resolved = (modulesCart.srcRoot + moduleName + '/' + main.replace(/^\.\//, '')).replace(/\\/g, '/');
|
|
326
332
|
if (fileExists(resolved)) {
|
|
327
333
|
return { resolved, source: modulesCart.name };
|
|
328
334
|
}
|
|
@@ -430,6 +436,17 @@ function init({ typescript: ts }) {
|
|
|
430
436
|
}
|
|
431
437
|
return additions.length > 0 ? [...list, ...additions] : list;
|
|
432
438
|
};
|
|
439
|
+
// TS derives a file's ScriptKind from its extension and falls back to TS
|
|
440
|
+
// for anything it doesn't recognize, which would parse legacy .ds scripts
|
|
441
|
+
// as TypeScript. Report JS so they get the same JavaScript semantics
|
|
442
|
+
// (allowJs/checkJs, JSDoc types) as their .js siblings. Returning Unknown
|
|
443
|
+
// for everything else lets TS fall back to its own extension mapping.
|
|
444
|
+
const origGetScriptKind = host.getScriptKind?.bind(host);
|
|
445
|
+
host.getScriptKind = (fileName) => {
|
|
446
|
+
if (enabled && fileName.endsWith('.ds'))
|
|
447
|
+
return ts.ScriptKind.JS;
|
|
448
|
+
return origGetScriptKind ? origGetScriptKind(fileName) : ts.ScriptKind.Unknown;
|
|
449
|
+
};
|
|
433
450
|
const origResolveModuleNameLiterals = host.resolveModuleNameLiterals?.bind(host);
|
|
434
451
|
if (origResolveModuleNameLiterals) {
|
|
435
452
|
host.resolveModuleNameLiterals = (moduleLiterals, containingFile, redirectedReference, options, containingSourceFile, reusedNames) => {
|
|
@@ -538,7 +555,7 @@ function init({ typescript: ts }) {
|
|
|
538
555
|
const moduleName = sfraModuleAtOffset(def.textSpan.start);
|
|
539
556
|
if (!moduleName)
|
|
540
557
|
return def;
|
|
541
|
-
const candidates = [modulesCart.
|
|
558
|
+
const candidates = [modulesCart.srcRoot + moduleName + '.js', modulesCart.srcRoot + moduleName + '/index.js'];
|
|
542
559
|
for (const candidate of candidates) {
|
|
543
560
|
if (fileExists(candidate)) {
|
|
544
561
|
return { ...def, fileName: candidate, textSpan: { start: 0, length: 0 } };
|