@adobe/create-ccweb-add-on 2.4.2 → 3.0.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/.mocharc.json +9 -2
- package/README.md +2 -2
- package/bin/run.js +3 -2
- package/dist/app/{AddOnManager.d.ts → AddOnPackageManager.d.ts} +4 -4
- package/dist/app/AddOnPackageManager.d.ts.map +1 -0
- package/dist/app/{AddOnManager.js → AddOnPackageManager.js} +5 -6
- package/dist/app/AddOnTemplateSelector.d.ts +3 -3
- package/dist/app/AddOnTemplateSelector.d.ts.map +1 -1
- package/dist/app/AddOnTemplateSelector.js +13 -13
- package/dist/app/WxpAddOnFactory.js +5 -5
- package/dist/app/index.d.ts +1 -1
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +1 -1
- package/dist/commands/create.d.ts +6 -10
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +11 -37
- package/dist/config/inversify.config.d.ts +2 -1
- package/dist/config/inversify.config.d.ts.map +1 -1
- package/dist/config/inversify.types.d.ts.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/models/CLIOptions.d.ts +4 -4
- package/dist/models/CLIOptions.d.ts.map +1 -1
- package/dist/models/CLIOptions.js +5 -5
- package/dist/templates/react-javascript/template/src/components/App.jsx +2 -2
- package/dist/templates/react-javascript/template/webpack.config.js +1 -0
- package/dist/templates/react-javascript/template.json +4 -4
- package/dist/templates/react-javascript-with-document-sandbox/template/src/ui/components/App.jsx +2 -2
- package/dist/templates/react-javascript-with-document-sandbox/template/webpack.config.js +1 -0
- package/dist/templates/react-javascript-with-document-sandbox/template.json +4 -4
- package/dist/templates/react-typescript/template/src/components/App.tsx +2 -2
- package/dist/templates/react-typescript/template/webpack.config.js +1 -0
- package/dist/templates/react-typescript/template.json +4 -4
- package/dist/templates/react-typescript-with-document-sandbox/template/src/ui/components/App.tsx +2 -2
- package/dist/templates/react-typescript-with-document-sandbox/template/webpack.config.js +1 -0
- package/dist/templates/react-typescript-with-document-sandbox/template.json +4 -4
- package/dist/templates/swc-javascript/template/src/components/App.js +2 -2
- package/dist/templates/swc-javascript/template/webpack.config.js +1 -0
- package/dist/templates/swc-javascript/template.json +4 -4
- package/dist/templates/swc-javascript-with-document-sandbox/template/src/ui/components/App.js +2 -2
- package/dist/templates/swc-javascript-with-document-sandbox/template/webpack.config.js +1 -0
- package/dist/templates/swc-javascript-with-document-sandbox/template.json +4 -4
- package/dist/templates/swc-typescript/template/src/components/App.css.ts +2 -2
- package/dist/templates/swc-typescript/template/src/components/App.ts +4 -4
- package/dist/templates/swc-typescript/template/src/index.ts +2 -2
- package/dist/templates/swc-typescript/template/webpack.config.js +1 -0
- package/dist/templates/swc-typescript/template.json +4 -4
- package/dist/templates/swc-typescript-with-document-sandbox/template/src/ui/components/App.css.ts +2 -2
- package/dist/templates/swc-typescript-with-document-sandbox/template/src/ui/components/App.ts +4 -4
- package/dist/templates/swc-typescript-with-document-sandbox/template/src/ui/index.ts +2 -2
- package/dist/templates/swc-typescript-with-document-sandbox/template/webpack.config.js +1 -0
- package/dist/templates/swc-typescript-with-document-sandbox/template.json +4 -4
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/validators/AddOnDirectoryValidator.js +2 -2
- package/dist/validators/NodeEnvironmentValidator.js +2 -2
- package/package.json +24 -18
- package/src/app/{AddOnManager.ts → AddOnPackageManager.ts} +4 -6
- package/src/app/AddOnTemplateSelector.ts +13 -13
- package/src/app/WxpAddOnFactory.ts +5 -5
- package/src/app/index.ts +1 -1
- package/src/commands/create.ts +24 -48
- package/src/config/inversify.config.ts +2 -1
- package/src/config/inversify.types.ts +7 -1
- package/src/constants.ts +2 -2
- package/src/index.ts +25 -0
- package/src/models/CLIOptions.ts +5 -5
- package/src/test/app/{AddOnManager.spec.ts → AddOnPackageManager.spec.ts} +8 -5
- package/src/test/app/AddOnTemplateSelector.spec.ts +30 -12
- package/src/test/app/WxpAddOnFactory.spec.ts +11 -11
- package/src/test/commands/command.spec.ts +80 -0
- package/src/test/commands/create.spec.ts +42 -16
- package/src/test/models/CLIOptions.spec.ts +3 -3
- package/src/test/validators/AddOnDirectoryValidator.spec.ts +24 -15
- package/src/test/validators/NodeEnvironmentValidator.spec.ts +5 -5
- package/src/validators/AddOnDirectoryValidator.ts +2 -2
- package/src/validators/NodeEnvironmentValidator.ts +2 -2
- package/templates/react-javascript/template/src/components/App.jsx +2 -2
- package/templates/react-javascript/template/webpack.config.js +1 -0
- package/templates/react-javascript/template.json +4 -4
- package/templates/react-javascript-with-document-sandbox/template/src/ui/components/App.jsx +2 -2
- package/templates/react-javascript-with-document-sandbox/template/webpack.config.js +1 -0
- package/templates/react-javascript-with-document-sandbox/template.json +4 -4
- package/templates/react-typescript/template/src/components/App.tsx +2 -2
- package/templates/react-typescript/template/webpack.config.js +1 -0
- package/templates/react-typescript/template.json +4 -4
- package/templates/react-typescript-with-document-sandbox/template/src/ui/components/App.tsx +2 -2
- package/templates/react-typescript-with-document-sandbox/template/webpack.config.js +1 -0
- package/templates/react-typescript-with-document-sandbox/template.json +4 -4
- package/templates/swc-javascript/template/src/components/App.js +2 -2
- package/templates/swc-javascript/template/webpack.config.js +1 -0
- package/templates/swc-javascript/template.json +4 -4
- package/templates/swc-javascript-with-document-sandbox/template/src/ui/components/App.js +2 -2
- package/templates/swc-javascript-with-document-sandbox/template/webpack.config.js +1 -0
- package/templates/swc-javascript-with-document-sandbox/template.json +4 -4
- package/templates/swc-typescript/template/src/components/App.css.ts +2 -2
- package/templates/swc-typescript/template/src/components/App.ts +4 -4
- package/templates/swc-typescript/template/src/index.ts +2 -2
- package/templates/swc-typescript/template/webpack.config.js +1 -0
- package/templates/swc-typescript/template.json +4 -4
- package/templates/swc-typescript-with-document-sandbox/template/src/ui/components/App.css.ts +2 -2
- package/templates/swc-typescript-with-document-sandbox/template/src/ui/components/App.ts +4 -4
- package/templates/swc-typescript-with-document-sandbox/template/src/ui/index.ts +2 -2
- package/templates/swc-typescript-with-document-sandbox/template/webpack.config.js +1 -0
- package/templates/swc-typescript-with-document-sandbox/template.json +4 -4
- package/tsconfig.json +3 -1
- package/dist/app/AddOnManager.d.ts.map +0 -1
package/.mocharc.json
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extension": ["ts"],
|
|
3
|
-
"node-option": [
|
|
4
|
-
|
|
3
|
+
"node-option": [
|
|
4
|
+
"experimental-specifier-resolution=node",
|
|
5
|
+
"loader=ts-node/esm",
|
|
6
|
+
"enable-source-maps",
|
|
7
|
+
"no-warnings"
|
|
8
|
+
],
|
|
9
|
+
"spec": ["src/test/**/*.spec.ts"],
|
|
10
|
+
"recursive": true,
|
|
11
|
+
"timeout": 60000
|
|
5
12
|
}
|
package/README.md
CHANGED
|
@@ -27,8 +27,8 @@ To quickly get started building an Adobe Express add-on, follow these steps, or
|
|
|
27
27
|
|
|
28
28
|
You'll need:
|
|
29
29
|
|
|
30
|
-
- Node
|
|
31
|
-
- NPM
|
|
30
|
+
- Node 18 or better
|
|
31
|
+
- NPM 10 or better
|
|
32
32
|
- A text editor
|
|
33
33
|
- A free Adobe account — don't have one? Get one [here](https://www.adobe.com/express/)
|
|
34
34
|
|
package/bin/run.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import oclif from "@oclif/core";
|
|
4
|
+
import url from "url";
|
|
4
5
|
|
|
5
|
-
oclif
|
|
6
|
-
.
|
|
6
|
+
await oclif
|
|
7
|
+
.execute({ dir: url.fileURLToPath(import.meta.url) })
|
|
7
8
|
.then(oclif.flush)
|
|
8
9
|
.catch(oclif.Errors.handle);
|
|
@@ -26,13 +26,13 @@ import type { EntrypointType } from "@adobe/ccweb-add-on-manifest";
|
|
|
26
26
|
/**
|
|
27
27
|
* Class to manage the Add-on project requirements.
|
|
28
28
|
*/
|
|
29
|
-
export declare class
|
|
29
|
+
export declare class AddOnPackageManager {
|
|
30
30
|
/**
|
|
31
31
|
* Get package.json for the Add-on project.
|
|
32
|
-
* @param
|
|
32
|
+
* @param entrypointType - Entrypoint type of Add-on. For example: panel, command, etc.
|
|
33
33
|
* @param addOnName - Name of Add-on.
|
|
34
34
|
* @returns package.json as {@link PackageJson}.
|
|
35
35
|
*/
|
|
36
|
-
static getPackageJson(
|
|
36
|
+
static getPackageJson(entrypointType: EntrypointType, addOnName: string): PackageJson;
|
|
37
37
|
}
|
|
38
|
-
//# sourceMappingURL=
|
|
38
|
+
//# sourceMappingURL=AddOnPackageManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AddOnPackageManager.d.ts","sourceRoot":"","sources":["../../src/app/AddOnPackageManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,qBAAa,mBAAmB;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,WAAW;CAaxF"}
|
|
@@ -25,20 +25,19 @@ import { PackageJson } from "@adobe/ccweb-add-on-core";
|
|
|
25
25
|
/**
|
|
26
26
|
* Class to manage the Add-on project requirements.
|
|
27
27
|
*/
|
|
28
|
-
export class
|
|
28
|
+
export class AddOnPackageManager {
|
|
29
29
|
/**
|
|
30
30
|
* Get package.json for the Add-on project.
|
|
31
|
-
* @param
|
|
31
|
+
* @param entrypointType - Entrypoint type of Add-on. For example: panel, command, etc.
|
|
32
32
|
* @param addOnName - Name of Add-on.
|
|
33
33
|
* @returns package.json as {@link PackageJson}.
|
|
34
34
|
*/
|
|
35
|
-
|
|
36
|
-
static getPackageJson(addOnKind, addOnName) {
|
|
35
|
+
static getPackageJson(entrypointType, addOnName) {
|
|
37
36
|
return new PackageJson({
|
|
38
37
|
name: addOnName,
|
|
39
38
|
version: "1.0.0",
|
|
40
39
|
description: "Adobe Creative Cloud Web Add-on.",
|
|
41
|
-
keywords: ["Adobe", "Creative Cloud Web", "Add-on",
|
|
40
|
+
keywords: ["Adobe", "Creative Cloud Web", "Add-on", entrypointType],
|
|
42
41
|
scripts: {
|
|
43
42
|
clean: "ccweb-add-on-scripts clean",
|
|
44
43
|
build: "ccweb-add-on-scripts build",
|
|
@@ -47,4 +46,4 @@ export class AddOnManager {
|
|
|
47
46
|
});
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
//# sourceMappingURL=
|
|
49
|
+
//# sourceMappingURL=AddOnPackageManager.js.map
|
|
@@ -46,9 +46,9 @@ export declare class AddOnTemplateSelector implements TemplateSelector {
|
|
|
46
46
|
private _promptMessage;
|
|
47
47
|
private _promptMessageOption;
|
|
48
48
|
/**
|
|
49
|
-
* Validate whether
|
|
50
|
-
* @param
|
|
49
|
+
* Validate whether entrypointType is valid or not.
|
|
50
|
+
* @param entrypointType - Add-on entrypoint. For example: panel.
|
|
51
51
|
*/
|
|
52
|
-
private
|
|
52
|
+
private _validateAddOnEntrypoint;
|
|
53
53
|
}
|
|
54
54
|
//# sourceMappingURL=AddOnTemplateSelector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddOnTemplateSelector.d.ts","sourceRoot":"","sources":["../../src/app/AddOnTemplateSelector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAMvD,OAAO,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,qBACa,qBAAsB,YAAW,gBAAgB;IAC1D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD;;;;;OAKG;gBAE4B,MAAM,EAAE,MAAM,EACC,gBAAgB,EAAE,gBAAgB;IAMhF;;;;;OAKG;IACG,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAsEzD,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,oBAAoB;IAO5B;;;OAGG;YACW,
|
|
1
|
+
{"version":3,"file":"AddOnTemplateSelector.d.ts","sourceRoot":"","sources":["../../src/app/AddOnTemplateSelector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAMvD,OAAO,kBAAkB,CAAC;AAI1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,qBACa,qBAAsB,YAAW,gBAAgB;IAC1D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAmB;IAErD;;;;;OAKG;gBAE4B,MAAM,EAAE,MAAM,EACC,gBAAgB,EAAE,gBAAgB;IAMhF;;;;;OAKG;IACG,aAAa,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAsEzD,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,oBAAoB;IAO5B;;;OAGG;YACW,wBAAwB;CA6BzC"}
|
|
@@ -52,7 +52,7 @@ let AddOnTemplateSelector = class AddOnTemplateSelector {
|
|
|
52
52
|
* @returns User selected/provided template name.
|
|
53
53
|
*/
|
|
54
54
|
async setupTemplate(options) {
|
|
55
|
-
await this.
|
|
55
|
+
await this._validateAddOnEntrypoint(options.entrypointType);
|
|
56
56
|
if (!isNullOrWhiteSpace(options.templateName)) {
|
|
57
57
|
if (AVAILABLE_ADD_ON_TEMPLATES.includes(options.templateName)) {
|
|
58
58
|
return options.templateName;
|
|
@@ -122,24 +122,24 @@ let AddOnTemplateSelector = class AddOnTemplateSelector {
|
|
|
122
122
|
return chalk.green.bold(option);
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
|
-
* Validate whether
|
|
126
|
-
* @param
|
|
125
|
+
* Validate whether entrypointType is valid or not.
|
|
126
|
+
* @param entrypointType - Add-on entrypoint. For example: panel.
|
|
127
127
|
*/
|
|
128
|
-
async
|
|
129
|
-
if (
|
|
130
|
-
this._logger.warning(LOGS.
|
|
131
|
-
this._logger.warning(format(LOGS.
|
|
128
|
+
async _validateAddOnEntrypoint(entrypointType) {
|
|
129
|
+
if (entrypointType !== EntrypointType.PANEL) {
|
|
130
|
+
this._logger.warning(LOGS.chooseValidEntrypointType);
|
|
131
|
+
this._logger.warning(format(LOGS.executeProgramWithValidEntrypointType, {
|
|
132
132
|
PROGRAM_NAME
|
|
133
133
|
}), {
|
|
134
134
|
prefix: LOGS.tab
|
|
135
135
|
});
|
|
136
136
|
this._logger.message(LOGS.forExample, { prefix: LOGS.newLine });
|
|
137
|
-
this._logger.information(format(LOGS.
|
|
137
|
+
this._logger.information(format(LOGS.executeProgramWithValidEntrypointTypeExample, {
|
|
138
138
|
PROGRAM_NAME
|
|
139
139
|
}), {
|
|
140
140
|
prefix: LOGS.tab
|
|
141
141
|
});
|
|
142
|
-
await this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_INVALID_KIND, LOGS.
|
|
142
|
+
await this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_INVALID_KIND, LOGS.analyticsInvalidEntrypointType, false);
|
|
143
143
|
return process.exit(0);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
@@ -155,12 +155,12 @@ const LOGS = {
|
|
|
155
155
|
newLine: "\n",
|
|
156
156
|
tab: " ",
|
|
157
157
|
setupTemplate: "Please select a template which you want to scaffold the Add-on project with",
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
chooseValidEntrypointType: "Please choose a valid Add-on entrypoint (valid entrypoint: panel)",
|
|
159
|
+
executeProgramWithValidEntrypointType: "{PROGRAM_NAME} <add-on-name> --entrypoint <panel>",
|
|
160
|
+
executeProgramWithValidEntrypointTypeExample: "{PROGRAM_NAME} my-add-on --entrypoint panel",
|
|
161
161
|
chooseValidTemplate: "You have chosen an invalid template.",
|
|
162
162
|
forExample: "For example:",
|
|
163
|
-
|
|
163
|
+
analyticsInvalidEntrypointType: "Invalid Add-on entrypoint specified",
|
|
164
164
|
includeDocumentSandbox: "Do you want to include document sandbox runtime?",
|
|
165
165
|
yes: "Yes",
|
|
166
166
|
no: "No"
|
|
@@ -36,7 +36,7 @@ import url from "url";
|
|
|
36
36
|
import { AnalyticsErrorMarkers, AnalyticsSuccessMarkers } from "../AnalyticsMarkers.js";
|
|
37
37
|
import { ITypes } from "../config/inversify.types.js";
|
|
38
38
|
import { TEMP_TEMPLATE_PATH } from "../constants.js";
|
|
39
|
-
import {
|
|
39
|
+
import { AddOnPackageManager } from "./AddOnPackageManager.js";
|
|
40
40
|
/**
|
|
41
41
|
* AddOn factory implementation class.
|
|
42
42
|
*/
|
|
@@ -84,7 +84,7 @@ let WxpAddOnFactory = class WxpAddOnFactory {
|
|
|
84
84
|
this._logger.information(LOGS.creatingWxpAddOn);
|
|
85
85
|
this._logger.message(LOGS.mayTakeAMinute);
|
|
86
86
|
const templateName = await this._templateSelector.setupTemplate(options);
|
|
87
|
-
const packageJson =
|
|
87
|
+
const packageJson = AddOnPackageManager.getPackageJson(options.entrypointType, options.addOnName);
|
|
88
88
|
const packageJsonPath = path.join(addOnDirectory, PACKAGE_JSON);
|
|
89
89
|
fs.writeFileSync(packageJsonPath, packageJson.toJSON() + os.EOL);
|
|
90
90
|
this._copyTemplateFiles(addOnDirectory, templateName);
|
|
@@ -101,7 +101,7 @@ let WxpAddOnFactory = class WxpAddOnFactory {
|
|
|
101
101
|
}
|
|
102
102
|
this._logger.information(LOGS.installingDevDependencies, { prefix: LOGS.newLine });
|
|
103
103
|
await this._process.execute("npm", devDependencyArgs, { stdio: "inherit" });
|
|
104
|
-
const scaffolderOptions = new ScaffolderOptions(addOnDirectory, options.addOnName, options.
|
|
104
|
+
const scaffolderOptions = new ScaffolderOptions(addOnDirectory, options.addOnName, options.entrypointType, rootDirectory, templateName, options.verbose);
|
|
105
105
|
this._logger.information(format(LOGS.scaffoldingProjectFromTemplate, { templateName }), {
|
|
106
106
|
prefix: LOGS.newLine
|
|
107
107
|
});
|
|
@@ -109,8 +109,8 @@ let WxpAddOnFactory = class WxpAddOnFactory {
|
|
|
109
109
|
const analyticsEventData = [
|
|
110
110
|
"--addOnName",
|
|
111
111
|
options.addOnName,
|
|
112
|
-
"--
|
|
113
|
-
options.
|
|
112
|
+
"--entrypointType",
|
|
113
|
+
options.entrypointType,
|
|
114
114
|
"--template",
|
|
115
115
|
templateName
|
|
116
116
|
];
|
package/dist/app/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
export * from "./AddOnFactory.js";
|
|
25
|
-
export * from "./
|
|
25
|
+
export * from "./AddOnPackageManager.js";
|
|
26
26
|
export * from "./AddOnTemplateSelector.js";
|
|
27
27
|
export * from "./TemplateSelector.js";
|
|
28
28
|
export * from "./WxpAddOnFactory.js";
|
package/dist/app/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,cAAc,mBAAmB,CAAC;AAClC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
package/dist/app/index.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
export * from "./AddOnFactory.js";
|
|
25
|
-
export * from "./
|
|
25
|
+
export * from "./AddOnPackageManager.js";
|
|
26
26
|
export * from "./AddOnTemplateSelector.js";
|
|
27
27
|
export * from "./TemplateSelector.js";
|
|
28
28
|
export * from "./WxpAddOnFactory.js";
|
|
@@ -21,32 +21,28 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
+
import { BaseCommand } from "@adobe/ccweb-add-on-analytics";
|
|
24
25
|
import type { Config } from "@oclif/core";
|
|
25
|
-
import {
|
|
26
|
+
import { Arg, CustomOptions, OptionFlag } from "@oclif/core/lib/interfaces/parser.js";
|
|
26
27
|
import "reflect-metadata";
|
|
27
28
|
/**
|
|
28
29
|
* Implementation class of the create-ccweb-add-on command.
|
|
29
30
|
*/
|
|
30
|
-
export declare class
|
|
31
|
-
private readonly _analyticsConsent;
|
|
32
|
-
private readonly _analyticsService;
|
|
31
|
+
export declare class Create extends BaseCommand {
|
|
33
32
|
private readonly _addOnFactory;
|
|
34
33
|
static description: string;
|
|
35
34
|
static examples: string[];
|
|
36
35
|
static flags: {
|
|
37
|
-
|
|
38
|
-
template:
|
|
39
|
-
analytics: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
|
|
40
|
-
verbose: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
|
|
36
|
+
entrypoint: OptionFlag<string, CustomOptions>;
|
|
37
|
+
template: OptionFlag<string, CustomOptions>;
|
|
41
38
|
};
|
|
42
39
|
static args: {
|
|
43
|
-
|
|
40
|
+
name: Arg<string, Record<string, unknown>>;
|
|
44
41
|
};
|
|
45
42
|
constructor(argv: string[], config: Config);
|
|
46
43
|
run(): Promise<void>;
|
|
47
44
|
catch(error: {
|
|
48
45
|
message: string;
|
|
49
46
|
}): Promise<void>;
|
|
50
|
-
private _seekAnalyticsConsent;
|
|
51
47
|
}
|
|
52
48
|
//# sourceMappingURL=create.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/commands/create.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,EAAE,WAAW,EAAc,MAAM,+BAA+B,CAAC;AAGxE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,kBAAkB,CAAC;AAO1B;;GAEG;AACH,qBAAa,MAAO,SAAQ,WAAW;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAE7C,MAAM,CAAC,WAAW,SAAgD;IAElE,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAiE;IAE1F,MAAM,CAAC,KAAK,EAAE;QACV,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC9C,QAAQ,EAAE,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;KAC/C,CAcC;IAEF,MAAM,CAAC,IAAI,EAAE;QACT,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAC9C,CAMC;gBAEU,IAAI,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM;IAMpC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAsBpB,KAAK,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAIzD"}
|
package/dist/commands/create.js
CHANGED
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
|
-
import {
|
|
24
|
+
import { BaseCommand, CLIProgram } from "@adobe/ccweb-add-on-analytics";
|
|
25
25
|
import { UncaughtExceptionHandler } from "@adobe/ccweb-add-on-core";
|
|
26
26
|
import { EntrypointType } from "@adobe/ccweb-add-on-manifest";
|
|
27
|
-
import { Args,
|
|
27
|
+
import { Args, Flags } from "@oclif/core";
|
|
28
28
|
import "reflect-metadata";
|
|
29
29
|
import { AnalyticsErrorMarkers } from "../AnalyticsMarkers.js";
|
|
30
30
|
import { IContainer, ITypes } from "../config/index.js";
|
|
@@ -33,16 +33,14 @@ import { CLIOptions } from "../models/CLIOptions.js";
|
|
|
33
33
|
/**
|
|
34
34
|
* Implementation class of the create-ccweb-add-on command.
|
|
35
35
|
*/
|
|
36
|
-
export class
|
|
37
|
-
_analyticsConsent;
|
|
38
|
-
_analyticsService;
|
|
36
|
+
export class Create extends BaseCommand {
|
|
39
37
|
_addOnFactory;
|
|
40
38
|
static description = "Create an Adobe Creative Cloud Web Add-on.";
|
|
41
39
|
static examples = ["create-ccweb-add-on <add-on-name> --template <javascript>"];
|
|
42
40
|
static flags = {
|
|
43
|
-
|
|
44
|
-
char: "
|
|
45
|
-
description: "
|
|
41
|
+
entrypoint: Flags.string({
|
|
42
|
+
char: "e",
|
|
43
|
+
description: "Entrypoint type of Add-on (By default it is set as 'panel').",
|
|
46
44
|
default: EntrypointType.PANEL,
|
|
47
45
|
required: false,
|
|
48
46
|
hidden: true
|
|
@@ -52,54 +50,30 @@ export class CreateCCWebAddOn extends Command {
|
|
|
52
50
|
description: "Template to use for creating the Add-on project.",
|
|
53
51
|
default: "",
|
|
54
52
|
required: false
|
|
55
|
-
}),
|
|
56
|
-
analytics: Flags.string({
|
|
57
|
-
char: "a",
|
|
58
|
-
description: "Turn on/off sending analytics to Adobe.",
|
|
59
|
-
options: ["on", "off"],
|
|
60
|
-
required: false
|
|
61
|
-
}),
|
|
62
|
-
verbose: Flags.boolean({
|
|
63
|
-
char: "v",
|
|
64
|
-
description: "Enable verbose logging.",
|
|
65
|
-
default: false,
|
|
66
|
-
required: false
|
|
67
53
|
})
|
|
68
54
|
};
|
|
69
55
|
static args = {
|
|
70
|
-
|
|
71
|
-
name: "
|
|
56
|
+
name: Args.string({
|
|
57
|
+
name: "name",
|
|
72
58
|
description: "Name of the Add-on project.",
|
|
73
59
|
required: true
|
|
74
60
|
})
|
|
75
61
|
};
|
|
76
62
|
constructor(argv, config) {
|
|
77
|
-
super(argv, config);
|
|
78
|
-
this._analyticsConsent = IContainer.get(IAnalyticsTypes.AnalyticsConsent);
|
|
79
|
-
this._analyticsService = IContainer.get(IAnalyticsTypes.AnalyticsService);
|
|
80
|
-
this._analyticsService.program = new CLIProgram(PROGRAM_NAME, this.config.name + "@" + this.config.version);
|
|
81
|
-
this._analyticsService.startTime = Date.now();
|
|
63
|
+
super(argv, config, new CLIProgram(PROGRAM_NAME, config.name + "@" + config.version));
|
|
82
64
|
this._addOnFactory = IContainer.get(ITypes.AddOnFactory);
|
|
83
65
|
}
|
|
84
66
|
async run() {
|
|
85
67
|
UncaughtExceptionHandler.registerExceptionHandler(PROGRAM_NAME);
|
|
86
|
-
const { args: {
|
|
68
|
+
const { args: { name }, flags: { entrypoint, template, analytics, verbose } } = await this.parse(Create);
|
|
87
69
|
await this._seekAnalyticsConsent(analytics);
|
|
88
70
|
console.log();
|
|
89
|
-
const options = new CLIOptions(
|
|
71
|
+
const options = new CLIOptions(entrypoint.toLowerCase(), name, template.toLowerCase(), verbose);
|
|
90
72
|
await this._addOnFactory.create(options);
|
|
91
73
|
}
|
|
92
74
|
async catch(error) {
|
|
93
75
|
await this._analyticsService.postEvent(AnalyticsErrorMarkers.ERROR_INVALID_ARGS, error.message, false);
|
|
94
76
|
throw error;
|
|
95
77
|
}
|
|
96
|
-
async _seekAnalyticsConsent(analytics) {
|
|
97
|
-
if (analytics === undefined) {
|
|
98
|
-
await this._analyticsConsent.get();
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
await this._analyticsConsent.set(analytics === "on");
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
78
|
}
|
|
105
79
|
//# sourceMappingURL=create.js.map
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
********************************************************************************/
|
|
24
24
|
import "reflect-metadata";
|
|
25
|
-
|
|
25
|
+
import { Container } from "inversify";
|
|
26
|
+
declare const container: Container;
|
|
26
27
|
export { container as IContainer };
|
|
27
28
|
//# sourceMappingURL=inversify.config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inversify.config.d.ts","sourceRoot":"","sources":["../../src/config/inversify.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAGlF,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"inversify.config.d.ts","sourceRoot":"","sources":["../../src/config/inversify.config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAGlF,OAAO,kBAAkB,CAAC;AAM1B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,QAAA,MAAM,SAAS,EAAE,SAA0B,CAAC;AAU5C,OAAO,EAAE,SAAS,IAAI,UAAU,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inversify.types.d.ts","sourceRoot":"","sources":["../../src/config/inversify.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,eAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"inversify.types.d.ts","sourceRoot":"","sources":["../../src/config/inversify.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,eAAO,MAAM,MAAM,EAAE;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;CAO5B,CAAC"}
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,eAAO,MAAM,YAAY,wBAAwB,CAAC;AAElD,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,eAAO,MAAM,YAAY,wBAAwB,CAAC;AAElD,eAAO,MAAM,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAM/C,CAAC;AAEH,eAAO,MAAM,kBAAkB,cAAc,CAAC;AAE9C,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAE7D,eAAO,MAAM,0BAA0B,EAAE,MAAM,EAW9C,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* MIT License
|
|
3
|
+
|
|
4
|
+
* © Copyright 2025 Adobe. All rights reserved.
|
|
5
|
+
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
********************************************************************************/
|
|
24
|
+
export { run } from "@oclif/core";
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* MIT License
|
|
3
|
+
|
|
4
|
+
* © Copyright 2025 Adobe. All rights reserved.
|
|
5
|
+
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
********************************************************************************/
|
|
24
|
+
export { run } from "@oclif/core";
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -27,9 +27,9 @@ import type { EntrypointType } from "@adobe/ccweb-add-on-manifest";
|
|
|
27
27
|
*/
|
|
28
28
|
export declare class CLIOptions {
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Entrypoint type of the Add-on. Example: 'panel'.
|
|
31
31
|
*/
|
|
32
|
-
readonly
|
|
32
|
+
readonly entrypointType: EntrypointType;
|
|
33
33
|
/**
|
|
34
34
|
* Name of the Add-on.
|
|
35
35
|
*/
|
|
@@ -44,12 +44,12 @@ export declare class CLIOptions {
|
|
|
44
44
|
readonly verbose: boolean;
|
|
45
45
|
/**
|
|
46
46
|
* Instantiate {@link CLIOptions}.
|
|
47
|
-
* @param
|
|
47
|
+
* @param entrypointType - Kind of the Add-on. For example: panel.
|
|
48
48
|
* @param addOnName - Name of the Add-on.
|
|
49
49
|
* @param templateName - Template name.
|
|
50
50
|
* @param verbose - Verbose flag.
|
|
51
51
|
* @returns Reference to a new {@link CLIOptions} instance.
|
|
52
52
|
*/
|
|
53
|
-
constructor(
|
|
53
|
+
constructor(entrypointType: EntrypointType, addOnName: string, templateName: string, verbose: boolean);
|
|
54
54
|
}
|
|
55
55
|
//# sourceMappingURL=CLIOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CLIOptions.d.ts","sourceRoot":"","sources":["../../src/models/CLIOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,qBAAa,UAAU;IACnB;;OAEG;IACH,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"CLIOptions.d.ts","sourceRoot":"","sources":["../../src/models/CLIOptions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;kFAsBkF;AAElF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,qBAAa,UAAU;IACnB;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;;;;;;OAOG;gBACS,cAAc,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO;CAMxG"}
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
*/
|
|
27
27
|
export class CLIOptions {
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Entrypoint type of the Add-on. Example: 'panel'.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
entrypointType;
|
|
32
32
|
/**
|
|
33
33
|
* Name of the Add-on.
|
|
34
34
|
*/
|
|
@@ -43,14 +43,14 @@ export class CLIOptions {
|
|
|
43
43
|
verbose;
|
|
44
44
|
/**
|
|
45
45
|
* Instantiate {@link CLIOptions}.
|
|
46
|
-
* @param
|
|
46
|
+
* @param entrypointType - Kind of the Add-on. For example: panel.
|
|
47
47
|
* @param addOnName - Name of the Add-on.
|
|
48
48
|
* @param templateName - Template name.
|
|
49
49
|
* @param verbose - Verbose flag.
|
|
50
50
|
* @returns Reference to a new {@link CLIOptions} instance.
|
|
51
51
|
*/
|
|
52
|
-
constructor(
|
|
53
|
-
this.
|
|
52
|
+
constructor(entrypointType, addOnName, templateName, verbose) {
|
|
53
|
+
this.entrypointType = entrypointType;
|
|
54
54
|
this.addOnName = addOnName;
|
|
55
55
|
this.templateName = templateName;
|
|
56
56
|
this.verbose = verbose;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// To support:
|
|
1
|
+
// To support: system="express" scale="medium" color="light"
|
|
2
2
|
// import these spectrum web components modules:
|
|
3
3
|
import "@spectrum-web-components/theme/express/scale-medium.js";
|
|
4
4
|
import "@spectrum-web-components/theme/express/theme-light.js";
|
|
@@ -20,7 +20,7 @@ const App = ({ addOnUISdk }) => {
|
|
|
20
20
|
return (
|
|
21
21
|
// Please note that the below "<Theme>" component does not react to theme changes in Express.
|
|
22
22
|
// You may use "addOnUISdk.app.ui.theme" to get the current theme and react accordingly.
|
|
23
|
-
<Theme
|
|
23
|
+
<Theme system="express" scale="medium" color="light">
|
|
24
24
|
<div className="container">
|
|
25
25
|
<Button size="m" onClick={handleClick}>
|
|
26
26
|
{buttonLabel}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"package": "ccweb-add-on-scripts package --use webpack"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@swc-react/button": "0.
|
|
10
|
-
"@swc-react/theme": "0.
|
|
9
|
+
"@swc-react/button": "1.0.3",
|
|
10
|
+
"@swc-react/theme": "1.0.3",
|
|
11
11
|
"react-dom": "18.2.0",
|
|
12
12
|
"react": "18.2.0"
|
|
13
13
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"css-loader": "6.8.1",
|
|
21
21
|
"html-webpack-plugin": "5.5.3",
|
|
22
22
|
"style-loader": "3.3.3",
|
|
23
|
-
"webpack-cli": "
|
|
24
|
-
"webpack": "5.
|
|
23
|
+
"webpack-cli": "6.0.1",
|
|
24
|
+
"webpack": "5.98.0"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/dist/templates/react-javascript-with-document-sandbox/template/src/ui/components/App.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// To support:
|
|
1
|
+
// To support: system="express" scale="medium" color="light"
|
|
2
2
|
// import these spectrum web components modules:
|
|
3
3
|
import "@spectrum-web-components/theme/express/scale-medium.js";
|
|
4
4
|
import "@spectrum-web-components/theme/express/theme-light.js";
|
|
@@ -18,7 +18,7 @@ const App = ({ addOnUISdk, sandboxProxy }) => {
|
|
|
18
18
|
return (
|
|
19
19
|
// Please note that the below "<Theme>" component does not react to theme changes in Express.
|
|
20
20
|
// You may use "addOnUISdk.app.ui.theme" to get the current theme and react accordingly.
|
|
21
|
-
<Theme
|
|
21
|
+
<Theme system="express" scale="medium" color="light">
|
|
22
22
|
<div className="container">
|
|
23
23
|
<Button size="m" onClick={handleClick}>
|
|
24
24
|
Create Rectangle
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"package": "ccweb-add-on-scripts package --use webpack"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@swc-react/button": "0.
|
|
10
|
-
"@swc-react/theme": "0.
|
|
9
|
+
"@swc-react/button": "1.0.3",
|
|
10
|
+
"@swc-react/theme": "1.0.3",
|
|
11
11
|
"react-dom": "18.2.0",
|
|
12
12
|
"react": "18.2.0"
|
|
13
13
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"css-loader": "6.8.1",
|
|
21
21
|
"html-webpack-plugin": "5.5.3",
|
|
22
22
|
"style-loader": "3.3.3",
|
|
23
|
-
"webpack-cli": "
|
|
24
|
-
"webpack": "5.
|
|
23
|
+
"webpack-cli": "6.0.1",
|
|
24
|
+
"webpack": "5.98.0"
|
|
25
25
|
}
|
|
26
26
|
}
|