@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.
Files changed (108) hide show
  1. package/.mocharc.json +9 -2
  2. package/README.md +2 -2
  3. package/bin/run.js +3 -2
  4. package/dist/app/{AddOnManager.d.ts → AddOnPackageManager.d.ts} +4 -4
  5. package/dist/app/AddOnPackageManager.d.ts.map +1 -0
  6. package/dist/app/{AddOnManager.js → AddOnPackageManager.js} +5 -6
  7. package/dist/app/AddOnTemplateSelector.d.ts +3 -3
  8. package/dist/app/AddOnTemplateSelector.d.ts.map +1 -1
  9. package/dist/app/AddOnTemplateSelector.js +13 -13
  10. package/dist/app/WxpAddOnFactory.js +5 -5
  11. package/dist/app/index.d.ts +1 -1
  12. package/dist/app/index.d.ts.map +1 -1
  13. package/dist/app/index.js +1 -1
  14. package/dist/commands/create.d.ts +6 -10
  15. package/dist/commands/create.d.ts.map +1 -1
  16. package/dist/commands/create.js +11 -37
  17. package/dist/config/inversify.config.d.ts +2 -1
  18. package/dist/config/inversify.config.d.ts.map +1 -1
  19. package/dist/config/inversify.types.d.ts.map +1 -1
  20. package/dist/constants.d.ts.map +1 -1
  21. package/dist/index.d.ts +25 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +25 -0
  24. package/dist/models/CLIOptions.d.ts +4 -4
  25. package/dist/models/CLIOptions.d.ts.map +1 -1
  26. package/dist/models/CLIOptions.js +5 -5
  27. package/dist/templates/react-javascript/template/src/components/App.jsx +2 -2
  28. package/dist/templates/react-javascript/template/webpack.config.js +1 -0
  29. package/dist/templates/react-javascript/template.json +4 -4
  30. package/dist/templates/react-javascript-with-document-sandbox/template/src/ui/components/App.jsx +2 -2
  31. package/dist/templates/react-javascript-with-document-sandbox/template/webpack.config.js +1 -0
  32. package/dist/templates/react-javascript-with-document-sandbox/template.json +4 -4
  33. package/dist/templates/react-typescript/template/src/components/App.tsx +2 -2
  34. package/dist/templates/react-typescript/template/webpack.config.js +1 -0
  35. package/dist/templates/react-typescript/template.json +4 -4
  36. package/dist/templates/react-typescript-with-document-sandbox/template/src/ui/components/App.tsx +2 -2
  37. package/dist/templates/react-typescript-with-document-sandbox/template/webpack.config.js +1 -0
  38. package/dist/templates/react-typescript-with-document-sandbox/template.json +4 -4
  39. package/dist/templates/swc-javascript/template/src/components/App.js +2 -2
  40. package/dist/templates/swc-javascript/template/webpack.config.js +1 -0
  41. package/dist/templates/swc-javascript/template.json +4 -4
  42. package/dist/templates/swc-javascript-with-document-sandbox/template/src/ui/components/App.js +2 -2
  43. package/dist/templates/swc-javascript-with-document-sandbox/template/webpack.config.js +1 -0
  44. package/dist/templates/swc-javascript-with-document-sandbox/template.json +4 -4
  45. package/dist/templates/swc-typescript/template/src/components/App.css.ts +2 -2
  46. package/dist/templates/swc-typescript/template/src/components/App.ts +4 -4
  47. package/dist/templates/swc-typescript/template/src/index.ts +2 -2
  48. package/dist/templates/swc-typescript/template/webpack.config.js +1 -0
  49. package/dist/templates/swc-typescript/template.json +4 -4
  50. package/dist/templates/swc-typescript-with-document-sandbox/template/src/ui/components/App.css.ts +2 -2
  51. package/dist/templates/swc-typescript-with-document-sandbox/template/src/ui/components/App.ts +4 -4
  52. package/dist/templates/swc-typescript-with-document-sandbox/template/src/ui/index.ts +2 -2
  53. package/dist/templates/swc-typescript-with-document-sandbox/template/webpack.config.js +1 -0
  54. package/dist/templates/swc-typescript-with-document-sandbox/template.json +4 -4
  55. package/dist/tsconfig.tsbuildinfo +1 -1
  56. package/dist/validators/AddOnDirectoryValidator.js +2 -2
  57. package/dist/validators/NodeEnvironmentValidator.js +2 -2
  58. package/package.json +24 -18
  59. package/src/app/{AddOnManager.ts → AddOnPackageManager.ts} +4 -6
  60. package/src/app/AddOnTemplateSelector.ts +13 -13
  61. package/src/app/WxpAddOnFactory.ts +5 -5
  62. package/src/app/index.ts +1 -1
  63. package/src/commands/create.ts +24 -48
  64. package/src/config/inversify.config.ts +2 -1
  65. package/src/config/inversify.types.ts +7 -1
  66. package/src/constants.ts +2 -2
  67. package/src/index.ts +25 -0
  68. package/src/models/CLIOptions.ts +5 -5
  69. package/src/test/app/{AddOnManager.spec.ts → AddOnPackageManager.spec.ts} +8 -5
  70. package/src/test/app/AddOnTemplateSelector.spec.ts +30 -12
  71. package/src/test/app/WxpAddOnFactory.spec.ts +11 -11
  72. package/src/test/commands/command.spec.ts +80 -0
  73. package/src/test/commands/create.spec.ts +42 -16
  74. package/src/test/models/CLIOptions.spec.ts +3 -3
  75. package/src/test/validators/AddOnDirectoryValidator.spec.ts +24 -15
  76. package/src/test/validators/NodeEnvironmentValidator.spec.ts +5 -5
  77. package/src/validators/AddOnDirectoryValidator.ts +2 -2
  78. package/src/validators/NodeEnvironmentValidator.ts +2 -2
  79. package/templates/react-javascript/template/src/components/App.jsx +2 -2
  80. package/templates/react-javascript/template/webpack.config.js +1 -0
  81. package/templates/react-javascript/template.json +4 -4
  82. package/templates/react-javascript-with-document-sandbox/template/src/ui/components/App.jsx +2 -2
  83. package/templates/react-javascript-with-document-sandbox/template/webpack.config.js +1 -0
  84. package/templates/react-javascript-with-document-sandbox/template.json +4 -4
  85. package/templates/react-typescript/template/src/components/App.tsx +2 -2
  86. package/templates/react-typescript/template/webpack.config.js +1 -0
  87. package/templates/react-typescript/template.json +4 -4
  88. package/templates/react-typescript-with-document-sandbox/template/src/ui/components/App.tsx +2 -2
  89. package/templates/react-typescript-with-document-sandbox/template/webpack.config.js +1 -0
  90. package/templates/react-typescript-with-document-sandbox/template.json +4 -4
  91. package/templates/swc-javascript/template/src/components/App.js +2 -2
  92. package/templates/swc-javascript/template/webpack.config.js +1 -0
  93. package/templates/swc-javascript/template.json +4 -4
  94. package/templates/swc-javascript-with-document-sandbox/template/src/ui/components/App.js +2 -2
  95. package/templates/swc-javascript-with-document-sandbox/template/webpack.config.js +1 -0
  96. package/templates/swc-javascript-with-document-sandbox/template.json +4 -4
  97. package/templates/swc-typescript/template/src/components/App.css.ts +2 -2
  98. package/templates/swc-typescript/template/src/components/App.ts +4 -4
  99. package/templates/swc-typescript/template/src/index.ts +2 -2
  100. package/templates/swc-typescript/template/webpack.config.js +1 -0
  101. package/templates/swc-typescript/template.json +4 -4
  102. package/templates/swc-typescript-with-document-sandbox/template/src/ui/components/App.css.ts +2 -2
  103. package/templates/swc-typescript-with-document-sandbox/template/src/ui/components/App.ts +4 -4
  104. package/templates/swc-typescript-with-document-sandbox/template/src/ui/index.ts +2 -2
  105. package/templates/swc-typescript-with-document-sandbox/template/webpack.config.js +1 -0
  106. package/templates/swc-typescript-with-document-sandbox/template.json +4 -4
  107. package/tsconfig.json +3 -1
  108. package/dist/app/AddOnManager.d.ts.map +0 -1
@@ -25,6 +25,7 @@
25
25
  import type { AnalyticsConsent, AnalyticsService } from "@adobe/ccweb-add-on-analytics";
26
26
  import { ITypes as IAnalyticsTypes } from "@adobe/ccweb-add-on-analytics";
27
27
  import { EntrypointType } from "@adobe/ccweb-add-on-manifest";
28
+ import { PROGRAM_NAME } from "@adobe/ccweb-add-on-scaffolder";
28
29
  import { Config } from "@oclif/core";
29
30
  import chai, { assert, expect } from "chai";
30
31
  import chaiAsPromised from "chai-as-promised";
@@ -34,13 +35,13 @@ import type { StubbedInstance } from "ts-sinon";
34
35
  import { stubInterface } from "ts-sinon";
35
36
  import { AnalyticsErrorMarkers } from "../../AnalyticsMarkers.js";
36
37
  import type { AddOnFactory } from "../../app/index.js";
37
- import { CreateCCWebAddOn } from "../../commands/create.js";
38
+ import { Create } from "../../commands/create.js";
38
39
  import { IContainer, ITypes } from "../../config/index.js";
39
40
  import { CLIOptions } from "../../models/index.js";
40
41
 
41
42
  chai.use(chaiAsPromised);
42
43
 
43
- describe("CreateCCWebAddOn", () => {
44
+ describe("Create", () => {
44
45
  let sandbox: sinon.SinonSandbox;
45
46
 
46
47
  let container: sinon.SinonStub;
@@ -52,6 +53,7 @@ describe("CreateCCWebAddOn", () => {
52
53
 
53
54
  beforeEach(() => {
54
55
  sandbox = sinon.createSandbox();
56
+ sandbox.stub(console, "log");
55
57
 
56
58
  addOnFactory = stubInterface();
57
59
  addOnFactory.create.resolves();
@@ -74,12 +76,24 @@ describe("CreateCCWebAddOn", () => {
74
76
  it("should execute succesfully when correct parameters are passed without analytics.", async () => {
75
77
  analyticsConsent.get.resolves(true);
76
78
 
77
- const createCCWebAddOn = new CreateCCWebAddOn(
78
- ["hello-world", "--kind=panel", "--template=react-javascript", "--verbose"],
79
- new Config({ root: "." })
79
+ const create = new Create(
80
+ ["hello-world", "--entrypoint=panel", "--template=react-javascript", "--verbose"],
81
+ new Config({ name: PROGRAM_NAME, version: "1.0.0", root: "." })
80
82
  );
81
-
82
- await createCCWebAddOn.run();
83
+ sandbox
84
+ // @ts-ignore - Sidestep `this.parse()` error when calling `run()` directly.
85
+ .stub(create, "parse")
86
+ .resolves({
87
+ args: { name: "hello-world" },
88
+ flags: {
89
+ entrypoint: EntrypointType.PANEL,
90
+ template: "react-javascript",
91
+ analytics: undefined,
92
+ verbose: true
93
+ }
94
+ });
95
+
96
+ await create.run();
83
97
 
84
98
  assert.equal(analyticsConsent.get.callCount, 1);
85
99
 
@@ -91,12 +105,24 @@ describe("CreateCCWebAddOn", () => {
91
105
  analyticsConsent.get.resolves(true);
92
106
  analyticsConsent.set.withArgs(false).resolves();
93
107
 
94
- const createCCWebAddOn = new CreateCCWebAddOn(
95
- ["hello-world", "--kind=panel", "--template=react-javascript", "--analytics=off", "--verbose"],
96
- new Config({ root: "." })
108
+ const create = new Create(
109
+ ["hello-world", "--entrypoint=panel", "--template=react-javascript", "--analytics=off", "--verbose"],
110
+ new Config({ name: PROGRAM_NAME, version: "1.0.0", root: "." })
97
111
  );
98
-
99
- await createCCWebAddOn.run();
112
+ sandbox
113
+ // @ts-ignore - Sidestep `this.parse()` error when calling `run()` directly.
114
+ .stub(create, "parse")
115
+ .resolves({
116
+ args: { name: "hello-world" },
117
+ flags: {
118
+ entrypoint: EntrypointType.PANEL,
119
+ template: "react-javascript",
120
+ analytics: "off",
121
+ verbose: true
122
+ }
123
+ });
124
+
125
+ await create.run();
100
126
 
101
127
  assert.equal(analyticsConsent.set.calledOnceWith(false), true);
102
128
 
@@ -106,11 +132,11 @@ describe("CreateCCWebAddOn", () => {
106
132
  });
107
133
 
108
134
  describe("catch", () => {
109
- it("should fail when incorrect parameters are passed.", async () => {
110
- const createCCWebAddOn = new CreateCCWebAddOn(["--incorrect-flag"], new Config({ root: "." }));
135
+ it("should fail for any errors in command execution.", async () => {
136
+ const create = new Create([], new Config({ name: PROGRAM_NAME, version: "1.0.0", root: "." }));
111
137
 
112
- const error = new Error("Nonexistent flag: --incorrect-flag\nSee more help with --help");
113
- await expect(createCCWebAddOn.catch(error)).to.be.rejectedWith();
138
+ const error = new Error("Something went wrong.");
139
+ await expect(create.catch(error)).to.be.rejectedWith(error);
114
140
 
115
141
  assert.equal(
116
142
  analyticsService.postEvent.calledOnceWith(
@@ -30,14 +30,14 @@ import { CLIOptions } from "../../models/index.js";
30
30
  describe("CLIOptions", () => {
31
31
  describe("constructor", () => {
32
32
  it("should create a new instance of CLIOptions.", () => {
33
- const addOnKind = EntrypointType.PANEL;
33
+ const entrypointType = EntrypointType.PANEL;
34
34
  const addOnName = "test-app";
35
35
  const templateName = "javascript";
36
36
  const verbose = false;
37
37
 
38
- const cliOptions = new CLIOptions(addOnKind as EntrypointType, addOnName, templateName, verbose);
38
+ const cliOptions = new CLIOptions(entrypointType as EntrypointType, addOnName, templateName, verbose);
39
39
 
40
- assert.equal(cliOptions.addOnKind, addOnKind);
40
+ assert.equal(cliOptions.entrypointType, entrypointType);
41
41
  assert.equal(cliOptions.addOnName, addOnName);
42
42
  assert.equal(cliOptions.templateName, templateName);
43
43
  assert.equal(cliOptions.verbose, verbose);
@@ -76,7 +76,7 @@ describe("AddOnDirectoryValidator", () => {
76
76
  assert.equal(
77
77
  logger.warning
78
78
  .getCall(1)
79
- .calledWith(`${PROGRAM_NAME} <add-on-name> --kind <panel> --template <javascript>`, {
79
+ .calledWith(`${PROGRAM_NAME} <add-on-name> --entrypoint <panel> --template <javascript>`, {
80
80
  prefix: " "
81
81
  }),
82
82
  true
@@ -92,10 +92,13 @@ describe("AddOnDirectoryValidator", () => {
92
92
 
93
93
  assert.equal(logger.information.callCount, 1);
94
94
  assert.equal(
95
- logger.information.calledWith(`${PROGRAM_NAME} my-add-on --kind panel --template javascript`, {
96
- prefix: " ",
97
- postfix: "\n"
98
- }),
95
+ logger.information.calledWith(
96
+ `${PROGRAM_NAME} my-add-on --entrypoint panel --template javascript`,
97
+ {
98
+ prefix: " ",
99
+ postfix: "\n"
100
+ }
101
+ ),
99
102
  true
100
103
  );
101
104
  assert.equal(analyticsService.postEvent.callCount, 1);
@@ -130,7 +133,7 @@ describe("AddOnDirectoryValidator", () => {
130
133
  assert.equal(
131
134
  logger.warning
132
135
  .getCall(1)
133
- .calledWith(`${PROGRAM_NAME} <add-on-name> --kind <panel> --template <javascript>`, {
136
+ .calledWith(`${PROGRAM_NAME} <add-on-name> --entrypoint <panel> --template <javascript>`, {
134
137
  prefix: " "
135
138
  }),
136
139
  true
@@ -146,10 +149,13 @@ describe("AddOnDirectoryValidator", () => {
146
149
 
147
150
  assert.equal(logger.information.callCount, 1);
148
151
  assert.equal(
149
- logger.information.calledWith(`${PROGRAM_NAME} my-add-on --kind panel --template javascript`, {
150
- prefix: " ",
151
- postfix: "\n"
152
- }),
152
+ logger.information.calledWith(
153
+ `${PROGRAM_NAME} my-add-on --entrypoint panel --template javascript`,
154
+ {
155
+ prefix: " ",
156
+ postfix: "\n"
157
+ }
158
+ ),
153
159
  true
154
160
  );
155
161
  assert.equal(analyticsService.postEvent.callCount, 1);
@@ -191,7 +197,7 @@ describe("AddOnDirectoryValidator", () => {
191
197
  assert.equal(
192
198
  logger.warning
193
199
  .getCall(1)
194
- .calledWith(`${PROGRAM_NAME} <add-on-name> --kind <panel> --template <javascript>`, {
200
+ .calledWith(`${PROGRAM_NAME} <add-on-name> --entrypoint <panel> --template <javascript>`, {
195
201
  prefix: " "
196
202
  }),
197
203
  true
@@ -207,10 +213,13 @@ describe("AddOnDirectoryValidator", () => {
207
213
 
208
214
  assert.equal(logger.information.callCount, 1);
209
215
  assert.equal(
210
- logger.information.calledWith(`${PROGRAM_NAME} my-add-on --kind panel --template javascript`, {
211
- prefix: " ",
212
- postfix: "\n"
213
- }),
216
+ logger.information.calledWith(
217
+ `${PROGRAM_NAME} my-add-on --entrypoint panel --template javascript`,
218
+ {
219
+ prefix: " ",
220
+ postfix: "\n"
221
+ }
222
+ ),
214
223
  true
215
224
  );
216
225
  assert.equal(analyticsService.postEvent.callCount, 1);
@@ -63,7 +63,7 @@ describe("NodeEnvironmentValidator", () => {
63
63
  });
64
64
 
65
65
  describe("validateNodeVersion", () => {
66
- const runs = [{ version: "10.0.0" }, { version: "15.9.9" }];
66
+ const runs = [{ version: "10.0.0" }, { version: "17.9.9" }];
67
67
  runs.forEach(({ version }) => {
68
68
  it(`should exit for lower node version: ${version}.`, async () => {
69
69
  const validator: EnvironmentValidator = new NodeEnvironmentValidator(
@@ -84,7 +84,7 @@ describe("NodeEnvironmentValidator", () => {
84
84
 
85
85
  assert.equal(logger.information.callCount, 2);
86
86
  assert.equal(
87
- logger.information.getCall(0).calledWith(`${PROGRAM_NAME} requires node 16.0.0 or higher.`),
87
+ logger.information.getCall(0).calledWith(`${PROGRAM_NAME} requires node 18.0.0 or higher.`),
88
88
  true
89
89
  );
90
90
  assert.equal(logger.information.getCall(1).calledWith("Please update your version of node."), true);
@@ -134,7 +134,7 @@ describe("NodeEnvironmentValidator", () => {
134
134
 
135
135
  assert.equal(logger.information.callCount, 2);
136
136
  assert.equal(
137
- logger.information.getCall(0).calledWith(`${PROGRAM_NAME} requires npm 8.0.0 or higher.`),
137
+ logger.information.getCall(0).calledWith(`${PROGRAM_NAME} requires npm 10.0.0 or higher.`),
138
138
  true
139
139
  );
140
140
  assert.equal(logger.information.getCall(1).calledWith("Please install npm."), true);
@@ -147,7 +147,7 @@ describe("NodeEnvironmentValidator", () => {
147
147
  });
148
148
  });
149
149
 
150
- const runs = [{ version: "3.0.0" }, { version: "7.9.9" }];
150
+ const runs = [{ version: "3.0.0" }, { version: "9.9.9" }];
151
151
  runs.forEach(run => {
152
152
  it(`should exit for lower npm version: ${run.version}.`, async () => {
153
153
  const validator: EnvironmentValidator = new NodeEnvironmentValidator(
@@ -168,7 +168,7 @@ describe("NodeEnvironmentValidator", () => {
168
168
 
169
169
  assert.equal(logger.information.callCount, 2);
170
170
  assert.equal(
171
- logger.information.getCall(0).calledWith(`${PROGRAM_NAME} requires npm 8.0.0 or higher.`),
171
+ logger.information.getCall(0).calledWith(`${PROGRAM_NAME} requires npm 10.0.0 or higher.`),
172
172
  true
173
173
  );
174
174
  assert.equal(logger.information.getCall(1).calledWith("Please update your version of npm."), true);
@@ -191,8 +191,8 @@ const LOGS = {
191
191
  newLine: "\n",
192
192
  tab: " ",
193
193
  specifyAddOnName: "Please specify an Add-on name",
194
- executeProgram: "{PROGRAM_NAME} <add-on-name> --kind <panel> --template <javascript>",
195
- executeProgramExample: "{PROGRAM_NAME} my-add-on --kind panel --template javascript",
194
+ executeProgram: "{PROGRAM_NAME} <add-on-name> --entrypoint <panel> --template <javascript>",
195
+ executeProgramExample: "{PROGRAM_NAME} my-add-on --entrypoint panel --template javascript",
196
196
  forExample: "For example:",
197
197
  npmNamingRestriction: "Cannot create a project named {addOnName} because of NPM naming restrictions.",
198
198
  dependencyNamingRestriction:
@@ -66,7 +66,7 @@ export class NodeEnvironmentValidator implements EnvironmentValidator {
66
66
  * Validate the node version in the user's system.
67
67
  */
68
68
  async validateNodeVersion(): Promise<void> {
69
- const minNode = "16.0.0";
69
+ const minNode = "18.0.0";
70
70
  try {
71
71
  const result = this._process.executeSync("node", ["--version"]);
72
72
  const nodeVersion = String(result?.data)?.trim();
@@ -96,7 +96,7 @@ export class NodeEnvironmentValidator implements EnvironmentValidator {
96
96
  * Validate the npm version in the user's system.
97
97
  */
98
98
  async validateNpmVersion(): Promise<void> {
99
- const minNpm = "8.0.0";
99
+ const minNpm = "10.0.0";
100
100
  try {
101
101
  const result = this._process.executeSync("npm", ["--version"]);
102
102
  const npmVersion = result.data ? String(result.data)?.trim() : undefined;
@@ -1,4 +1,4 @@
1
- // To support: theme="express" scale="medium" color="light"
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 theme="express" scale="medium" color="light">
23
+ <Theme system="express" scale="medium" color="light">
24
24
  <div className="container">
25
25
  <Button size="m" onClick={handleClick}>
26
26
  {buttonLabel}
@@ -12,6 +12,7 @@ module.exports = {
12
12
  outputModule: true
13
13
  },
14
14
  output: {
15
+ pathinfo: !isEnvProduction,
15
16
  path: path.resolve(__dirname, "dist"),
16
17
  module: true,
17
18
  filename: "index.js"
@@ -6,8 +6,8 @@
6
6
  "package": "ccweb-add-on-scripts package --use webpack"
7
7
  },
8
8
  "dependencies": {
9
- "@swc-react/button": "0.39.4",
10
- "@swc-react/theme": "0.39.4",
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": "5.1.4",
24
- "webpack": "5.89.0"
23
+ "webpack-cli": "6.0.1",
24
+ "webpack": "5.98.0"
25
25
  }
26
26
  }
@@ -1,4 +1,4 @@
1
- // To support: theme="express" scale="medium" color="light"
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 theme="express" scale="medium" color="light">
21
+ <Theme system="express" scale="medium" color="light">
22
22
  <div className="container">
23
23
  <Button size="m" onClick={handleClick}>
24
24
  Create Rectangle
@@ -15,6 +15,7 @@ module.exports = {
15
15
  outputModule: true
16
16
  },
17
17
  output: {
18
+ pathinfo: !isEnvProduction,
18
19
  path: path.resolve(__dirname, "dist"),
19
20
  module: true,
20
21
  filename: "[name].js"
@@ -6,8 +6,8 @@
6
6
  "package": "ccweb-add-on-scripts package --use webpack"
7
7
  },
8
8
  "dependencies": {
9
- "@swc-react/button": "0.39.4",
10
- "@swc-react/theme": "0.39.4",
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": "5.1.4",
24
- "webpack": "5.89.0"
23
+ "webpack-cli": "6.0.1",
24
+ "webpack": "5.98.0"
25
25
  }
26
26
  }
@@ -1,4 +1,4 @@
1
- // To support: theme="express" scale="medium" color="light"
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";
@@ -22,7 +22,7 @@ const App = ({ addOnUISdk }: { addOnUISdk: AddOnSDKAPI }) => {
22
22
  return (
23
23
  // Please note that the below "<Theme>" component does not react to theme changes in Express.
24
24
  // You may use "addOnUISdk.app.ui.theme" to get the current theme and react accordingly.
25
- <Theme theme="express" scale="medium" color="light">
25
+ <Theme system="express" scale="medium" color="light">
26
26
  <div className="container">
27
27
  <Button size="m" onClick={handleClick}>
28
28
  {buttonLabel}
@@ -12,6 +12,7 @@ module.exports = {
12
12
  outputModule: true
13
13
  },
14
14
  output: {
15
+ pathinfo: !isEnvProduction,
15
16
  path: path.resolve(__dirname, "dist"),
16
17
  module: true,
17
18
  filename: "index.js"
@@ -6,8 +6,8 @@
6
6
  "package": "ccweb-add-on-scripts package --use webpack"
7
7
  },
8
8
  "dependencies": {
9
- "@swc-react/button": "0.39.4",
10
- "@swc-react/theme": "0.39.4",
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
  "style-loader": "3.3.3",
21
21
  "ts-loader": "9.5.1",
22
22
  "typescript": "5.3.2",
23
- "webpack-cli": "5.1.4",
24
- "webpack": "5.89.0"
23
+ "webpack-cli": "6.0.1",
24
+ "webpack": "5.98.0"
25
25
  }
26
26
  }
@@ -1,4 +1,4 @@
1
- // To support: theme="express" scale="medium" color="light"
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";
@@ -21,7 +21,7 @@ const App = ({ addOnUISdk, sandboxProxy }: { addOnUISdk: AddOnSDKAPI; sandboxPro
21
21
  return (
22
22
  // Please note that the below "<Theme>" component does not react to theme changes in Express.
23
23
  // You may use "addOnUISdk.app.ui.theme" to get the current theme and react accordingly.
24
- <Theme theme="express" scale="medium" color="light">
24
+ <Theme system="express" scale="medium" color="light">
25
25
  <div className="container">
26
26
  <Button size="m" onClick={handleClick}>
27
27
  Create Rectangle
@@ -18,6 +18,7 @@ module.exports = {
18
18
  outputModule: true
19
19
  },
20
20
  output: {
21
+ pathinfo: !isEnvProduction,
21
22
  path: path.resolve(__dirname, "dist"),
22
23
  module: true,
23
24
  filename: "[name].js"
@@ -6,8 +6,8 @@
6
6
  "package": "ccweb-add-on-scripts package --use webpack"
7
7
  },
8
8
  "dependencies": {
9
- "@swc-react/button": "0.39.4",
10
- "@swc-react/theme": "0.39.4",
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
  "style-loader": "3.3.3",
21
21
  "ts-loader": "9.5.1",
22
22
  "typescript": "5.3.2",
23
- "webpack-cli": "5.1.4",
24
- "webpack": "5.89.0"
23
+ "webpack-cli": "6.0.1",
24
+ "webpack": "5.98.0"
25
25
  }
26
26
  }
@@ -1,4 +1,4 @@
1
- // To support: theme="express" scale="medium" color="light"
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";
@@ -33,7 +33,7 @@ export class App extends LitElement {
33
33
  render() {
34
34
  // Please note that the below "<sp-theme>" component does not react to theme changes in Express.
35
35
  // You may use "this.addOnUISdk.app.ui.theme" to get the current theme and react accordingly.
36
- return html` <sp-theme theme="express" color="light" scale="medium">
36
+ return html` <sp-theme system="express" color="light" scale="medium">
37
37
  <div class="container">
38
38
  <sp-button size="m" @click=${this._handleClick}>${this._buttonLabel}</sp-button>
39
39
  </div>
@@ -12,6 +12,7 @@ module.exports = {
12
12
  outputModule: true
13
13
  },
14
14
  output: {
15
+ pathinfo: !isEnvProduction,
15
16
  path: path.resolve(__dirname, "dist"),
16
17
  module: true,
17
18
  filename: "index.js"
@@ -6,8 +6,8 @@
6
6
  "package": "ccweb-add-on-scripts package --use webpack"
7
7
  },
8
8
  "dependencies": {
9
- "@spectrum-web-components/button": "0.39.4",
10
- "@spectrum-web-components/theme": "0.39.4",
9
+ "@spectrum-web-components/button": "1.1.2",
10
+ "@spectrum-web-components/theme": "1.1.2",
11
11
  "lit": "2.8.0"
12
12
  },
13
13
  "devDependencies": {
@@ -18,7 +18,7 @@
18
18
  "css-loader": "6.8.1",
19
19
  "html-webpack-plugin": "5.5.3",
20
20
  "style-loader": "3.3.3",
21
- "webpack-cli": "5.1.4",
22
- "webpack": "5.89.0"
21
+ "webpack-cli": "6.0.1",
22
+ "webpack": "5.98.0"
23
23
  }
24
24
  }
@@ -1,4 +1,4 @@
1
- // To support: theme="express" scale="medium" color="light"
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";
@@ -45,7 +45,7 @@ export class App extends LitElement {
45
45
  render() {
46
46
  // Please note that the below "<sp-theme>" component does not react to theme changes in Express.
47
47
  // You may use "this.addOnUISdk.app.ui.theme" to get the current theme and react accordingly.
48
- return html` <sp-theme theme="express" color="light" scale="medium">
48
+ return html` <sp-theme system="express" color="light" scale="medium">
49
49
  <div class="container">
50
50
  <sp-button size="m" @click=${this._handleClick}>Create Rectangle</sp-button>
51
51
  </div>
@@ -15,6 +15,7 @@ module.exports = {
15
15
  outputModule: true
16
16
  },
17
17
  output: {
18
+ pathinfo: !isEnvProduction,
18
19
  path: path.resolve(__dirname, "dist"),
19
20
  module: true,
20
21
  filename: "[name].js"
@@ -6,8 +6,8 @@
6
6
  "package": "ccweb-add-on-scripts package --use webpack"
7
7
  },
8
8
  "dependencies": {
9
- "@spectrum-web-components/button": "0.39.4",
10
- "@spectrum-web-components/theme": "0.39.4",
9
+ "@spectrum-web-components/button": "1.1.2",
10
+ "@spectrum-web-components/theme": "1.1.2",
11
11
  "lit": "2.8.0"
12
12
  },
13
13
  "devDependencies": {
@@ -18,7 +18,7 @@
18
18
  "css-loader": "6.8.1",
19
19
  "html-webpack-plugin": "5.5.3",
20
20
  "style-loader": "3.3.3",
21
- "webpack-cli": "5.1.4",
22
- "webpack": "5.89.0"
21
+ "webpack-cli": "6.0.1",
22
+ "webpack": "5.98.0"
23
23
  }
24
24
  }
@@ -1,6 +1,6 @@
1
- import { css } from "lit";
1
+ import { type CSSResult, css } from "lit";
2
2
 
3
- export const style = css`
3
+ export const style: CSSResult = css`
4
4
  .container {
5
5
  margin: 24px;
6
6
  display: flex;
@@ -1,4 +1,4 @@
1
- // To support: theme="express" scale="medium" color="light"
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";
@@ -10,7 +10,7 @@ import "@spectrum-web-components/theme/theme-light.js";
10
10
  import "@spectrum-web-components/button/sp-button.js";
11
11
  import "@spectrum-web-components/theme/sp-theme.js";
12
12
 
13
- import { LitElement, html } from "lit";
13
+ import { LitElement, TemplateResult, html } from "lit";
14
14
  import { customElement, property, state } from "lit/decorators.js";
15
15
  import { style } from "./App.css";
16
16
 
@@ -32,10 +32,10 @@ export class App extends LitElement {
32
32
  this._buttonLabel = "Clicked";
33
33
  }
34
34
 
35
- render() {
35
+ render(): TemplateResult {
36
36
  // Please note that the below "<sp-theme>" component does not react to theme changes in Express.
37
37
  // You may use "this.addOnUISdk.app.ui.theme" to get the current theme and react accordingly.
38
- return html` <sp-theme theme="express" color="light" scale="medium">
38
+ return html` <sp-theme system="express" color="light" scale="medium">
39
39
  <div class="container">
40
40
  <sp-button size="m" @click=${this._handleClick}>${this._buttonLabel}</sp-button>
41
41
  </div>
@@ -1,4 +1,4 @@
1
- import { LitElement, html } from "lit";
1
+ import { LitElement, TemplateResult, html } from "lit";
2
2
  import { customElement, state } from "lit/decorators.js";
3
3
  import { until } from "lit/directives/until.js";
4
4
  import "./components/App";
@@ -10,7 +10,7 @@ export class Root extends LitElement {
10
10
  @state()
11
11
  private _isAddOnUISdkReady = addOnUISdk.ready;
12
12
 
13
- render() {
13
+ render(): TemplateResult {
14
14
  return html`
15
15
  ${until(
16
16
  this._isAddOnUISdkReady.then(() => {
@@ -12,6 +12,7 @@ module.exports = {
12
12
  outputModule: true
13
13
  },
14
14
  output: {
15
+ pathinfo: !isEnvProduction,
15
16
  path: path.resolve(__dirname, "dist"),
16
17
  module: true,
17
18
  filename: "index.js"