shoplazza-cli 1.0.6 → 1.0.7-beta.2

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.
Files changed (116) hide show
  1. package/bin/shoplazza +5 -1
  2. package/lib/app/api/index.js +96 -0
  3. package/lib/app/commands/build.js +63 -36
  4. package/lib/app/commands/connect.js +73 -0
  5. package/lib/app/commands/create.js +15 -14
  6. package/lib/app/commands/deploy.js +22 -14
  7. package/lib/app/commands/list.js +15 -11
  8. package/lib/app/commands/release.js +59 -0
  9. package/lib/app/commands/serve.js +105 -51
  10. package/lib/app/commands/versions.js +36 -25
  11. package/lib/app/index.js +11 -7
  12. package/lib/app/template/basic-app/README.md +19 -5
  13. package/lib/app/template/basic-app/extension.config.json +4 -0
  14. package/lib/app/template/basic-app/package.json +6 -5
  15. package/lib/app/template/basic-app/theme-app/assets/index.css +2 -2
  16. package/lib/app/template/basic-app/theme-app/assets-manifest.json +1 -0
  17. package/lib/app/template/basic-app/theme-app/blocks/index.liquid +6 -4
  18. package/lib/app/template/basic-app/theme-app/locales/ar-SA.json +1 -0
  19. package/lib/app/template/basic-app/theme-app/locales/de-DE.json +1 -0
  20. package/lib/app/template/basic-app/theme-app/locales/en-US.json +6 -0
  21. package/lib/app/template/basic-app/theme-app/locales/es-ES.json +1 -0
  22. package/lib/app/template/basic-app/theme-app/locales/fr-FR.json +1 -0
  23. package/lib/app/template/basic-app/theme-app/locales/id-ID.json +1 -0
  24. package/lib/app/template/basic-app/theme-app/locales/it-IT.json +1 -0
  25. package/lib/app/template/basic-app/theme-app/locales/ja-JP.json +1 -0
  26. package/lib/app/template/basic-app/theme-app/locales/ko-KR.json +1 -0
  27. package/lib/app/template/basic-app/theme-app/locales/nl-NL.json +1 -0
  28. package/lib/app/template/basic-app/theme-app/locales/pl-PL.json +1 -0
  29. package/lib/app/template/basic-app/theme-app/locales/pt-PT.json +1 -0
  30. package/lib/app/template/basic-app/theme-app/locales/ru-RU.json +1 -0
  31. package/lib/app/template/basic-app/theme-app/locales/th-TH.json +1 -0
  32. package/lib/app/template/basic-app/theme-app/locales/zh-CN.json +6 -0
  33. package/lib/app/template/basic-app/theme-app/locales/zh-TW.json +1 -0
  34. package/lib/app/template/basic-app/theme-app/snippets/index.liquid +1 -1
  35. package/lib/app/template/embed-app/README.md +19 -6
  36. package/lib/app/template/embed-app/extension.config.json +4 -0
  37. package/lib/app/template/embed-app/package.json +6 -5
  38. package/lib/app/template/embed-app/theme-app/assets-manifest.json +1 -0
  39. package/lib/app/template/embed-app/theme-app/blocks/index.liquid +7 -4
  40. package/lib/app/template/embed-app/theme-app/locales/ar-SA.json +1 -3
  41. package/lib/app/template/embed-app/theme-app/locales/de-DE.json +1 -3
  42. package/lib/app/template/embed-app/theme-app/locales/en-US.json +4 -1
  43. package/lib/app/template/embed-app/theme-app/locales/es-ES.json +1 -3
  44. package/lib/app/template/embed-app/theme-app/locales/fr-FR.json +1 -3
  45. package/lib/app/template/embed-app/theme-app/locales/id-ID.json +1 -3
  46. package/lib/app/template/embed-app/theme-app/locales/it-IT.json +1 -3
  47. package/lib/app/template/embed-app/theme-app/locales/ja-JP.json +1 -3
  48. package/lib/app/template/embed-app/theme-app/locales/ko-KR.json +1 -3
  49. package/lib/app/template/embed-app/theme-app/locales/nl-NL.json +1 -3
  50. package/lib/app/template/embed-app/theme-app/locales/pl-PL.json +1 -3
  51. package/lib/app/template/embed-app/theme-app/locales/pt-PT.json +1 -3
  52. package/lib/app/template/embed-app/theme-app/locales/ru-RU.json +1 -3
  53. package/lib/app/template/embed-app/theme-app/locales/th-TH.json +1 -3
  54. package/lib/app/template/embed-app/theme-app/locales/zh-CN.json +4 -1
  55. package/lib/app/template/embed-app/theme-app/locales/zh-TW.json +1 -3
  56. package/lib/app/template/embed-app/theme-app/snippets/index.liquid +1 -1
  57. package/lib/app/template/embed-app/theme-app/snippets/index_css.liquid +6 -0
  58. package/lib/app/utils/config.js +7 -4
  59. package/lib/app/utils/index.js +16 -23
  60. package/lib/auth/getCode.js +2 -2
  61. package/lib/auth/index.js +2 -2
  62. package/lib/check.js +26 -0
  63. package/lib/checkout/api.js +1 -2
  64. package/lib/checkout/build.js +1 -1
  65. package/lib/checkout/create.js +1 -1
  66. package/lib/checkout/deploy.js +1 -1
  67. package/lib/checkout/dev/index.js +1 -1
  68. package/lib/checkout/fields.js +1 -1
  69. package/lib/checkout/preview.js +1 -1
  70. package/lib/checkout/push.js +1 -1
  71. package/lib/checkout/undeploy.js +1 -1
  72. package/lib/checkout/util.js +1 -1
  73. package/lib/checkout/verify.js +1 -1
  74. package/lib/commands/theme/delete.js +1 -1
  75. package/lib/commands/theme/package.js +1 -1
  76. package/lib/commands/theme/publish.js +1 -1
  77. package/lib/commands/theme/pull.js +1 -1
  78. package/lib/commands/theme/push.js +1 -1
  79. package/lib/commands/theme/serve.js +2 -2
  80. package/lib/common/login.js +1 -1
  81. package/lib/function/bin/index.js +20 -0
  82. package/lib/function/bin/javy/javy-arm-linux-v5.0.1 +0 -0
  83. package/lib/function/bin/javy/javy-arm-macos-v5.0.1 +0 -0
  84. package/lib/function/bin/javy/javy-x86_64-linux-v5.0.1 +0 -0
  85. package/lib/function/bin/javy/javy-x86_64-macos-v5.0.1 +0 -0
  86. package/lib/function/bin/javy/javy-x86_64-windows-v5.0.1 +0 -0
  87. package/lib/function/commands/compile.js +42 -0
  88. package/lib/function/commands/create.js +77 -0
  89. package/lib/function/commands/list.js +18 -0
  90. package/lib/function/commands/release.js +69 -0
  91. package/lib/function/index.js +24 -0
  92. package/lib/function/template/js/README.md +37 -0
  93. package/lib/function/template/js/_gitignore +4 -0
  94. package/lib/function/template/js/extension.config.json +5 -0
  95. package/lib/function/template/js/package.json +17 -0
  96. package/lib/function/template/js/src/index.js +64 -0
  97. package/lib/function/utils.js +29 -0
  98. package/lib/openAPI/api.js +1 -1
  99. package/lib/openAPI/index.js +0 -1
  100. package/lib/oss.js +0 -3
  101. package/lib/partner-api/axios.js +67 -0
  102. package/lib/partner-api/index.js +79 -0
  103. package/lib/{checkout → utils}/console.js +3 -2
  104. package/lib/utils/env.js +17 -0
  105. package/lib/utils/file.js +48 -0
  106. package/lib/utils/platform.js +37 -0
  107. package/lib/{utils.js → utils/utils.js} +3 -3
  108. package/package.json +1 -1
  109. package/lib/app/api/api.js +0 -93
  110. package/lib/app/api/request.js +0 -72
  111. package/lib/app/template/basic-app/.ci/k8s.yaml +0 -4
  112. package/lib/app/template/basic-app/theme-app.config.json +0 -4
  113. package/lib/app/template/embed-app/.ci/k8s.yaml +0 -4
  114. package/lib/app/template/embed-app/theme-app/assets/index.css +0 -4
  115. package/lib/app/template/embed-app/theme-app.config.json +0 -4
  116. /package/lib/{config.js → utils/config.js} +0 -0
@@ -1,36 +1,35 @@
1
- const path = require('path');
2
1
  const chalk = require('chalk');
3
2
  const inquirer = require('inquirer');
4
- const { STORE_DOMAIN, THEME_APP_PATH, EXCHANGE_TOKEN } = require('../utils/config');
5
- const { compress, getThemeAppConfig, setThemeAppConfig } = require('../utils');
6
- const { toCreateThemeApp, toUploadThemeApp, getTaskStatus, getThemeList } = require('../api/api');
7
- const { initWatcher } = require('../../utils');
3
+ const fsExtra = require('fs-extra');
4
+ const ora = require('ora');
5
+ const { STORE_DOMAIN, THEME_APP_DIR_PATH, EXCHANGE_TOKEN } = require('../utils/config');
6
+ const { compress, getThemeExtensionConfig, setThemeExtensionConfig, getFileInfo } = require('../utils');
7
+ const {
8
+ toCreateThemeApp,
9
+ toUploadThemeApp,
10
+ getTaskStatus,
11
+ getThemeList,
12
+ toCreateFile,
13
+ toUpdateFile,
14
+ toDeleteFile
15
+ } = require('../api');
16
+ const { watchWorkspace } = require('../../utils/utils');
8
17
  const { useOss } = require('../../oss');
9
18
 
10
- /**
11
- * 模拟上传文件到服务器
12
- */
13
- async function uploadFileToServer(filePath) {
14
- console.log(chalk.blue(`[UPLOAD] ${filePath} - Uploading to server...`));
15
- // TODO: 替换为实际的上传逻辑(例如调用后端 API 或 WebSocket 通信)
16
- await new Promise((resolve) => setTimeout(resolve, 1000)); // 模拟网络延迟
17
- console.log(chalk.green(`[SUCCESS] ${filePath} - Uploaded successfully.`));
18
- }
19
-
20
19
  /**
21
20
  * 控制台提示信息
22
21
  */
23
- function consoleTips(selectedThemeId, appId) {
22
+ function consoleTips(selectedThemeId, extensionId) {
24
23
  console.log(`\n======================================PREVIEW URLS======================================`);
25
24
  console.log(chalk.cyan.bold('🔗 Admin Preview URL:'));
26
25
  console.log(
27
- chalk.blueBright(` https://${STORE_DOMAIN}/admin/card?theme_id=${selectedThemeId}&ext_debug=${appId}\n`)
26
+ chalk.blueBright(` https://${STORE_DOMAIN}/admin/card?theme_id=${selectedThemeId}&ext_debug=${extensionId}\n`)
28
27
  );
29
28
  console.log(chalk.cyan.bold('🔗 Storefront Preview URL:'));
30
- console.log(chalk.blueBright(` https://${STORE_DOMAIN}?preview_theme_id=${selectedThemeId}&ext_debug[]=${appId}\n`));
29
+ console.log(chalk.blueBright(` https://${STORE_DOMAIN}?preview_theme_id=${selectedThemeId}&ext_debug=${extensionId}\n`));
31
30
  console.log(`=====================================WATCHER RUNNING=====================================`);
32
31
  console.log(chalk.green(`🎉 File watcher is now running!`));
33
- console.log(chalk.green(`📂 Watching directory:`), chalk.blue(THEME_APP_PATH));
32
+ console.log(chalk.green(`📂 Watching directory:`), chalk.blue(THEME_APP_DIR_PATH));
34
33
  console.log(chalk.green(`✨ You can make changes to your files, and they will be processed automatically.`));
35
34
  console.log(chalk.green(`🚀 Press Ctrl+C to stop.\n`));
36
35
  }
@@ -38,33 +37,42 @@ function consoleTips(selectedThemeId, appId) {
38
37
  /**
39
38
  * 同步本地代码到远程服务器
40
39
  */
41
- async function syncLocalFiles(appId) {
42
- const { zipPath, zipName } = await compress(THEME_APP_PATH);
40
+ async function syncLocalFiles(extensionId) {
41
+ const spinner = ora('Start synchronizing local files to remote...').start();
42
+ const { zipPath, zipName } = await compress(THEME_APP_DIR_PATH);
43
43
  const { uploadOss } = useOss(
44
44
  EXCHANGE_TOKEN,
45
45
  STORE_DOMAIN,
46
46
  `✗ No store found. Please run ${chalk.cyan('shoplazza login')} to login to a specific store.`
47
47
  );
48
48
  const zipOssUrl = await uploadOss(zipPath, zipName);
49
- const res = await toUploadThemeApp({
50
- extension_id: appId,
49
+ // 上传完成删除压缩包
50
+ fsExtra.removeSync(zipPath);
51
+ const res = await toUploadThemeApp(extensionId, {
51
52
  resource_url: zipOssUrl
52
53
  });
53
54
  const taskId = res.data?.task_id;
54
- // 轮询查看任务是否完成
55
- while (true) {
56
- const res = await getTaskStatus({ taskId });
57
- if (res.data?.task?.state === 1) {
58
- console.log(chalk.green(`[SUCCESS] Theme app pushed successfully.`));
59
- break;
60
- } else if (res.data?.task?.state === 2) {
61
- console.error(chalk.red(`[ERROR] Theme app push failed: ${res.data?.task?.error_message}`));
62
- break;
63
- } else {
64
- console.log(chalk.yellow(`[WAITING] Theme app push in progress...`));
65
- await new Promise((resolve) => setTimeout(resolve, 1000));
66
- }
55
+ if (!taskId) {
56
+ spinner.fail(chalk.red(`Failed to synchronize local files to remote location!`));
57
+ throw new Error('taskId is required');
67
58
  }
59
+ // 轮询查看任务是否完成
60
+ return new Promise((resolve, reject) => {
61
+ const timer = setInterval(async () => {
62
+ const res = await getTaskStatus({ taskId });
63
+ if (res.data?.state === 1) {
64
+ clearInterval(timer);
65
+ spinner.succeed(chalk.green(`Successfully synchronized local files to remote location!`));
66
+ resolve();
67
+ } else if (res.data?.state === 2) {
68
+ clearInterval(timer);
69
+ spinner.fail(chalk.red(`Failed to synchronize local files to remote location!`));
70
+ reject(new Error(res.data?.message));
71
+ } else {
72
+ spinner.text = chalk.blue(`[WAITING] Synchronizing local files to remote...`);
73
+ }
74
+ }, 1000);
75
+ });
68
76
  }
69
77
 
70
78
  /**
@@ -81,7 +89,8 @@ async function usePrompt() {
81
89
  choices: themeList.map((theme) => ({
82
90
  name: theme.name,
83
91
  value: theme.id
84
- }))
92
+ })),
93
+ loop: false
85
94
  }
86
95
  ]);
87
96
  return selectedThemeId;
@@ -90,26 +99,71 @@ async function usePrompt() {
90
99
  /**
91
100
  * 创建主题插件
92
101
  */
93
- async function createThemeApp(appName) {
94
- const res = await toCreateThemeApp({
95
- title: appName
102
+ async function createThemeApp(themeExtensionConfig) {
103
+ const data = {
104
+ title: themeExtensionConfig.extensionName || '' // 插件显示名称
105
+ };
106
+ if (themeExtensionConfig.extensionId) {
107
+ data.extension_id = themeExtensionConfig.extensionId;
108
+ }
109
+ const res = await toCreateThemeApp(data);
110
+ const extensionId = res.data?.extension_id;
111
+ await setThemeExtensionConfig({ extensionId });
112
+ return extensionId;
113
+ }
114
+
115
+ /**
116
+ * 启动监听
117
+ */
118
+ function startWatcher(extensionId) {
119
+ const ACTION_MAP = {
120
+ ADD: 'add',
121
+ CHANGE: 'change',
122
+ DELETE: 'delete'
123
+ };
124
+ const actionToApiMap = {
125
+ [ACTION_MAP.ADD]: toCreateFile,
126
+ [ACTION_MAP.CHANGE]: toUpdateFile,
127
+ [ACTION_MAP.DELETE]: toDeleteFile
128
+ };
129
+ const funcCache = {};
130
+ const handleFileChange = (action) => {
131
+ if (funcCache[action]) {
132
+ return funcCache[action];
133
+ }
134
+ const func = (filePath) => {
135
+ const { fileName, parentDirName } = getFileInfo(filePath);
136
+ const data = {
137
+ type: parentDirName,
138
+ location: fileName
139
+ };
140
+ if ([ACTION_MAP.CHANGE, ACTION_MAP.ADD].includes(action)) {
141
+ data.content = fsExtra.readFileSync(filePath, 'utf-8');
142
+ }
143
+ actionToApiMap[action](extensionId, data);
144
+ };
145
+ funcCache[action] = func;
146
+ return func;
147
+ };
148
+ watchWorkspace(THEME_APP_DIR_PATH, {
149
+ onAdd: handleFileChange(ACTION_MAP.ADD),
150
+ onChange: handleFileChange(ACTION_MAP.CHANGE),
151
+ onDelete: handleFileChange(ACTION_MAP.DELETE),
152
+ ignored: '**/assets-manifest.json',
96
153
  });
97
- const appId = res.data?.extension_id;
98
- // QQQ1
99
- await setThemeAppConfig({ appId });
100
- return appId;
101
154
  }
102
155
 
103
156
  async function serve() {
104
157
  try {
105
- let { appId, appName } = await getThemeAppConfig();
106
- // if (!appId) {
107
- // appId = createThemeApp(appName);
108
- // }
109
- // await syncLocalFiles(appId);
158
+ const themeExtensionConfig = await getThemeExtensionConfig();
159
+ let extensionId = themeExtensionConfig.extensionId;
160
+ if (!extensionId) {
161
+ extensionId = await createThemeApp(themeExtensionConfig);
162
+ }
163
+ await syncLocalFiles(extensionId);
110
164
  const selectedThemeId = await usePrompt();
111
- initWatcher(THEME_APP_PATH);
112
- consoleTips(selectedThemeId, appId);
165
+ startWatcher(extensionId);
166
+ consoleTips(selectedThemeId, extensionId);
113
167
  } catch (error) {
114
168
  console.error(chalk.red(`[ERROR IN SERVE] ${error.message}`));
115
169
  }
@@ -1,38 +1,49 @@
1
1
  const chalk = require('chalk');
2
- const ora = require('ora');
3
- const { getThemeAppConfig, renderTable } = require('../utils');
4
- const { getThemeAppVersionList } = require('../api/api');
2
+ const { getThemeExtensionConfig, renderTable } = require('../utils');
3
+ const { getThemeAppVersionList } = require('../api');
5
4
 
6
5
  /**
7
6
  * 控制台提示
8
7
  */
9
8
  function consoleTips(versionList) {
10
- console.log(chalk.green('\n📜 Available Versions:'));
11
- console.log(
12
- renderTable(versionList, [
13
- {
14
- label: 'Version',
15
- filed: 'version',
16
- color: 'yellowBright'
17
- },
18
- {
19
- label: 'Date',
20
- filed: 'date',
21
- color: 'blackBright'
22
- },
23
- {
24
- label: 'Description',
25
- filed: 'description',
26
- color: 'whiteBright'
27
- }
28
- ])
29
- );
9
+ if (versionList.length) {
10
+ const tempVersionList = versionList.map((item) => ({
11
+ ...item,
12
+ composeVersion: item.published === 1 ? `${item.version}(published)` : item.version
13
+ }));
14
+ console.log(chalk.green('\n📜 Available Versions:'));
15
+ console.log(
16
+ renderTable(tempVersionList, [
17
+ {
18
+ label: 'Version',
19
+ filed: 'composeVersion',
20
+ color: 'yellowBright'
21
+ },
22
+ {
23
+ label: 'CreateTime',
24
+ filed: 'created_at',
25
+ color: 'blackBright'
26
+ },
27
+ {
28
+ label: 'Description',
29
+ filed: 'exts',
30
+ color: 'whiteBright'
31
+ }
32
+ ])
33
+ );
34
+ } else {
35
+ console.log(chalk.green('Your current theme extension does not have an available version.'));
36
+ }
30
37
  }
31
38
 
32
39
  async function versions() {
33
40
  try {
34
- const { appId } = await getThemeAppConfig();
35
- const versionList = await getThemeAppVersionList({ appId });
41
+ const { extensionId } = await getThemeExtensionConfig();
42
+ if (!extensionId) {
43
+ throw new Error('ExtensionId is empty, please use `serve` command first.');
44
+ }
45
+ const res = await getThemeAppVersionList(extensionId);
46
+ const versionList = res.data?.data || [];
36
47
  consoleTips(versionList);
37
48
  } catch (error) {
38
49
  console.error(chalk.red(`[ERROR IN VERSIONS] ${error.message}`));
package/lib/app/index.js CHANGED
@@ -1,23 +1,27 @@
1
1
  function initThemeAppCommand(_program) {
2
- const program = _program.command('app').description('Shoplazza app CLI');
2
+ const program = _program.command('te').alias('theme_extension').description('Shoplazza theme extension CLI');
3
3
 
4
- program.command('create').description('Create a new theme app').action(require('./commands/create').create);
4
+ program.command('create').description('Create a new theme extension').action(require('./commands/create').create);
5
5
 
6
6
  program
7
7
  .command('serve')
8
- .description('Start a local development server for the theme app')
8
+ .description('Start a local development server for the theme extension')
9
9
  .action(require('./commands/serve').serve);
10
10
 
11
- program.command('build').description('Build the theme app for production').action(require('./commands/build').build);
11
+ program.command('build').description('Build the theme extension for production').action(require('./commands/build').build);
12
12
 
13
13
  program
14
14
  .command('versions')
15
- .description('List all versions of the theme app')
15
+ .description('List all versions of the theme extension')
16
16
  .action(require('./commands/versions').versions);
17
17
 
18
- program.command('deploy').description('Deploy the theme app').action(require('./commands/deploy').deploy);
18
+ program.command('deploy').description('Deploy the theme extension').action(require('./commands/deploy').deploy);
19
19
 
20
- program.command('list').description('List all theme apps').action(require('./commands/list').list);
20
+ program.command('list').description('List all theme extensions').action(require('./commands/list').list);
21
+
22
+ program.command('connect').description('Establish a connection between the theme extension and the shoplazza app').action(require('./commands/connect').connect);
23
+
24
+ program.command('release').description('Release a theme extension version to be applied in the shoplazza app').action(require('./commands/release').release);
21
25
  }
22
26
 
23
27
  module.exports = {
@@ -19,7 +19,7 @@ npm install -g shoplazza-cli
19
19
  创建主题插件项目模版
20
20
 
21
21
  ```bash
22
- shoplazza app create
22
+ shoplazza te create
23
23
  ```
24
24
 
25
25
  ---
@@ -37,7 +37,7 @@ npm start
37
37
  或者
38
38
 
39
39
  ```bash
40
- shoplazza app serve
40
+ shoplazza te serve
41
41
  ```
42
42
 
43
43
  ### `build`
@@ -51,7 +51,7 @@ npm run build
51
51
  或者
52
52
 
53
53
  ```bash
54
- shoplazza app build
54
+ shoplazza te build
55
55
  ```
56
56
 
57
57
  ### `deploy`
@@ -65,7 +65,7 @@ npm run deploy
65
65
  或者
66
66
 
67
67
  ```bash
68
- shoplazza app deploy
68
+ shoplazza te deploy
69
69
  ```
70
70
 
71
71
  ### `versions`
@@ -79,6 +79,20 @@ npm run versions
79
79
  或者
80
80
 
81
81
  ```bash
82
- shoplazza app versions
82
+ shoplazza te versions
83
+ ```
84
+
85
+ ### `list`
86
+
87
+ 查询店铺的私有主题插件列表
88
+
89
+ ```bash
90
+ npm run list
91
+ ```
92
+
93
+ 或者
94
+
95
+ ```bash
96
+ shoplazza te list
83
97
  ```
84
98
 
@@ -0,0 +1,4 @@
1
+ {
2
+ "extensionId": "",
3
+ "extensionName": "{{projectName}}"
4
+ }
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "{{projectName}}",
3
3
  "version": "1.0.0",
4
- "description": "theme basic app",
4
+ "description": "theme basic extension",
5
5
  "main": "null",
6
6
  "scripts": {
7
- "start": "shoplazza app serve",
8
- "build": "shoplazza app build",
9
- "deploy": "shoplazza app deploy",
10
- "versions": "shoplazza app versions"
7
+ "start": "shoplazza te serve",
8
+ "build": "shoplazza te build",
9
+ "deploy": "shoplazza te deploy",
10
+ "versions": "shoplazza te versions",
11
+ "list": "shoplazza te list"
11
12
  },
12
13
  "keywords": [],
13
14
  "author": "",
@@ -1,4 +1,4 @@
1
- /* css code */
2
1
  .container {
3
- color: red;
2
+ color: #da534d;
3
+ text-align: center;
4
4
  }
@@ -1,13 +1,15 @@
1
+ {% use "{{projectName}}.css" %}
2
+
1
3
  <div id="{{projectName}}" class="container">
2
- <p>Hello world</p>
4
+ <h1>{{ 'i18n.initial.title' | t }}</h1>
5
+ {% include "{{projectName}}" %}
3
6
  </div>
4
- {% include "{{projectName}}_snippet" %}
5
7
 
6
8
  {% schema %}
7
9
  {
8
10
  "name": {
9
- "en-US": "default name",
10
- "zh-CN": "默认名称"
11
+ "en-US": "{{projectName}}(dev)",
12
+ "zh-CN": "{{projectName}}(开发)"
11
13
  },
12
14
  "settings": []
13
15
  }
@@ -0,0 +1,6 @@
1
+ {
2
+ "initial":{
3
+ "title": "SHOPLAZZA THEME EXTENSION",
4
+ "sub_title": "BASIC TYPE"
5
+ }
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "initial": {
3
+ "title": "SHOPLAZZA 主题插件",
4
+ "sub_title": "BASIC 类型"
5
+ }
6
+ }
@@ -1,5 +1,5 @@
1
1
  <div>
2
- Shoplazza theme APP
2
+ <h3>{{ 'i18n.initial.sub_title' | t }}</h3>
3
3
  </div>
4
4
 
5
5
 
@@ -19,7 +19,7 @@ npm install -g shoplazza-cli
19
19
  创建主题插件项目模版
20
20
 
21
21
  ```bash
22
- shoplazza app create
22
+ shoplazza te create
23
23
  ```
24
24
 
25
25
  ---
@@ -37,7 +37,7 @@ npm start
37
37
  或者
38
38
 
39
39
  ```bash
40
- shoplazza app serve
40
+ shoplazza te serve
41
41
  ```
42
42
 
43
43
  ### `build`
@@ -51,12 +51,12 @@ npm run build
51
51
  或者
52
52
 
53
53
  ```bash
54
- shoplazza app build
54
+ shoplazza te build
55
55
  ```
56
56
 
57
57
  ### `deploy`
58
58
 
59
- 部署正式版本的主题插件(部署后插件在店铺的主题编辑器的app列表中可见)
59
+ 部署正式版本的主题插件
60
60
 
61
61
  ```bash
62
62
  npm run deploy
@@ -65,7 +65,7 @@ npm run deploy
65
65
  或者
66
66
 
67
67
  ```bash
68
- shoplazza app deploy
68
+ shoplazza te deploy
69
69
  ```
70
70
 
71
71
  ### `versions`
@@ -79,6 +79,19 @@ npm run versions
79
79
  或者
80
80
 
81
81
  ```bash
82
- shoplazza app versions
82
+ shoplazza te versions
83
83
  ```
84
84
 
85
+ ### `list`
86
+
87
+ 查询店铺的私有主题插件列表
88
+
89
+ ```bash
90
+ npm run list
91
+ ```
92
+
93
+ 或者
94
+
95
+ ```bash
96
+ shoplazza te list
97
+ ```
@@ -0,0 +1,4 @@
1
+ {
2
+ "extensionId": "",
3
+ "extensionTitle": "{{projectName}}"
4
+ }
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "{{projectName}}",
3
3
  "version": "1.0.0",
4
- "description": "theme embed app",
4
+ "description": "theme embed extension",
5
5
  "main": "null",
6
6
  "scripts": {
7
- "start": "shoplazza app serve",
8
- "build": "shoplazza app build",
9
- "deploy": "shoplazza app deploy",
10
- "versions": "shoplazza app versions"
7
+ "start": "shoplazza te serve",
8
+ "build": "shoplazza te build",
9
+ "deploy": "shoplazza te deploy",
10
+ "versions": "shoplazza te versions",
11
+ "list": "shoplazza te list"
11
12
  },
12
13
  "keywords": [],
13
14
  "author": "",
@@ -1,14 +1,17 @@
1
+ {% include "{{projectName}}_css" %}
2
+
1
3
  <div id="{{projectName}}" class="container">
2
- <p>Hello world</p>
4
+ <h1>{{ 'i18n.initial.title' | t }}</h1>
5
+ {% include "{{projectName}}" %}
3
6
  </div>
4
- {% include "{{projectName}}_snippet" %}
5
7
 
6
8
  {% schema %}
7
9
  {
8
10
  "name": {
9
- "en-US": "default name",
10
- "zh-CN": "默认名称"
11
+ "en-US": "{{projectName}}(dev)",
12
+ "zh-CN": "{{projectName}}(开发)"
11
13
  },
14
+ "icon":"https://assets.shoplazza.com/oss/operation/a425c6e10e32f87a1e7271c9ed9347d8.svg",
12
15
  "target":"body",
13
16
  "settings": []
14
17
  }
@@ -1,3 +1 @@
1
- {
2
- "general": {}
3
- }
1
+ {}
@@ -1,3 +1 @@
1
- {
2
- "general": {}
3
- }
1
+ {}
@@ -1,3 +1,6 @@
1
1
  {
2
- "general": {}
2
+ "initial":{
3
+ "title": "SHOPLAZZA THEME EXTENSION",
4
+ "sub_title": "EMBED TYPE"
5
+ }
3
6
  }
@@ -1,3 +1 @@
1
- {
2
- "general": {}
3
- }
1
+ {}
@@ -1,3 +1 @@
1
- {
2
- "general": {}
3
- }
1
+ {}
@@ -1,3 +1 @@
1
- {
2
- "general": {}
3
- }
1
+ {}