@tridion-docs/extensions-cli 2.1.0 → 2.1.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.
- package/CHANGELOG.md +26 -12
- package/LICENSE.md +1 -1
- package/README.md +2 -2
- package/dist/addon/template/extension/eslint.config.mjs.hbs +31 -33
- package/dist/addon/template/extension/package.json.hbs +32 -33
- package/dist/cli.js +111 -161
- package/dist/commands/create/addon/createAddonPrompt.d.ts +2 -2
- package/dist/commands/create/extensionPoints/createExtensionPointsPrompt.d.ts +1 -7
- package/dist/commands/create/extensionPoints/explorerAction/createExplorerActionPrompt.d.ts +1 -15
- package/dist/commands/create/extensionPoints/mainNavigation/createMainNavigationPrompt.d.ts +1 -17
- package/dist/commands/create/extensionPoints/mainNavigationLink/createMainNavigationLinkPrompt.d.ts +1 -21
- package/dist/commands/create/extensionPoints/objectInsightItem/createObjectInsightItemPrompt.d.ts +1 -13
- package/dist/index.js +9 -7
- package/package.json +25 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,26 +1,40 @@
|
|
|
1
1
|
# @tridion-docs/extensions-cli
|
|
2
2
|
|
|
3
|
+
## 2.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @tridion-docs/extensions@2.1.2
|
|
9
|
+
|
|
10
|
+
## 2.1.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
- @tridion-docs/extensions@2.1.1
|
|
16
|
+
|
|
3
17
|
## 2.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
6
20
|
|
|
7
21
|
- Updated dependencies
|
|
8
22
|
|
|
9
|
-
|
|
23
|
+
- @tridion-docs/extensions@2.1.0
|
|
10
24
|
|
|
11
25
|
- updated check for version number. build improvements.
|
|
12
26
|
- Updated dependencies
|
|
13
27
|
|
|
14
|
-
|
|
28
|
+
- @tridion-docs/extensions@2.0.3
|
|
15
29
|
|
|
16
30
|
- Added TranslationJobs view to the list of views where extensions are possible
|
|
17
31
|
- Updated dependencies
|
|
18
32
|
|
|
19
|
-
|
|
33
|
+
- @tridion-docs/extensions@2.0.2
|
|
20
34
|
|
|
21
35
|
- added longLabel as optional property for action buttons
|
|
22
36
|
- Updated dependencies
|
|
23
|
-
|
|
37
|
+
- @tridion-docs/extensions@2.0.1
|
|
24
38
|
|
|
25
39
|
## 2.0.0
|
|
26
40
|
|
|
@@ -28,37 +42,37 @@
|
|
|
28
42
|
|
|
29
43
|
- Updated dependencies
|
|
30
44
|
|
|
31
|
-
|
|
45
|
+
- @tridion-docs/extensions@2.0.0
|
|
32
46
|
|
|
33
47
|
- Added zIndex property to an useItemSelector hook
|
|
34
48
|
- Updated dependencies
|
|
35
49
|
|
|
36
|
-
|
|
50
|
+
- @tridion-docs/extensions@1.0.10
|
|
37
51
|
|
|
38
52
|
- Updated package dependencies
|
|
39
53
|
- Updated dependencies
|
|
40
54
|
|
|
41
|
-
|
|
55
|
+
- @tridion-docs/extensions@1.0.9
|
|
42
56
|
|
|
43
57
|
- Fixed export for ItemSelectorObjectType and PublicationObjectType
|
|
44
58
|
- Updated dependencies
|
|
45
59
|
|
|
46
|
-
|
|
60
|
+
- @tridion-docs/extensions@1.0.7
|
|
47
61
|
|
|
48
62
|
- Added support for Publication Hub
|
|
49
63
|
- Updated dependencies
|
|
50
64
|
|
|
51
|
-
|
|
65
|
+
- @tridion-docs/extensions@1.0.6
|
|
52
66
|
|
|
53
67
|
- Updated dependencies
|
|
54
|
-
|
|
68
|
+
- @tridion-docs/extensions@1.0.5
|
|
55
69
|
|
|
56
70
|
## 1.0.4
|
|
57
71
|
|
|
58
72
|
### Patch Changes
|
|
59
73
|
|
|
60
74
|
- Updated dependencies
|
|
61
|
-
|
|
75
|
+
- @tridion-docs/extensions@1.0.4
|
|
62
76
|
|
|
63
77
|
## 1.0.3
|
|
64
78
|
|
|
@@ -69,4 +83,4 @@
|
|
|
69
83
|
### Patch Changes
|
|
70
84
|
|
|
71
85
|
- Updated dependencies
|
|
72
|
-
|
|
86
|
+
- @tridion-docs/extensions@1.0.3
|
package/LICENSE.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
License: https://www.rws.com/legal/terms-and-conditions/rws-technology/
|
|
2
|
-
Copyright ©
|
|
2
|
+
Copyright © 2026 RWS Holdings plc including its subsidiaries and affiliated companies. All rights reserved.
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Extensions CLI is a command-line application that helps you to create/pack your
|
|
|
5
5
|
# License
|
|
6
6
|
License: https://www.rws.com/legal/terms-and-conditions/rws-technology/
|
|
7
7
|
|
|
8
|
-
Copyright ©
|
|
8
|
+
Copyright © 2026 RWS Holdings plc including its subsidiaries and affiliated companies. All rights reserved.
|
|
9
9
|
|
|
10
10
|
# Compatibility
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ This version of the package is compatible with Tridion Docs 15.2
|
|
|
15
15
|
|
|
16
16
|
## Getting Started
|
|
17
17
|
|
|
18
|
-
**Note:** Using this CLI assumes you have Node.js
|
|
18
|
+
**Note:** Using this CLI assumes you have Node.js 24 installed. If you do not, you can [install it here](https://nodejs.org/en/download/).
|
|
19
19
|
|
|
20
20
|
### Create new addon project
|
|
21
21
|
Creates new addon and extension project with default server configuration and generated components.
|
|
@@ -1,45 +1,43 @@
|
|
|
1
|
-
import
|
|
1
|
+
import eslintReact from "@eslint-react/eslint-plugin";
|
|
2
2
|
import prettier from "eslint-plugin-prettier";
|
|
3
|
-
|
|
4
3
|
import typescriptEslint from "@typescript-eslint/eslint-plugin";
|
|
5
4
|
import globals from "globals";
|
|
6
5
|
import tsParser from "@typescript-eslint/parser";
|
|
7
6
|
|
|
8
|
-
export default [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
files: ['**/*.{tsx,ts}'],
|
|
12
|
-
plugins: {
|
|
13
|
-
react,
|
|
14
|
-
prettier,
|
|
15
|
-
"@typescript-eslint": typescriptEslint,
|
|
7
|
+
export default [
|
|
8
|
+
{
|
|
9
|
+
ignores: ["**/node_modules", "**/*.js", "**/*.jsx", "**/*.json", "**/*.d.ts"],
|
|
16
10
|
},
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
11
|
+
{
|
|
12
|
+
files: ['**/*.{tsx,ts}'],
|
|
13
|
+
...eslintReact.configs["recommended-typescript"],
|
|
14
|
+
plugins: {
|
|
15
|
+
...eslintReact.configs["recommended-typescript"].plugins,
|
|
16
|
+
prettier,
|
|
17
|
+
"@typescript-eslint": typescriptEslint,
|
|
21
18
|
},
|
|
22
19
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
languageOptions: {
|
|
21
|
+
globals: {
|
|
22
|
+
...globals.browser,
|
|
23
|
+
},
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
25
|
+
parser: tsParser,
|
|
26
|
+
ecmaVersion: 5,
|
|
27
|
+
sourceType: "script",
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
parserOptions: {
|
|
30
|
+
project: ["tsconfig.json"],
|
|
31
|
+
},
|
|
35
32
|
},
|
|
36
|
-
},
|
|
37
33
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
34
|
+
rules: {
|
|
35
|
+
...eslintReact.configs["recommended-typescript"].rules,
|
|
36
|
+
"import/no-default-export": "off",
|
|
37
|
+
"class-methods-use-this": "off",
|
|
38
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
39
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
40
|
+
"@typescript-eslint/no-floating-promises": "off",
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
];
|
|
@@ -21,40 +21,39 @@
|
|
|
21
21
|
"react-dom": "18.3.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@babel/core": "7.
|
|
25
|
-
"@babel/plugin-transform-runtime": "7.
|
|
26
|
-
"@babel/preset-env": "7.
|
|
27
|
-
"@babel/preset-react": "7.
|
|
28
|
-
"@babel/preset-typescript": "7.
|
|
29
|
-
"@babel/runtime": "7.
|
|
30
|
-
"@eslint/compat": "
|
|
31
|
-
"@eslint/eslintrc": "
|
|
32
|
-
"@eslint/js": "
|
|
24
|
+
"@babel/core": "7.29.0",
|
|
25
|
+
"@babel/plugin-transform-runtime": "7.29.0",
|
|
26
|
+
"@babel/preset-env": "7.29.0",
|
|
27
|
+
"@babel/preset-react": "7.28.5",
|
|
28
|
+
"@babel/preset-typescript": "7.28.5",
|
|
29
|
+
"@babel/runtime": "7.28.6",
|
|
30
|
+
"@eslint/compat": "2.0.2",
|
|
31
|
+
"@eslint/eslintrc": "3.3.3",
|
|
32
|
+
"@eslint/js": "10.0.1",
|
|
33
|
+
"@eslint-react/eslint-plugin": "2.13.0",
|
|
33
34
|
"@tridion-docs/extensions-cli": "{{extensionsCliVersion}}",
|
|
34
|
-
"@types/react": "18.3.
|
|
35
|
-
"@types/react-dom": "18.3.
|
|
36
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
37
|
-
"@typescript-eslint/parser": "8.
|
|
38
|
-
"autoprefixer": "10.4.
|
|
39
|
-
"babel-loader": "
|
|
35
|
+
"@types/react": "18.3.27",
|
|
36
|
+
"@types/react-dom": "18.3.7",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "8.56.0",
|
|
38
|
+
"@typescript-eslint/parser": "8.56.0",
|
|
39
|
+
"autoprefixer": "10.4.24",
|
|
40
|
+
"babel-loader": "10.0.0",
|
|
40
41
|
"babel-plugin-styled-components": "2.1.4",
|
|
41
|
-
"css-loader": "7.1.
|
|
42
|
-
"cssnano": "7.
|
|
43
|
-
"eslint": "
|
|
44
|
-
"eslint-config-prettier": "10.
|
|
45
|
-
"eslint-formatter-pretty": "
|
|
46
|
-
"eslint-plugin-prettier": "5.
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"typescript": "5.7.3",
|
|
56
|
-
"webpack": "5.98.0",
|
|
42
|
+
"css-loader": "7.1.4",
|
|
43
|
+
"cssnano": "7.1.2",
|
|
44
|
+
"eslint": "10.0.0",
|
|
45
|
+
"eslint-config-prettier": "10.1.8",
|
|
46
|
+
"eslint-formatter-pretty": "7.0.0",
|
|
47
|
+
"eslint-plugin-prettier": "5.5.5",
|
|
48
|
+
"fork-ts-checker-webpack-plugin": "9.1.0",
|
|
49
|
+
"globals": "^17.3.0",
|
|
50
|
+
"mini-css-extract-plugin": "2.10.0",
|
|
51
|
+
"postcss": "8.5.6",
|
|
52
|
+
"postcss-loader": "8.2.1",
|
|
53
|
+
"prettier": "3.8.1",
|
|
54
|
+
"typescript": "5.9.3",
|
|
55
|
+
"webpack": "5.105.2",
|
|
57
56
|
"webpack-cli": "6.0.1",
|
|
58
|
-
"webpack-dev-server": "5.2.
|
|
57
|
+
"webpack-dev-server": "5.2.3"
|
|
59
58
|
}
|
|
60
|
-
}
|
|
59
|
+
}
|
package/dist/cli.js
CHANGED
|
@@ -7,8 +7,11 @@ import { resolve, dirname, basename } from 'node:path';
|
|
|
7
7
|
import Handlebars from 'handlebars';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
import { r as readJsonFile, A as AddonManifest } from './addonManifest-tFdjtMXO.js';
|
|
10
|
-
import
|
|
10
|
+
import input from '@inquirer/input';
|
|
11
|
+
import confirm from '@inquirer/confirm';
|
|
11
12
|
import isValidFilename from 'valid-filename';
|
|
13
|
+
import checkbox, { Separator } from '@inquirer/checkbox';
|
|
14
|
+
import select from '@inquirer/select';
|
|
12
15
|
import * as tridionDocsExtensions from '@tridion-docs/extensions';
|
|
13
16
|
import archiver from 'archiver';
|
|
14
17
|
|
|
@@ -150,58 +153,42 @@ const extensionNameValidation = (input) => {
|
|
|
150
153
|
};
|
|
151
154
|
|
|
152
155
|
const createAddonPrompt = async () => {
|
|
153
|
-
return
|
|
154
|
-
{
|
|
155
|
-
type: 'input',
|
|
156
|
-
name: 'addonId',
|
|
156
|
+
return {
|
|
157
|
+
addonId: await input({
|
|
157
158
|
message: 'Provide id of the addon:',
|
|
158
159
|
default: 'my-addon',
|
|
159
160
|
validate: idValidation,
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
type: 'input',
|
|
163
|
-
name: 'addonName',
|
|
161
|
+
}),
|
|
162
|
+
addonName: await input({
|
|
164
163
|
message: 'Provide name of the addon:',
|
|
165
164
|
default: 'My addon',
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
type: 'input',
|
|
169
|
-
name: 'addonDescription',
|
|
165
|
+
}),
|
|
166
|
+
addonDescription: await input({
|
|
170
167
|
message: 'Provide description of the addon:',
|
|
171
168
|
default: 'My addon for Tridion Docs Organize Space',
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
type: 'input',
|
|
175
|
-
name: 'author',
|
|
169
|
+
}),
|
|
170
|
+
author: await input({
|
|
176
171
|
message: `Provide author's name:`,
|
|
177
172
|
default: 'RWS',
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
type: 'input',
|
|
181
|
-
name: 'extensionName',
|
|
173
|
+
}),
|
|
174
|
+
extensionName: await input({
|
|
182
175
|
message: 'Provide the name of the frontend extension:',
|
|
183
176
|
default: 'my-extension',
|
|
184
177
|
validate: extensionNameValidation,
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
type: 'input',
|
|
188
|
-
name: 'extensionDescription',
|
|
178
|
+
}),
|
|
179
|
+
extensionDescription: await input({
|
|
189
180
|
message: 'Provide description of the extension:',
|
|
190
181
|
default: 'My first extension',
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
type: 'confirm',
|
|
194
|
-
name: 'extensionAssemblyIncluded',
|
|
182
|
+
}),
|
|
183
|
+
extensionAssemblyIncluded: await confirm({
|
|
195
184
|
message: 'Are you going to provide backend assembly?',
|
|
196
185
|
default: false,
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
|
|
200
|
-
name: 'url',
|
|
201
|
-
message: `Provide the url to Tridion Docs:`,
|
|
186
|
+
}),
|
|
187
|
+
url: await input({
|
|
188
|
+
message: 'Provide the url to Tridion Docs:',
|
|
202
189
|
validate: urlValidation,
|
|
203
|
-
},
|
|
204
|
-
|
|
190
|
+
}),
|
|
191
|
+
};
|
|
205
192
|
};
|
|
206
193
|
|
|
207
194
|
const createAddonRootFolder = ({ path, addonDescription, addonId, addonName, author, extensionName, extensionAssemblyIncluded, }) => {
|
|
@@ -255,14 +242,12 @@ const configureHandlebars = () => {
|
|
|
255
242
|
});
|
|
256
243
|
};
|
|
257
244
|
|
|
258
|
-
const createExtensionPointsPrompt = () => {
|
|
259
|
-
return
|
|
260
|
-
{
|
|
261
|
-
type: 'checkbox',
|
|
262
|
-
name: 'extensionPoints',
|
|
245
|
+
const createExtensionPointsPrompt = async () => {
|
|
246
|
+
return {
|
|
247
|
+
extensionPoints: await checkbox({
|
|
263
248
|
message: 'Extensions to add:',
|
|
264
249
|
choices: [
|
|
265
|
-
new
|
|
250
|
+
new Separator('----- Header extensions -----'),
|
|
266
251
|
{
|
|
267
252
|
name: 'Main navigation item - Custom page on a separate route',
|
|
268
253
|
value: 'mainNavigation',
|
|
@@ -273,21 +258,21 @@ const createExtensionPointsPrompt = () => {
|
|
|
273
258
|
value: 'mainNavigationLink',
|
|
274
259
|
short: 'Main navigation link',
|
|
275
260
|
},
|
|
276
|
-
new
|
|
261
|
+
new Separator('----- Action extensions -----'),
|
|
277
262
|
{
|
|
278
263
|
name: 'Explorer action - Custom explorer action',
|
|
279
264
|
value: 'explorerAction',
|
|
280
265
|
short: 'Explorer action',
|
|
281
266
|
},
|
|
282
|
-
new
|
|
267
|
+
new Separator('----- Object Insight extensions -----'),
|
|
283
268
|
{
|
|
284
269
|
name: 'Object insight item - Custom object insight item',
|
|
285
270
|
value: 'objectInsightItem',
|
|
286
271
|
short: 'Object insight item',
|
|
287
272
|
},
|
|
288
273
|
],
|
|
289
|
-
},
|
|
290
|
-
|
|
274
|
+
}),
|
|
275
|
+
};
|
|
291
276
|
};
|
|
292
277
|
|
|
293
278
|
const importLookupPattern = "import packageJson from '../package.json';";
|
|
@@ -303,39 +288,29 @@ const addExtensionPointToBuilder = ({ builderFilePath, templatePath, templatePar
|
|
|
303
288
|
writeFileSync(builderFilePath, newIndexFileContent, { flag: 'r+' });
|
|
304
289
|
};
|
|
305
290
|
|
|
306
|
-
const createExplorerActionPrompt = () => {
|
|
307
|
-
return
|
|
308
|
-
{
|
|
309
|
-
type: 'input',
|
|
310
|
-
name: 'id',
|
|
291
|
+
const createExplorerActionPrompt = async () => {
|
|
292
|
+
return {
|
|
293
|
+
id: await input({
|
|
311
294
|
message: 'Explorer action id:',
|
|
312
295
|
validate: idValidation,
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
type: 'input',
|
|
316
|
-
name: 'title',
|
|
296
|
+
}),
|
|
297
|
+
title: await input({
|
|
317
298
|
message: 'Explorer action title:',
|
|
318
|
-
},
|
|
319
|
-
{
|
|
320
|
-
type: 'input',
|
|
321
|
-
name: 'tooltip',
|
|
299
|
+
}),
|
|
300
|
+
tooltip: await input({
|
|
322
301
|
message: 'Explorer action tooltip:',
|
|
323
|
-
},
|
|
324
|
-
{
|
|
325
|
-
type: 'input',
|
|
326
|
-
name: 'iconComponentName',
|
|
302
|
+
}),
|
|
303
|
+
iconComponentName: await input({
|
|
327
304
|
message: 'Icon component name:',
|
|
328
305
|
default: 'CustomIcon',
|
|
329
306
|
validate: componentNameValidation,
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
type: 'input',
|
|
333
|
-
name: 'hookName',
|
|
307
|
+
}),
|
|
308
|
+
hookName: await input({
|
|
334
309
|
message: 'Hook name:',
|
|
335
310
|
default: 'useCustomHook',
|
|
336
311
|
validate: hookNameValidation,
|
|
337
|
-
},
|
|
338
|
-
|
|
312
|
+
}),
|
|
313
|
+
};
|
|
339
314
|
};
|
|
340
315
|
|
|
341
316
|
const createExplorerAction = async (extensionFolderPath) => {
|
|
@@ -377,46 +352,34 @@ const createExplorerAction = async (extensionFolderPath) => {
|
|
|
377
352
|
};
|
|
378
353
|
|
|
379
354
|
const { NavigationItemIdType } = tridionDocsExtensions;
|
|
380
|
-
const createMainNavigationPrompt = () => {
|
|
381
|
-
return
|
|
382
|
-
{
|
|
383
|
-
type: 'input',
|
|
384
|
-
name: 'id',
|
|
355
|
+
const createMainNavigationPrompt = async () => {
|
|
356
|
+
return {
|
|
357
|
+
id: await input({
|
|
385
358
|
message: 'Navigation item id:',
|
|
386
359
|
validate: idValidation,
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
type: 'input',
|
|
390
|
-
name: 'title',
|
|
360
|
+
}),
|
|
361
|
+
title: await input({
|
|
391
362
|
message: 'Navigation item title:',
|
|
392
|
-
},
|
|
393
|
-
{
|
|
394
|
-
type: 'input',
|
|
395
|
-
name: 'path',
|
|
363
|
+
}),
|
|
364
|
+
path: await input({
|
|
396
365
|
message: 'Please provide route to use for your custom page:',
|
|
397
366
|
validate: pathValidation,
|
|
398
|
-
},
|
|
399
|
-
{
|
|
400
|
-
type: 'input',
|
|
401
|
-
name: 'position',
|
|
367
|
+
}),
|
|
368
|
+
position: await input({
|
|
402
369
|
message: 'Please provide to which menu item navigation item should be bound:',
|
|
403
370
|
default: NavigationItemIdType.settings,
|
|
404
|
-
},
|
|
405
|
-
{
|
|
406
|
-
type: 'list',
|
|
407
|
-
name: 'positioningType',
|
|
371
|
+
}),
|
|
372
|
+
positioningType: await select({
|
|
408
373
|
message: 'Please choose how navigation item relates to bounded one:',
|
|
409
374
|
default: 'after',
|
|
410
375
|
choices: ['after', 'before'],
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
type: 'input',
|
|
414
|
-
name: 'componentName',
|
|
376
|
+
}),
|
|
377
|
+
componentName: await input({
|
|
415
378
|
message: 'React component name:',
|
|
416
379
|
default: 'CustomPage',
|
|
417
380
|
validate: componentNameValidation,
|
|
418
|
-
},
|
|
419
|
-
|
|
381
|
+
}),
|
|
382
|
+
};
|
|
420
383
|
};
|
|
421
384
|
|
|
422
385
|
const createMainNavigation = async (extensionFolderPath) => {
|
|
@@ -453,60 +416,55 @@ const createMainNavigation = async (extensionFolderPath) => {
|
|
|
453
416
|
});
|
|
454
417
|
};
|
|
455
418
|
|
|
456
|
-
const createMainNavigationLinkPrompt = () => {
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
type: 'confirm',
|
|
476
|
-
name: 'hasIcon',
|
|
477
|
-
message: 'Are you going to use icon for navigation link?',
|
|
478
|
-
default: true,
|
|
479
|
-
},
|
|
480
|
-
{
|
|
481
|
-
type: 'input',
|
|
482
|
-
name: 'iconComponentName',
|
|
419
|
+
const createMainNavigationLinkPrompt = async () => {
|
|
420
|
+
const id = await input({
|
|
421
|
+
message: 'Navigation link id:',
|
|
422
|
+
validate: idValidation,
|
|
423
|
+
});
|
|
424
|
+
const title = await input({
|
|
425
|
+
message: 'Navigation link title:',
|
|
426
|
+
});
|
|
427
|
+
const tooltip = await input({
|
|
428
|
+
message: 'Navigation link tooltip:',
|
|
429
|
+
});
|
|
430
|
+
const hasIcon = await confirm({
|
|
431
|
+
message: 'Are you going to use icon for navigation link?',
|
|
432
|
+
default: true,
|
|
433
|
+
});
|
|
434
|
+
const iconComponentName = hasIcon
|
|
435
|
+
? await input({
|
|
483
436
|
message: 'Icon component name:',
|
|
484
437
|
default: 'CustomIcon',
|
|
485
438
|
validate: componentNameValidation,
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
{
|
|
495
|
-
type: 'input',
|
|
496
|
-
name: 'url',
|
|
439
|
+
})
|
|
440
|
+
: '';
|
|
441
|
+
const hasExternalLink = await confirm({
|
|
442
|
+
message: 'Are you going to use a link to external page?',
|
|
443
|
+
default: true,
|
|
444
|
+
});
|
|
445
|
+
const url = hasExternalLink
|
|
446
|
+
? await input({
|
|
497
447
|
message: 'Provide link to external page:',
|
|
498
|
-
when: answers => answers.hasExternalLink,
|
|
499
448
|
validate: urlValidation,
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
449
|
+
})
|
|
450
|
+
: '';
|
|
451
|
+
const componentName = !hasExternalLink
|
|
452
|
+
? await input({
|
|
504
453
|
message: 'React component name:',
|
|
505
454
|
default: 'CustomPage',
|
|
506
455
|
validate: componentNameValidation,
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
456
|
+
})
|
|
457
|
+
: '';
|
|
458
|
+
return {
|
|
459
|
+
id,
|
|
460
|
+
title,
|
|
461
|
+
tooltip,
|
|
462
|
+
hasIcon,
|
|
463
|
+
iconComponentName,
|
|
464
|
+
hasExternalLink,
|
|
465
|
+
url,
|
|
466
|
+
componentName,
|
|
467
|
+
};
|
|
510
468
|
};
|
|
511
469
|
|
|
512
470
|
const createMainNavigationLink = async (extensionFolderPath) => {
|
|
@@ -554,34 +512,26 @@ const createMainNavigationLink = async (extensionFolderPath) => {
|
|
|
554
512
|
});
|
|
555
513
|
};
|
|
556
514
|
|
|
557
|
-
const createObjectInsightItemPrompt = () => {
|
|
558
|
-
return
|
|
559
|
-
{
|
|
560
|
-
type: 'input',
|
|
561
|
-
name: 'id',
|
|
515
|
+
const createObjectInsightItemPrompt = async () => {
|
|
516
|
+
return {
|
|
517
|
+
id: await input({
|
|
562
518
|
message: 'Object insight item id:',
|
|
563
519
|
validate: idValidation,
|
|
564
|
-
},
|
|
565
|
-
{
|
|
566
|
-
type: 'input',
|
|
567
|
-
name: 'tooltip',
|
|
520
|
+
}),
|
|
521
|
+
tooltip: await input({
|
|
568
522
|
message: 'Object insight item tooltip:',
|
|
569
|
-
},
|
|
570
|
-
{
|
|
571
|
-
type: 'input',
|
|
572
|
-
name: 'iconComponentName',
|
|
523
|
+
}),
|
|
524
|
+
iconComponentName: await input({
|
|
573
525
|
message: 'Icon component name:',
|
|
574
526
|
default: 'CustomIcon',
|
|
575
527
|
validate: componentNameValidation,
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
type: 'input',
|
|
579
|
-
name: 'componentName',
|
|
528
|
+
}),
|
|
529
|
+
componentName: await input({
|
|
580
530
|
message: 'Component name:',
|
|
581
531
|
default: 'CustomComponent',
|
|
582
532
|
validate: componentNameValidation,
|
|
583
|
-
},
|
|
584
|
-
|
|
533
|
+
}),
|
|
534
|
+
};
|
|
585
535
|
};
|
|
586
536
|
|
|
587
537
|
const createObjectInsightItem = async (extensionFolderPath) => {
|
|
@@ -9,12 +9,12 @@ export interface CreateAddonAnswers {
|
|
|
9
9
|
extensionAssemblyIncluded: boolean;
|
|
10
10
|
}
|
|
11
11
|
export declare const createAddonPrompt: () => Promise<{
|
|
12
|
-
url: string;
|
|
13
12
|
addonId: string;
|
|
14
13
|
addonName: string;
|
|
15
14
|
addonDescription: string;
|
|
16
|
-
extensionName: string;
|
|
17
15
|
author: string;
|
|
16
|
+
extensionName: string;
|
|
18
17
|
extensionDescription: string;
|
|
19
18
|
extensionAssemblyIncluded: boolean;
|
|
19
|
+
url: string;
|
|
20
20
|
}>;
|
|
@@ -2,10 +2,4 @@ export type ExtensionPoint = 'mainNavigation' | 'mainNavigationLink' | 'explorer
|
|
|
2
2
|
export interface CreateExtensionPointsAnswers {
|
|
3
3
|
extensionPoints: ExtensionPoint[];
|
|
4
4
|
}
|
|
5
|
-
export declare const createExtensionPointsPrompt: () => Promise<
|
|
6
|
-
extensionPoints: ExtensionPoint[];
|
|
7
|
-
}> & {
|
|
8
|
-
ui: import("inquirer/dist/commonjs/ui/prompt").default<{
|
|
9
|
-
extensionPoints: ExtensionPoint[];
|
|
10
|
-
}>;
|
|
11
|
-
};
|
|
5
|
+
export declare const createExtensionPointsPrompt: () => Promise<CreateExtensionPointsAnswers>;
|
|
@@ -5,18 +5,4 @@ export interface CreateExplorerActionAnswers {
|
|
|
5
5
|
iconComponentName: string;
|
|
6
6
|
hookName: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const createExplorerActionPrompt: () => Promise<
|
|
9
|
-
id: string;
|
|
10
|
-
title: string;
|
|
11
|
-
tooltip: string;
|
|
12
|
-
iconComponentName: string;
|
|
13
|
-
hookName: string;
|
|
14
|
-
}> & {
|
|
15
|
-
ui: import("inquirer/dist/commonjs/ui/prompt").default<{
|
|
16
|
-
id: string;
|
|
17
|
-
title: string;
|
|
18
|
-
tooltip: string;
|
|
19
|
-
iconComponentName: string;
|
|
20
|
-
hookName: string;
|
|
21
|
-
}>;
|
|
22
|
-
};
|
|
8
|
+
export declare const createExplorerActionPrompt: () => Promise<CreateExplorerActionAnswers>;
|
|
@@ -6,20 +6,4 @@ export interface CreateMainNavigationAnswers {
|
|
|
6
6
|
positioningType: string;
|
|
7
7
|
componentName: string;
|
|
8
8
|
}
|
|
9
|
-
export declare const createMainNavigationPrompt: () => Promise<
|
|
10
|
-
id: string;
|
|
11
|
-
title: string;
|
|
12
|
-
path: string;
|
|
13
|
-
position: string;
|
|
14
|
-
positioningType: string;
|
|
15
|
-
componentName: string;
|
|
16
|
-
}> & {
|
|
17
|
-
ui: import("inquirer/dist/commonjs/ui/prompt").default<{
|
|
18
|
-
id: string;
|
|
19
|
-
title: string;
|
|
20
|
-
path: string;
|
|
21
|
-
position: string;
|
|
22
|
-
positioningType: string;
|
|
23
|
-
componentName: string;
|
|
24
|
-
}>;
|
|
25
|
-
};
|
|
9
|
+
export declare const createMainNavigationPrompt: () => Promise<CreateMainNavigationAnswers>;
|
package/dist/commands/create/extensionPoints/mainNavigationLink/createMainNavigationLinkPrompt.d.ts
CHANGED
|
@@ -8,24 +8,4 @@ export interface CreateMainNavigationLinkAnswers {
|
|
|
8
8
|
url: string;
|
|
9
9
|
componentName: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const createMainNavigationLinkPrompt: () => Promise<
|
|
12
|
-
id: string;
|
|
13
|
-
title: string;
|
|
14
|
-
tooltip: string;
|
|
15
|
-
hasIcon: boolean;
|
|
16
|
-
iconComponentName: string;
|
|
17
|
-
hasExternalLink: boolean;
|
|
18
|
-
url: string;
|
|
19
|
-
componentName: string;
|
|
20
|
-
}> & {
|
|
21
|
-
ui: import("inquirer/dist/commonjs/ui/prompt").default<{
|
|
22
|
-
id: string;
|
|
23
|
-
title: string;
|
|
24
|
-
tooltip: string;
|
|
25
|
-
hasIcon: boolean;
|
|
26
|
-
iconComponentName: string;
|
|
27
|
-
hasExternalLink: boolean;
|
|
28
|
-
url: string;
|
|
29
|
-
componentName: string;
|
|
30
|
-
}>;
|
|
31
|
-
};
|
|
11
|
+
export declare const createMainNavigationLinkPrompt: () => Promise<CreateMainNavigationLinkAnswers>;
|
package/dist/commands/create/extensionPoints/objectInsightItem/createObjectInsightItemPrompt.d.ts
CHANGED
|
@@ -4,16 +4,4 @@ export interface CreateObjectInsightItemAnswers {
|
|
|
4
4
|
iconComponentName: string;
|
|
5
5
|
componentName: string;
|
|
6
6
|
}
|
|
7
|
-
export declare const createObjectInsightItemPrompt: () => Promise<
|
|
8
|
-
id: string;
|
|
9
|
-
tooltip: string;
|
|
10
|
-
iconComponentName: string;
|
|
11
|
-
componentName: string;
|
|
12
|
-
}> & {
|
|
13
|
-
ui: import("inquirer/dist/commonjs/ui/prompt").default<{
|
|
14
|
-
id: string;
|
|
15
|
-
tooltip: string;
|
|
16
|
-
iconComponentName: string;
|
|
17
|
-
componentName: string;
|
|
18
|
-
}>;
|
|
19
|
-
};
|
|
7
|
+
export declare const createObjectInsightItemPrompt: () => Promise<CreateObjectInsightItemAnswers>;
|
package/dist/index.js
CHANGED
|
@@ -57,13 +57,15 @@ const getLocalFrontendAddon = ({ manifestPath, addonConfigPath }) => {
|
|
|
57
57
|
const localExtensions = manifest.getFrontendExtensions();
|
|
58
58
|
localExtensions.forEach(extension => {
|
|
59
59
|
var _a;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
if (extension.name) {
|
|
61
|
+
localAddon.configuration[extension.name] = (addonConfiguration === null || addonConfiguration === void 0 ? void 0 : addonConfiguration.configPerExtension[extension.name]) || {};
|
|
62
|
+
const extensionFiles = extension.files.map(filePath => `${extensionsRequestBasePath}/${extension.name}/${filePath}?hash=${Date.now()}`);
|
|
63
|
+
(_a = localAddon.extensions) === null || _a === void 0 ? void 0 : _a.push({
|
|
64
|
+
$type: 'OrganizeSpaceExtension',
|
|
65
|
+
name: extension.name,
|
|
66
|
+
contents: extensionFiles,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
67
69
|
});
|
|
68
70
|
return localAddon;
|
|
69
71
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tridion-docs/extensions-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "CLI to develop, build and package extensions for Tridion Docs Organize Space",
|
|
5
5
|
"author": "RWS Group for and on behalf of its affiliates and subsidiaries",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -23,37 +23,41 @@
|
|
|
23
23
|
"clean": "rimraf dist",
|
|
24
24
|
"build": "rollup -c",
|
|
25
25
|
"release": "rollup -c",
|
|
26
|
-
"lint": "
|
|
26
|
+
"lint": "biome lint . --write",
|
|
27
27
|
"prepublish": "yarn build",
|
|
28
28
|
"test": "docs-extensions"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@
|
|
31
|
+
"@inquirer/checkbox": "5.0.7",
|
|
32
|
+
"@inquirer/confirm": "6.0.7",
|
|
33
|
+
"@inquirer/input": "5.0.7",
|
|
34
|
+
"@inquirer/select": "5.0.7",
|
|
35
|
+
"@tridion-docs/extensions": "2.1.2",
|
|
32
36
|
"archiver": "7.0.1",
|
|
33
|
-
"chalk": "5.
|
|
34
|
-
"commander": "
|
|
37
|
+
"chalk": "5.6.2",
|
|
38
|
+
"commander": "14.0.3",
|
|
35
39
|
"cross-spawn": "7.0.6",
|
|
36
|
-
"decamelize": "6.0.
|
|
37
|
-
"fs-extra": "11.3.
|
|
38
|
-
"handlebars": "4.7.
|
|
39
|
-
"inquirer": "12.4.2",
|
|
40
|
+
"decamelize": "6.0.1",
|
|
41
|
+
"fs-extra": "11.3.3",
|
|
42
|
+
"handlebars": "4.7.9",
|
|
40
43
|
"valid-filename": "4.0.0"
|
|
41
44
|
},
|
|
42
45
|
"devDependencies": {
|
|
43
|
-
"@
|
|
44
|
-
"@rollup/plugin-
|
|
45
|
-
"@rollup/plugin-
|
|
46
|
-
"@
|
|
47
|
-
"@types/
|
|
46
|
+
"@biomejs/biome": "2.4.3",
|
|
47
|
+
"@rollup/plugin-commonjs": "29.0.0",
|
|
48
|
+
"@rollup/plugin-node-resolve": "16.0.3",
|
|
49
|
+
"@rollup/plugin-typescript": "12.3.0",
|
|
50
|
+
"@types/archiver": "7.0.0",
|
|
51
|
+
"@types/compression": "1.8.1",
|
|
48
52
|
"@types/cross-spawn": "6.0.6",
|
|
49
53
|
"@types/fs-extra": "11.0.4",
|
|
50
|
-
"@types/node": "
|
|
54
|
+
"@types/node": "24.10.13",
|
|
51
55
|
"@web/rollup-plugin-copy": "0.5.1",
|
|
52
|
-
"rimraf": "6.
|
|
53
|
-
"rollup": "4.
|
|
54
|
-
"rollup-plugin-delete": "
|
|
55
|
-
"rollup-plugin-node-externals": "8.
|
|
56
|
-
"typescript": "5.
|
|
57
|
-
"typescript-transform-paths": "3.5.
|
|
56
|
+
"rimraf": "6.1.3",
|
|
57
|
+
"rollup": "4.57.1",
|
|
58
|
+
"rollup-plugin-delete": "3.0.2",
|
|
59
|
+
"rollup-plugin-node-externals": "8.1.2",
|
|
60
|
+
"typescript": "5.9.3",
|
|
61
|
+
"typescript-transform-paths": "3.5.6"
|
|
58
62
|
}
|
|
59
63
|
}
|