@shopify/shop-minis-cli 0.0.114-alpha.0 → 0.0.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/commands/codemod/releases/index.js +2 -0
- package/build/commands/codemod/releases/index.js.map +1 -1
- package/build/commands/codemod/releases/v0-0-115.d.ts +3 -0
- package/build/commands/codemod/releases/v0-0-115.js +50 -0
- package/build/commands/codemod/releases/v0-0-115.js.map +1 -0
- package/build/commands/create-extension/constants.js +3 -0
- package/build/commands/create-extension/constants.js.map +1 -1
- package/build/commands/create-extension/index.js +1 -18
- package/build/commands/create-extension/index.js.map +1 -1
- package/build/commands/create-extension/types.d.ts +2 -1
- package/build/commands/create-extension/types.js +1 -0
- package/build/commands/create-extension/types.js.map +1 -1
- package/build/commands/create-extension/utils/create-from-template.js +1 -0
- package/build/commands/create-extension/utils/create-from-template.js.map +1 -1
- package/build/commands/generate-graphql-types/index.js +9 -1
- package/build/commands/generate-graphql-types/index.js.map +1 -1
- package/build/constants/extensions.d.ts +3 -1
- package/build/constants/extensions.js +2 -0
- package/build/constants/extensions.js.map +1 -1
- package/build/schemas/manifest.schema.json +201 -201
- package/build/utils/minis-manifest.js +3 -3
- package/build/utils/minis-manifest.js.map +1 -1
- package/package.json +4 -2
- package/scripts/test-template.ts +1 -1
- package/templates/__template_common/tsconfig.json +6 -1
- package/build/commands/create-extension/utils/install-shop-minis-ui-extensions.d.ts +0 -1
- package/build/commands/create-extension/utils/install-shop-minis-ui-extensions.js +0 -9
- package/build/commands/create-extension/utils/install-shop-minis-ui-extensions.js.map +0 -1
|
@@ -29,6 +29,7 @@ import v0x0x103Upgrade from './v0-0-103.js';
|
|
|
29
29
|
import v0x0x105Upgrade from './v0-0-105.js';
|
|
30
30
|
import v0x0x106Upgrade from './v0-0-106.js';
|
|
31
31
|
import v0x0x114Upgrade from './v0-0-114.js';
|
|
32
|
+
import v0x0x115Upgrade from './v0-0-115.js';
|
|
32
33
|
const upgrades = [
|
|
33
34
|
v0x0x42Upgrade,
|
|
34
35
|
v0x0x43Upgrade,
|
|
@@ -58,6 +59,7 @@ const upgrades = [
|
|
|
58
59
|
v0x0x105Upgrade,
|
|
59
60
|
v0x0x106Upgrade,
|
|
60
61
|
v0x0x114Upgrade,
|
|
62
|
+
v0x0x115Upgrade,
|
|
61
63
|
];
|
|
62
64
|
// the list of upgrades must be sorted by version. just making sure of it
|
|
63
65
|
upgrades.sort(({ version: upgradeVersion1 }, { version: upgradeVersion2 }) => semverGreaterThan(upgradeVersion1, upgradeVersion2) ? 1 : -1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/codemod/releases/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAEL,EAAE,IAAI,iBAAiB,EACvB,GAAG,IAAI,kBAAkB,GAC1B,MAAM,QAAQ,CAAA;AAGf,OAAO,cAAc,MAAM,oBAAoB,CAAA;AAC/C,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC,OAAO,cAAc,MAAM,cAAc,CAAA;AACzC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eAAe,EAAC,EAAE,EAAC,OAAO,EAAE,eAAe,EAAC,EAAE,EAAE,CACvE,iBAAiB,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC7D,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,WAAW,EACX,SAAS,EACT,UAAU,EACV,OAAO,GAMR;IACC,WAAW,CACT,kCAAkC,WAAW,eAAe,SAAS,EAAE,CACxE,CAAA;IACD,KAAK,MAAM,EAAC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAC,IAAI,QAAQ,EAAE;QAC5D,IACE,iBAAiB,CAAC,OAAO,EAAE,WAAW,CAAC;YACvC,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,EACtC;YACA,WAAW,CAAC,gCAAgC,OAAO,EAAE,CAAC,CAAA;YACtD,MAAM,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAA;YACvC,wBAAwB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;SAChD;KACF;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA,CAAC,gDAAgD;AAClE,CAAC;AAED,SAAS,wBAAwB,CAAC,OAAe,EAAE,YAAsB;IACvE,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE;QACxB,OAAM;KACP;IACD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,6BAA6B,OAAO,iBAAiB,CAAC,CAAC,CAAA;IAC9E,YAAY,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE;QACtC,OAAO,CAAC,GAAG,CAAC,KAAK,gBAAgB,EAAE,CAAC,CAAA;IACtC,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { SemVer } from 'semver';
|
|
4
|
+
import JSON5 from 'json5';
|
|
5
|
+
import { getRunBinCommand } from '../../../utils/package-manager.js';
|
|
6
|
+
import { execAsync } from '../../../utils/exec-async-child-process.js';
|
|
7
|
+
/**
|
|
8
|
+
* Add fallback typescript resolution for runtime dependencies
|
|
9
|
+
*
|
|
10
|
+
* Diff: https://github.com/Shopify/shop-minis-cli/compare/v0.0.114...v0.0.115
|
|
11
|
+
*/
|
|
12
|
+
async function applyUpgrade() {
|
|
13
|
+
try {
|
|
14
|
+
const tsconfigJsonPath = path.join(process.cwd(), 'tsconfig.json');
|
|
15
|
+
const tsconfigJsonString = await readFile(tsconfigJsonPath, {
|
|
16
|
+
encoding: 'utf-8',
|
|
17
|
+
});
|
|
18
|
+
const tsconfig = JSON5.parse(tsconfigJsonString);
|
|
19
|
+
tsconfig.compilerOptions = tsconfig.compilerOptions || {};
|
|
20
|
+
tsconfig.compilerOptions.paths = tsconfig.compilerOptions.paths || {};
|
|
21
|
+
tsconfig.compilerOptions.paths['*'] =
|
|
22
|
+
tsconfig.compilerOptions.paths['*'] || [];
|
|
23
|
+
const fallbackResolution = './node_modules/@shopify/shop-minis-runtime/node_modules/*';
|
|
24
|
+
if (tsconfig.compilerOptions.paths['*'].includes(fallbackResolution)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
tsconfig.compilerOptions.paths['*'].push(fallbackResolution);
|
|
28
|
+
// persist updated package.json
|
|
29
|
+
await writeFile(tsconfigJsonPath, `${JSON.stringify(tsconfig, null, 2)}\n`, // keep the new line at the end of the file
|
|
30
|
+
{
|
|
31
|
+
encoding: 'utf-8',
|
|
32
|
+
});
|
|
33
|
+
const prettierCmd = await getRunBinCommand(`prettier -w ${tsconfigJsonPath}`);
|
|
34
|
+
await execAsync({
|
|
35
|
+
cmd: prettierCmd,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// do nothing
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const exports = {
|
|
43
|
+
releaseNotes: [
|
|
44
|
+
'Add fallback resolution path to tsconfig to be able to grab dependencies nested in shop-minis-runtime',
|
|
45
|
+
],
|
|
46
|
+
applyUpgrade,
|
|
47
|
+
version: new SemVer('0.0.115'),
|
|
48
|
+
};
|
|
49
|
+
export default exports;
|
|
50
|
+
//# sourceMappingURL=v0-0-115.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v0-0-115.js","sourceRoot":"","sources":["../../../../src/commands/codemod/releases/v0-0-115.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,kBAAkB,CAAA;AACpD,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAC,MAAM,EAAC,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAA;AAClE,OAAO,EAAC,SAAS,EAAC,MAAM,4CAA4C,CAAA;AAIpE;;;;GAIG;AACH,KAAK,UAAU,YAAY;IACzB,IAAI;QACF,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,eAAe,CAAC,CAAA;QAClE,MAAM,kBAAkB,GAAG,MAAM,QAAQ,CAAC,gBAAgB,EAAE;YAC1D,QAAQ,EAAE,OAAO;SAClB,CAAC,CAAA;QAEF,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;QAEhD,QAAQ,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,IAAI,EAAE,CAAA;QACzD,QAAQ,CAAC,eAAe,CAAC,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,IAAI,EAAE,CAAA;QACrE,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC;YACjC,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;QAE3C,MAAM,kBAAkB,GACtB,2DAA2D,CAAA;QAE7D,IAAI,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE;YACpE,OAAM;SACP;QAED,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;QAE5D,+BAA+B;QAC/B,MAAM,SAAS,CACb,gBAAgB,EAChB,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,2CAA2C;QACrF;YACE,QAAQ,EAAE,OAAO;SAClB,CACF,CAAA;QAED,MAAM,WAAW,GAAG,MAAM,gBAAgB,CACxC,eAAe,gBAAgB,EAAE,CAClC,CAAA;QACD,MAAM,SAAS,CAAC;YACd,GAAG,EAAE,WAAW;SACjB,CAAC,CAAA;KACH;IAAC,MAAM;QACN,aAAa;KACd;AACH,CAAC;AAED,MAAM,OAAO,GAA8B;IACzC,YAAY,EAAE;QACZ,uGAAuG;KACxG;IACD,YAAY;IACZ,OAAO,EAAE,IAAI,MAAM,CAAC,SAAS,CAAC;CAC/B,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -23,6 +23,9 @@ export const EXTENSION_PAGE_CONFIG = {
|
|
|
23
23
|
[ExtensionPage.STORE_PAGE]: {
|
|
24
24
|
templates: [],
|
|
25
25
|
},
|
|
26
|
+
[ExtensionPage.ORDER_CONFIRMATION_PAGE]: {
|
|
27
|
+
templates: [],
|
|
28
|
+
},
|
|
26
29
|
};
|
|
27
30
|
export const EXTENSION_TARGET_CONFIG = {
|
|
28
31
|
[ExtensionTarget['shop.product.variants.render-before']]: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/commands/create-extension/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,aAAa,EA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AAG,CAAA;AACZ,CAAC,EAAE,EAAmE,CAAC,CAAA;AAEvE,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC,IAAI,CAC9D,gCAAgC,CACZ,CAAA"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/commands/create-extension/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,aAAa,EAAC,MAAM,+BAA+B,CAAA;AAE5E,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAA;AAExC,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAA;AAE/C,MAAM,CAAC,MAAM,qBAAqB,GAA2C;IAC3E,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE;QAChC,KAAK,EAAE,kBAAkB;KAC1B;IACD,CAAC,aAAa,CAAC,gBAAgB,CAAC,EAAE;QAChC,KAAK,EAAE,kBAAkB;KAC1B;IACD,CAAC,aAAa,CAAC,eAAe,CAAC,EAAE;QAC/B,KAAK,EAAE,iBAAiB;KACzB;IACD,CAAC,aAAa,CAAC,iBAAiB,CAAC,EAAE;QACjC,KAAK,EAAE,mBAAmB;KAC3B;CACF,CAAA;AAED,oGAAoG;AACpG,MAAM,CAAC,MAAM,qBAAqB,GAG9B;IACF,CAAC,aAAa,CAAC,YAAY,CAAC,EAAE;QAC5B,SAAS,EAAE,CAAC,aAAa,CAAC,eAAe,EAAE,aAAa,CAAC,iBAAiB,CAAC;KAC5E;IACD,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE;QAC1B,SAAS,EAAE,EAAE;KACd;IACD,CAAC,aAAa,CAAC,uBAAuB,CAAC,EAAE;QACvC,SAAS,EAAE,EAAE;KACd;CACF,CAAA;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,CAAC,eAAe,CAAC,qCAAqC,CAAC,CAAC,EAAE;QACxD,KAAK,EAAE,uCAAuC;QAC9C,IAAI,EAAE,aAAa,CAAC,YAAY;KACjC;CAC0E,CAAA;AAE7E,MAAM,CAAC,MAAM,gCAAgC,GAGzC,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;IACvE,IAAI,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;QAC1D,GAAG,CAAC,GAAsB,CAAC,GAAG,KAAK,CAAA;KACpC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,EAAE,EAAmE,CAAC,CAAA;AAEvE,MAAM,CAAC,MAAM,qCAAqC,GAAG,MAAM,CAAC,IAAI,CAC9D,gCAAgC,CACZ,CAAA"}
|
|
@@ -9,7 +9,6 @@ import { getRunBinCommand } from '../../utils/package-manager.js';
|
|
|
9
9
|
import { DEFAULT_OUTPUT_DIR, EXTENSION_PAGE_CONFIG, EXTENSION_TARGETS_WITH_TEMPLATES, EXTENSION_TARGETS_WITH_TEMPLATES_KEYS, EXTENSION_TYPE_CONFIG, } from './constants.js';
|
|
10
10
|
import { addTargetToConfig } from './utils/add-target-to-config.js';
|
|
11
11
|
import { createExtensionFromTemplate } from './utils/create-from-template.js';
|
|
12
|
-
import { installShopMinisUiExtensions } from './utils/install-shop-minis-ui-extensions.js';
|
|
13
12
|
function isExtensionTarget(value) {
|
|
14
13
|
return Object.values(ExtensionTarget).includes(value);
|
|
15
14
|
}
|
|
@@ -54,7 +53,7 @@ export function loadCommand(parentProgram) {
|
|
|
54
53
|
}
|
|
55
54
|
outputDebug(`create-extension target: "${target}", type: "${extensionType}", output: ${resolvedOutputDir}`);
|
|
56
55
|
let configUpdated = false;
|
|
57
|
-
|
|
56
|
+
const installedUIExtensions = false;
|
|
58
57
|
const errors = [];
|
|
59
58
|
try {
|
|
60
59
|
await createExtensionFromTemplate(manifest.name, targetConfig.page, target, extensionType, resolvedOutputDir);
|
|
@@ -80,22 +79,6 @@ export function loadCommand(parentProgram) {
|
|
|
80
79
|
],
|
|
81
80
|
]));
|
|
82
81
|
}
|
|
83
|
-
try {
|
|
84
|
-
await installShopMinisUiExtensions();
|
|
85
|
-
installedUIExtensions = true;
|
|
86
|
-
}
|
|
87
|
-
catch (error) {
|
|
88
|
-
// We can continue at this point with extra instructions for fixing this manually
|
|
89
|
-
errors.push(new AbortError('Could not install `@shopify/shop-minis-ui-extensions`', `${error}`, [
|
|
90
|
-
[
|
|
91
|
-
'Manually install',
|
|
92
|
-
{
|
|
93
|
-
command: '@shopify/shop-minis-ui-extensions',
|
|
94
|
-
},
|
|
95
|
-
'before trying to run your extension',
|
|
96
|
-
],
|
|
97
|
-
]));
|
|
98
|
-
}
|
|
99
82
|
const completedFully = errors.length === 0;
|
|
100
83
|
errors.forEach(handleError);
|
|
101
84
|
const nextSteps = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/create-extension/index.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAC,UAAU,EAAE,OAAO,IAAI,WAAW,EAAC,MAAM,6BAA6B,CAAA;AAC9E,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AACxD,OAAO,EACL,kBAAkB,EAClB,aAAa,GAGd,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,WAAW,CAAA;AAEzC,OAAO,EAAC,eAAe,EAAgB,MAAM,+BAA+B,CAAA;AAC5E,OAAO,EAAC,eAAe,EAAC,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAC,gBAAgB,EAAC,MAAM,gCAAgC,CAAA;AAE/D,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,gCAAgC,EAChC,qCAAqC,EACrC,qBAAqB,GACtB,MAAM,gBAAgB,CAAA;AAEvB,OAAO,EAAC,iBAAiB,EAAC,MAAM,iCAAiC,CAAA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E,MAAM,gBAAgB,CAC7B,qCAAqC,MAAM,EAAE,CAC9C;iBACF;aACF;SACF,CAAA;QAED,IAAI,CAAC,cAAc,EAAE;YACnB,SAAS,CAAC,OAAO,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAA;SACnD;QAED,aAAa,CAAC;YACZ,QAAQ,EAAE,cAAc;gBACtB,CAAC,CAAC,gCAAgC;gBAClC,CAAC,CAAC,6BAA6B;YACjC,IAAI,EAAE;gBACJ;oBACE,IAAI,EAAE;wBACJ,KAAK,EAAE;4BACL;gCACE,gCAAgC;gCAChC;oCACE,IAAI,EAAE,IAAI,CAAC,QAAQ,CACjB,OAAO,CAAC,GAAG,EAAE,EACb,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,MAAM,CAAC,CACrC;iCACF;6BACF;4BACD,aAAa;gCACX,CAAC,CAAC,oCAAoC;gCACtC,CAAC,CAAC,6CAA6C;4BACjD,qBAAqB;gCACnB,CAAC,CAAC;oCACE,EAAC,IAAI,EAAE,mCAAmC,EAAC;oCAC3C,eAAe;iCAChB;gCACH,CAAC,CAAC;oCACE,EAAC,IAAI,EAAE,mCAAmC,EAAC;oCAC3C,wBAAwB;iCACzB;yBACN;qBACF;iBACF;aACF;YACD,SAAS;SACV,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEJ,aAAa,CAAC,UAAU,CAAC,OAAO,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC,CAAA;AACnD,CAAC"}
|
|
@@ -2,5 +2,6 @@ export var ExtensionPage;
|
|
|
2
2
|
(function (ExtensionPage) {
|
|
3
3
|
ExtensionPage["PRODUCT_PAGE"] = "product-page";
|
|
4
4
|
ExtensionPage["STORE_PAGE"] = "store-page";
|
|
5
|
+
ExtensionPage["ORDER_CONFIRMATION_PAGE"] = "order-confirmation-page";
|
|
5
6
|
})(ExtensionPage || (ExtensionPage = {}));
|
|
6
7
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/create-extension/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/commands/create-extension/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,8CAA6B,CAAA;IAC7B,0CAAyB,CAAA;IACzB,oEAAmD,CAAA;AACrD,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB"}
|
|
@@ -9,6 +9,7 @@ const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
|
|
9
9
|
const queryDataUseExamples = {
|
|
10
10
|
'product-page': "console.log('Product data from input query:', extensionData?.product)",
|
|
11
11
|
'store-page': "console.log('Shop data from input query:', extensionData?.shop)",
|
|
12
|
+
'order-confirmation-page': "console.log('Order data from input query:', extensionData?.order)",
|
|
12
13
|
};
|
|
13
14
|
export async function createExtensionFromTemplate(miniName, extensionPage, extensionTarget, extensionType, outputDir) {
|
|
14
15
|
const tmpDir = await mkdtemp(path.join(os.tmpdir(), `${extensionPage}-${extensionType}-`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-from-template.js","sourceRoot":"","sources":["../../../../src/commands/create-extension/utils/create-from-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAC9C,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAC,IAAI,EAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,CAAC,MAAM,QAAQ,CAAA;AAGtB,OAAO,EAAC,wBAAwB,EAAC,MAAM,+CAA+C,CAAA;AAGtF,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAElE,MAAM,oBAAoB,GAAkC;IAC1D,cAAc,EACZ,uEAAuE;IACzE,YAAY,EACV,iEAAiE;
|
|
1
|
+
{"version":3,"file":"create-from-template.js","sourceRoot":"","sources":["../../../../src/commands/create-extension/utils/create-from-template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAC9C,OAAO,GAAG,MAAM,UAAU,CAAA;AAC1B,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,EAAC,IAAI,EAAC,MAAM,UAAU,CAAA;AAC7B,OAAO,CAAC,MAAM,QAAQ,CAAA;AAGtB,OAAO,EAAC,wBAAwB,EAAC,MAAM,+CAA+C,CAAA;AAGtF,MAAM,SAAS,GAAG,GAAG,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;AAElE,MAAM,oBAAoB,GAAkC;IAC1D,cAAc,EACZ,uEAAuE;IACzE,YAAY,EACV,iEAAiE;IACnE,yBAAyB,EACvB,mEAAmE;CACtE,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAC/C,QAAgB,EAChB,aAA4B,EAC5B,eAAgC,EAChC,aAA4B,EAC5B,SAAiB;IAEjB,MAAM,MAAM,GAAG,MAAM,OAAO,CAC1B,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,GAAG,aAAa,IAAI,aAAa,GAAG,CAAC,CAC7D,CAAA;IACD,MAAM,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC;SAC3C,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;SACjB,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAA;IACxB,MAAM,WAAW,GAAG,IAAI,CAAC,I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
|
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { Command } from 'commander';
|
|
5
5
|
import { GraphQLConfig } from 'graphql-config';
|
|
6
|
-
import { PRODUCT_PAGE_EXTENSION_TARGETS } from '../../constants/extensions.js';
|
|
6
|
+
import { PRODUCT_PAGE_EXTENSION_TARGETS, ORDER_PAGE_EXTENSION_TARGETS, } from '../../constants/extensions.js';
|
|
7
7
|
import { getMiniManifest } from '../../utils/minis-manifest.js';
|
|
8
8
|
import { getRunBinCommand } from '../../utils/package-manager.js';
|
|
9
9
|
import { maybeApplyPatches } from '../../utils/patch-package.js';
|
|
@@ -54,6 +54,14 @@ export function loadCommand(parentProgram) {
|
|
|
54
54
|
schemaTypesPath: schemaTypesPathConfig,
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
|
+
order: {
|
|
58
|
+
schemaPath: 'node_modules/@shopify/shop-minis-runtime/src/api/schema/order.graphql',
|
|
59
|
+
includes: ORDER_PAGE_EXTENSION_TARGETS.map(target => `src/targets/${target}/**/*.graphql`),
|
|
60
|
+
excludes: ['node_modules/**'],
|
|
61
|
+
extensions: {
|
|
62
|
+
schemaTypesPath: schemaTypesPathConfig,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
57
65
|
},
|
|
58
66
|
},
|
|
59
67
|
filepath: '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/generate-graphql-types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAA;AAEzC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAA;AAO5C,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/generate-graphql-types/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O,CAAC,GAAG,CAAC,EAAC,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAC,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;IAEJ,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAA;AACnC,CAAC"}
|
|
@@ -14,7 +14,9 @@ export declare enum ExtensionTarget {
|
|
|
14
14
|
/**
|
|
15
15
|
* @deprecated - internal use only and will be removed in future releases of the minis sdk.
|
|
16
16
|
*/
|
|
17
|
-
'store-page' = "store-page"
|
|
17
|
+
'store-page' = "store-page",
|
|
18
|
+
'order-confirmation-page' = "order-confirmation-page"
|
|
18
19
|
}
|
|
19
20
|
export declare const PRODUCT_PAGE_EXTENSION_TARGETS: ExtensionTarget[];
|
|
20
21
|
export declare const STORE_PAGE_EXTENSION_TARGETS: ExtensionTarget[];
|
|
22
|
+
export declare const ORDER_PAGE_EXTENSION_TARGETS: ExtensionTarget[];
|
|
@@ -19,7 +19,9 @@ export var ExtensionTarget;
|
|
|
19
19
|
* @deprecated - internal use only and will be removed in future releases of the minis sdk.
|
|
20
20
|
*/
|
|
21
21
|
ExtensionTarget["store-page"] = "store-page";
|
|
22
|
+
ExtensionTarget["order-confirmation-page"] = "order-confirmation-page";
|
|
22
23
|
})(ExtensionTarget || (ExtensionTarget = {}));
|
|
23
24
|
export const PRODUCT_PAGE_EXTENSION_TARGETS = Object.values(ExtensionTarget).filter(val => val.startsWith('shop.product.') || val === 'product-page');
|
|
24
25
|
export const STORE_PAGE_EXTENSION_TARGETS = Object.values(ExtensionTarget).filter(val => val.startsWith('shop.store.') || val === 'store-page');
|
|
26
|
+
export const ORDER_PAGE_EXTENSION_TARGETS = Object.values(ExtensionTarget).filter(val => val === 'order-confirmation-page');
|
|
25
27
|
//# sourceMappingURL=extensions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../src/constants/extensions.ts"],"names":[],"mappings":"AAAA,MAAM,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B,CAAC,CAAA"}
|
|
@@ -1,214 +1,214 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"$id": "/manifest.schema.json",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"title": "Shop Mini Manifest",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The name of the Mini"
|
|
11
|
+
},
|
|
12
|
+
"handle": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "A unique identifier for the Mini",
|
|
15
|
+
"pattern": "^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$"
|
|
16
|
+
},
|
|
17
|
+
"description": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The description of the Mini"
|
|
20
|
+
},
|
|
21
|
+
"icon_url": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"title": "The icon of the Mini",
|
|
24
|
+
"description": "An absolute path to the image (e.g. https://example.com/icon.png)"
|
|
25
|
+
},
|
|
26
|
+
"partner_name": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "The name of the Shopify partner who built the Mini"
|
|
29
|
+
},
|
|
30
|
+
"contact_email": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "An email address for receiving notifications.",
|
|
33
|
+
"format": "email"
|
|
34
|
+
},
|
|
35
|
+
"activation_subpath": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "A route on your Mini's Shopify app that will be used to activate (enable entry points) your Mini for the first time. This route path will be appended to the end of the admin URL of the Shopify app. For example, the value 'activate' will correspond to the URL https://admin.shopify.com/store/example-store/apps/my-handle/activate",
|
|
38
|
+
"pattern": "^(?:[a-z0-9~-]+/)*[a-z0-9~-]+$"
|
|
39
|
+
},
|
|
40
|
+
"shopify_apps": {
|
|
41
|
+
"type": "object",
|
|
42
|
+
"description": "The Shopify apps associated with the Mini",
|
|
43
|
+
"properties": {
|
|
44
|
+
"production": {
|
|
45
|
+
"type": "integer",
|
|
46
|
+
"minimum": 1,
|
|
47
|
+
"description": "The Shopify app ID for production"
|
|
11
48
|
},
|
|
12
|
-
"
|
|
49
|
+
"development": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"description": "The Shopify app IDs for development",
|
|
52
|
+
"uniqueItems": true,
|
|
53
|
+
"items": {"type": "integer", "minimum": 1}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"required": ["production"]
|
|
57
|
+
},
|
|
58
|
+
"notification_topics": {
|
|
59
|
+
"type": "array",
|
|
60
|
+
"description": "Specifies the reason for communication and the scope for messages. An example of a topic could be live streaming related notifications related to a merchant",
|
|
61
|
+
"items": {
|
|
62
|
+
"type": "object",
|
|
63
|
+
"required": ["handle", "description", "scope"],
|
|
64
|
+
"properties": {
|
|
65
|
+
"handle": {
|
|
13
66
|
"type": "string",
|
|
14
|
-
"description": "
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"description": {
|
|
67
|
+
"description": "Text identifier of the topic"
|
|
68
|
+
},
|
|
69
|
+
"description": {
|
|
18
70
|
"type": "string",
|
|
19
|
-
"description": "
|
|
20
|
-
|
|
21
|
-
|
|
71
|
+
"description": "Reason for the communication using the topic"
|
|
72
|
+
},
|
|
73
|
+
"scope": {
|
|
22
74
|
"type": "string",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
75
|
+
"description": "The scope in which messages are processed for the topic. SHOP means each message will be processed in the scope of a specific merchant, PRODUCT means each message will be processed in the scope of a specific product",
|
|
76
|
+
"enum": ["SHOP", "PRODUCT"]
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"notification_templates": {
|
|
82
|
+
"type": "array",
|
|
83
|
+
"description": "Specify the message which will be sent to subscribers when notification is triggered by the mutation",
|
|
84
|
+
"items": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"required": [
|
|
87
|
+
"handle",
|
|
88
|
+
"topic_handle",
|
|
89
|
+
"title",
|
|
90
|
+
"body",
|
|
91
|
+
"cooldown_minutes"
|
|
92
|
+
],
|
|
93
|
+
"properties": {
|
|
94
|
+
"handle": {
|
|
27
95
|
"type": "string",
|
|
28
|
-
"description": "
|
|
29
|
-
|
|
30
|
-
|
|
96
|
+
"description": "Text identifier of the template"
|
|
97
|
+
},
|
|
98
|
+
"topic_handle": {
|
|
31
99
|
"type": "string",
|
|
32
|
-
"description": "
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"activation_subpath": {
|
|
100
|
+
"description": "Reference to a notification topic"
|
|
101
|
+
},
|
|
102
|
+
"title": {
|
|
36
103
|
"type": "string",
|
|
37
|
-
"description": "
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"shopify_apps": {
|
|
41
|
-
"type": "object",
|
|
42
|
-
"description": "The Shopify apps associated with the Mini",
|
|
43
|
-
"properties": {
|
|
44
|
-
"production": {
|
|
45
|
-
"type": "integer",
|
|
46
|
-
"minimum": 1,
|
|
47
|
-
"description": "The Shopify app ID for production"
|
|
48
|
-
},
|
|
49
|
-
"development": {
|
|
50
|
-
"type": "array",
|
|
51
|
-
"description": "The Shopify app IDs for development",
|
|
52
|
-
"uniqueItems": true,
|
|
53
|
-
"items": { "type": "integer", "minimum": 1 }
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"required": ["production"]
|
|
57
|
-
},
|
|
58
|
-
"notification_topics": {
|
|
59
|
-
"type": "array",
|
|
60
|
-
"description": "Specifies the reason for communication and the scope for messages. An example of a topic could be live streaming related notifications related to a merchant",
|
|
61
|
-
"items": {
|
|
62
|
-
"type": "object",
|
|
63
|
-
"required": ["handle", "description", "scope"],
|
|
64
|
-
"properties": {
|
|
65
|
-
"handle": {
|
|
66
|
-
"type": "string",
|
|
67
|
-
"description": "Text identifier of the topic"
|
|
68
|
-
},
|
|
69
|
-
"description": {
|
|
70
|
-
"type": "string",
|
|
71
|
-
"description": "Reason for the communication using the topic"
|
|
72
|
-
},
|
|
73
|
-
"scope": {
|
|
74
|
-
"type": "string",
|
|
75
|
-
"description": "The scope in which messages are processed for the topic. SHOP means each message will be processed in the scope of a specific merchant, PRODUCT means each message will be processed in the scope of a specific product",
|
|
76
|
-
"enum": ["SHOP", "PRODUCT"]
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"notification_templates": {
|
|
82
|
-
"type": "array",
|
|
83
|
-
"description": "Specify the message which will be sent to subscribers when notification is triggered by the mutation",
|
|
84
|
-
"items": {
|
|
85
|
-
"type": "object",
|
|
86
|
-
"required": [
|
|
87
|
-
"handle",
|
|
88
|
-
"topic_handle",
|
|
89
|
-
"title",
|
|
90
|
-
"body",
|
|
91
|
-
"cooldown_minutes"
|
|
92
|
-
],
|
|
93
|
-
"properties": {
|
|
94
|
-
"handle": {
|
|
95
|
-
"type": "string",
|
|
96
|
-
"description": "Text identifier of the template"
|
|
97
|
-
},
|
|
98
|
-
"topic_handle": {
|
|
99
|
-
"type": "string",
|
|
100
|
-
"description": "Reference to a notification topic"
|
|
101
|
-
},
|
|
102
|
-
"title": {
|
|
103
|
-
"type": "string",
|
|
104
|
-
"description": "Template of notification title, supports interpolation using the Liquid template language"
|
|
105
|
-
},
|
|
106
|
-
"body": {
|
|
107
|
-
"type": "string",
|
|
108
|
-
"description": "Template of notification body, supports interpolation using the Liquid template language"
|
|
109
|
-
},
|
|
110
|
-
"cooldown_minutes": {
|
|
111
|
-
"type": "number",
|
|
112
|
-
"description": "How often the template allowes to send the exact same message to the same user, in minutes"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
"entry_points": {
|
|
118
|
-
"type": "array",
|
|
119
|
-
"description": "A list of entry points that the Mini supports",
|
|
120
|
-
"items": {
|
|
121
|
-
"type": "object",
|
|
122
|
-
"properties": {
|
|
123
|
-
"location": {
|
|
124
|
-
"type": "string",
|
|
125
|
-
"enum": [
|
|
126
|
-
"PRODUCT_PAGE",
|
|
127
|
-
"STORE_PAGE",
|
|
128
|
-
"PRODUCT_PAGE_CONTEXT_MENU",
|
|
129
|
-
"STORE_PAGE_CONTEXT_MENU",
|
|
130
|
-
"ORDER_CONFIRMATION_PAGE",
|
|
131
|
-
"ORDER_MANAGEMENT_PAGE"
|
|
132
|
-
]
|
|
133
|
-
},
|
|
134
|
-
"type": {
|
|
135
|
-
"type": "string",
|
|
136
|
-
"enum": [
|
|
137
|
-
"LINK",
|
|
138
|
-
"DEFAULT_CARD",
|
|
139
|
-
"IMAGE_COLLECTION",
|
|
140
|
-
"VIDEO_COLLECTION",
|
|
141
|
-
"EVENT_CARD_V2",
|
|
142
|
-
"PRODUCT_OFFER_CARD",
|
|
143
|
-
"IMAGE_COLLECTION_V2",
|
|
144
|
-
"VIDEO_COLLECTION_V2"
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
"allOf": [
|
|
149
|
-
{
|
|
150
|
-
"if": { "properties": { "type": { "const": "LINK" } } },
|
|
151
|
-
"then": { "required": ["location"] }
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
"if": { "properties": { "type": { "const": "DEFAULT_CARD" } } },
|
|
155
|
-
"then": { "required": ["location"] }
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
"if": { "properties": { "type": { "const": "IMAGE_COLLECTION" } } },
|
|
159
|
-
"then": { "required": ["location"] }
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
"if": { "properties": { "type": { "const": "IMAGE_COLLECTION_V2" } } },
|
|
163
|
-
"then": { "required": ["location"] }
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
"if": { "properties": { "type": { "const": "VIDEO_COLLECTION" } } },
|
|
167
|
-
"then": { "required": ["location"] }
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
"if": { "properties": { "type": { "const": "VIDEO_COLLECTION_V2" } } },
|
|
171
|
-
"then": { "required": ["location"] }
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"if": { "properties": { "type": { "const": "EVENT_CARD_V2" } } },
|
|
175
|
-
"then": { "required": ["location"] }
|
|
176
|
-
}
|
|
177
|
-
]
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
"trusted_domains": {
|
|
181
|
-
"type": "array",
|
|
182
|
-
"description": "A list of domains that the minis uses to make requests and fetch information. Requests to domains that are not in this list will fail in production.",
|
|
183
|
-
"uniqueItems": true,
|
|
184
|
-
"items": {
|
|
185
|
-
"type": "string"
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
"ios_app_store_url": {
|
|
104
|
+
"description": "Template of notification title, supports interpolation using the Liquid template language"
|
|
105
|
+
},
|
|
106
|
+
"body": {
|
|
189
107
|
"type": "string",
|
|
190
|
-
"description": "
|
|
191
|
-
|
|
192
|
-
|
|
108
|
+
"description": "Template of notification body, supports interpolation using the Liquid template language"
|
|
109
|
+
},
|
|
110
|
+
"cooldown_minutes": {
|
|
111
|
+
"type": "number",
|
|
112
|
+
"description": "How often the template allowes to send the exact same message to the same user, in minutes"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"entry_points": {
|
|
118
|
+
"type": "array",
|
|
119
|
+
"description": "A list of entry points that the Mini supports",
|
|
120
|
+
"items": {
|
|
121
|
+
"type": "object",
|
|
122
|
+
"properties": {
|
|
123
|
+
"location": {
|
|
193
124
|
"type": "string",
|
|
194
|
-
"
|
|
125
|
+
"enum": [
|
|
126
|
+
"PRODUCT_PAGE",
|
|
127
|
+
"STORE_PAGE",
|
|
128
|
+
"PRODUCT_PAGE_CONTEXT_MENU",
|
|
129
|
+
"STORE_PAGE_CONTEXT_MENU",
|
|
130
|
+
"ORDER_CONFIRMATION_PAGE",
|
|
131
|
+
"ORDER_MANAGEMENT_PAGE"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"type": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"enum": [
|
|
137
|
+
"LINK",
|
|
138
|
+
"DEFAULT_CARD",
|
|
139
|
+
"IMAGE_COLLECTION",
|
|
140
|
+
"VIDEO_COLLECTION",
|
|
141
|
+
"EVENT_CARD_V2",
|
|
142
|
+
"PRODUCT_OFFER_CARD",
|
|
143
|
+
"IMAGE_COLLECTION_V2",
|
|
144
|
+
"VIDEO_COLLECTION_V2"
|
|
145
|
+
]
|
|
146
|
+
}
|
|
195
147
|
},
|
|
196
|
-
"
|
|
197
|
-
|
|
198
|
-
"
|
|
199
|
-
"
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
204
|
-
|
|
148
|
+
"allOf": [
|
|
149
|
+
{
|
|
150
|
+
"if": {"properties": {"type": {"const": "LINK"}}},
|
|
151
|
+
"then": {"required": ["location"]}
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"if": {"properties": {"type": {"const": "DEFAULT_CARD"}}},
|
|
155
|
+
"then": {"required": ["location"]}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"if": {"properties": {"type": {"const": "IMAGE_COLLECTION"}}},
|
|
159
|
+
"then": {"required": ["location"]}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"if": {"properties": {"type": {"const": "IMAGE_COLLECTION_V2"}}},
|
|
163
|
+
"then": {"required": ["location"]}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
"if": {"properties": {"type": {"const": "VIDEO_COLLECTION"}}},
|
|
167
|
+
"then": {"required": ["location"]}
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"if": {"properties": {"type": {"const": "VIDEO_COLLECTION_V2"}}},
|
|
171
|
+
"then": {"required": ["location"]}
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"if": {"properties": {"type": {"const": "EVENT_CARD_V2"}}},
|
|
175
|
+
"then": {"required": ["location"]}
|
|
176
|
+
}
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
"trusted_domains": {
|
|
181
|
+
"type": "array",
|
|
182
|
+
"description": "A list of domains that the minis uses to make requests and fetch information. Requests to domains that are not in this list will fail in production.",
|
|
183
|
+
"uniqueItems": true,
|
|
184
|
+
"items": {
|
|
185
|
+
"type": "string"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
"ios_app_store_url": {
|
|
189
|
+
"type": "string",
|
|
190
|
+
"description": "The URL to the Mini's publisher's app on the iOS App Store"
|
|
191
|
+
},
|
|
192
|
+
"android_play_store_url": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"description": "The URL to the Mini's publisher's app on the Android Play Store"
|
|
205
195
|
},
|
|
206
|
-
"
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
"
|
|
212
|
-
"
|
|
213
|
-
|
|
196
|
+
"features": {
|
|
197
|
+
"type": "array",
|
|
198
|
+
"description": "A list of optional features that your mini app has enabled",
|
|
199
|
+
"uniqueItems": true,
|
|
200
|
+
"items": {
|
|
201
|
+
"type": "string",
|
|
202
|
+
"enum": ["FULL_BLEED_VIEWER"]
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
"required": [
|
|
207
|
+
"name",
|
|
208
|
+
"handle",
|
|
209
|
+
"icon_url",
|
|
210
|
+
"partner_name",
|
|
211
|
+
"shopify_apps",
|
|
212
|
+
"contact_email"
|
|
213
|
+
]
|
|
214
214
|
}
|
|
@@ -3,14 +3,14 @@ import path from 'node:path';
|
|
|
3
3
|
import { writeFileSync } from 'node:fs';
|
|
4
4
|
import { AbortError } from '@shopify/cli-kit/node/error';
|
|
5
5
|
import { Validator } from 'jsonschema';
|
|
6
|
-
|
|
7
|
-
const
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const manifestSchema = require('../schemas/manifest.schema.json');
|
|
8
8
|
export const DEFAULT_MANIFEST_PATH = path.join('src', 'manifest.json');
|
|
9
9
|
export function getMiniManifest(manifestPath = DEFAULT_MANIFEST_PATH) {
|
|
10
10
|
const fullManifestPath = path.join(process.cwd(), manifestPath);
|
|
11
11
|
let manifest;
|
|
12
12
|
try {
|
|
13
|
-
manifest =
|
|
13
|
+
manifest = require(fullManifestPath);
|
|
14
14
|
}
|
|
15
15
|
catch (err) {
|
|
16
16
|
const mockManifest = process.env.MOCK_MANIFEST;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"minis-manifest.js","sourceRoot":"","sources":["../../src/utils/minis-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAA;AACzC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAA;AAErC,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAA;AAEpC,OAAO,
|
|
1
|
+
{"version":3,"file":"minis-manifest.js","sourceRoot":"","sources":["../../src/utils/minis-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAA;AACzC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAA;AAErC,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAC,SAAS,EAAC,MAAM,YAAY,CAAA;AAEpC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,cAAc,GAAG,OAAO,CAAC,iCAAiC,CAAC,CAAA;AAEjE,MA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,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public",
|
|
5
5
|
"@shopify:registry": "https://registry.npmjs.org/"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.0.
|
|
7
|
+
"version": "0.0.115",
|
|
8
8
|
"description": "Shop Minis CLI",
|
|
9
9
|
"main": "build/index.js",
|
|
10
10
|
"bin": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "yarn clean && yarn build:cli:graphql && yarn build:cli && yarn dev-panel:build-and-copy",
|
|
18
18
|
"clean": "rm -rf build",
|
|
19
|
-
"build:cli": "tsc -p tsconfig.build.json && chmod 755 build/index.js",
|
|
19
|
+
"build:cli": "tsc -p tsconfig.build.json && chmod 755 build/index.js && cpx \"src/schemas/*.json\" build/schemas",
|
|
20
20
|
"build:cli:watch": "chokidar \"./src/**/*.ts\" -c \"yarn run build:cli\" --silent --initial --ignore '(build|node_modules)'",
|
|
21
21
|
"build:cli:graphql": "node --loader ts-node/esm scripts/graphql-codegen.ts",
|
|
22
22
|
"lint": "eslint . --ext .js,.mjs,.ts,.tsx --format codeframe --cache",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^5.17.0",
|
|
47
47
|
"@typescript-eslint/parser": "^5.17.0",
|
|
48
48
|
"chokidar-cli": "^3.0.0",
|
|
49
|
+
"cpx": "^1.5.0",
|
|
49
50
|
"eslint": "^8.24.0",
|
|
50
51
|
"eslint-formatter-codeframe": "^7.32.1",
|
|
51
52
|
"eslint-plugin-reanimated": "^2.0.0",
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
"inquirer": "^8.2.3",
|
|
78
79
|
"internal-ip": "^6.2.0",
|
|
79
80
|
"jscodeshift": "^0.15.1",
|
|
81
|
+
"json5": "^2.2.3",
|
|
80
82
|
"jsonschema": "^1.4.1",
|
|
81
83
|
"lodash": "^4.17.21",
|
|
82
84
|
"metro": "0.80.4",
|
package/scripts/test-template.ts
CHANGED
|
@@ -30,7 +30,7 @@ const program = new Command()
|
|
|
30
30
|
|
|
31
31
|
// build mini
|
|
32
32
|
execSync(
|
|
33
|
-
`yarn shop-minis create test-template --
|
|
33
|
+
`yarn shop-minis create test-template --template ${templateName} --output-dir ../templates/`,
|
|
34
34
|
{stdio: 'inherit'}
|
|
35
35
|
)
|
|
36
36
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function installShopMinisUiExtensions(): Promise<void>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { outputDebug } from '@shopify/cli-kit/node/output';
|
|
2
|
-
import { execAsync } from '../../../utils/exec-async-child-process.js';
|
|
3
|
-
import { getUpgradePackageCommand } from '../../../utils/package-manager.js';
|
|
4
|
-
export async function installShopMinisUiExtensions() {
|
|
5
|
-
const command = await getUpgradePackageCommand('@shopify/shop-minis-ui-extensions');
|
|
6
|
-
outputDebug(`Running install command: ${command}`);
|
|
7
|
-
await execAsync(command);
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=install-shop-minis-ui-extensions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-shop-minis-ui-extensions.js","sourceRoot":"","sources":["../../../../src/commands/create-extension/utils/install-shop-minis-ui-extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAA;AAExD,OAAO,EAAC,SAAS,EAAC,MAAM,4CAA4C,CAAA;AACpE,OAAO,EAAC,wBAAwB,EAAC,MAAM,mCAAmC,CAAA;AAE1E,MAAM,CAAC,KAAK,UAAU,4BAA4B;IAChD,MAAM,OAAO,GAAG,MAAM,wBAAwB,CAC5C,mCAAmC,CACpC,CAAA;IAED,WAAW,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAA;IAElD,MAAM,SAAS,CAAC,OAAO,CAAC,CAAA;AAC1B,CAAC"}
|