@unisphere/nx 3.14.0 → 3.16.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/dist/generators/add-documentation/USAGE.md +64 -0
- package/dist/generators/add-documentation/add-documentation.d.ts +1 -1
- package/dist/generators/add-documentation/add-documentation.d.ts.map +1 -1
- package/dist/generators/add-documentation/add-documentation.js +80 -41
- package/dist/generators/add-documentation/schema.d.ts +4 -1
- package/dist/generators/add-documentation/schema.json +19 -10
- package/dist/generators/add-documentation/templates/babel.config.js +3 -0
- package/dist/generators/add-documentation/templates/docs/api/overview.md +8 -0
- package/dist/generators/add-documentation/templates/docs/changelog/overview.md +8 -0
- package/dist/generators/add-documentation/templates/docs/getting-started/overview.md +8 -0
- package/dist/generators/add-documentation/templates/docusaurus.config.ts.template +116 -0
- package/dist/generators/add-documentation/templates/package.json.template +57 -0
- package/dist/generators/add-documentation/templates/postcss.config.js +6 -0
- package/dist/generators/add-documentation/templates/sidebars.ts +9 -0
- package/dist/generators/add-documentation/templates/src/components/demo-placeholder-card.tsx +33 -0
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/genie/integrate-genie-guide.tsx +149 -0
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/notifications/notifications-react-guide.tsx +211 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-features/index.tsx +239 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-features/styles.module.css +87 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/index.tsx +76 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/styles.module.css +120 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/index.tsx +22 -0
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/styles.module.css +38 -0
- package/dist/generators/add-documentation/templates/src/components/interactive-code-panel.tsx +258 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/developer-toolbox-experience.tsx +84 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/hello-world-experience.tsx +130 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/notificaitons-experience.tsx +635 -0
- package/dist/generators/add-documentation/templates/src/components/introductions/reactions-experience.tsx +117 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/introduction-card.tsx +117 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/playground-card.tsx +67 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/use-color-mode.ts +20 -0
- package/dist/generators/add-documentation/templates/src/components/ui-shared/utils.ts +8 -0
- package/dist/generators/add-documentation/templates/src/css/custom.css +487 -0
- package/dist/generators/add-documentation/templates/src/css/hero.module.css +190 -0
- package/dist/generators/add-documentation/templates/src/pages/index.module.css +59 -0
- package/dist/generators/add-documentation/templates/src/pages/index.tsx.template +191 -0
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/index.tsx +145 -0
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/styles.module.css +132 -0
- package/dist/generators/add-documentation/templates/src/theme/Navbar/MobileSidebar/Header/index.tsx +45 -0
- package/dist/generators/add-documentation/templates/static/.nojekyll +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-1.png +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-2.png +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-3.png +0 -0
- package/dist/generators/add-documentation/templates/static/docs/overview/unisphere-for-dummies-4.png +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/divider.svg +5 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Architecture.svg +4 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Cost.svg +4 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/ExternalLink.svg +3 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Infra.svg +8 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Redundancies.svg +6 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Speed.svg +6 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Standards.svg +4 -0
- package/dist/generators/add-documentation/templates/static/homepage/icons/Unified.svg +12 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/custo.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/flame.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/keepr.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/loggi.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/palleto.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/publi.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/services/tinker.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/img/favicon.ico +0 -0
- package/dist/generators/add-documentation/templates/static/img/logo.svg +6 -0
- package/dist/generators/add-documentation/templates/static/img/logo_big.svg +12 -0
- package/dist/generators/add-documentation/templates/static/img/logo_big_dark.svg +12 -0
- package/dist/generators/add-documentation/templates/static/img/logo_dark.svg +6 -0
- package/dist/generators/add-documentation/templates/static/img/unisphere-social-card.jpg +0 -0
- package/dist/generators/add-documentation/templates/static/llm/INTEGRATE.md +497 -0
- package/dist/generators/add-documentation/templates/static/robots.txt +5 -0
- package/dist/generators/add-documentation/templates/static/team/amirc.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/erans.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/hadass.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/hillelc.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/idoz.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/lianb.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/nirb.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/nivs.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/omric.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/roeed.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/sivana.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/stask.png +0 -0
- package/dist/generators/add-documentation/templates/static/team/tanyal.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/tomere.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/tornikem.jpeg +0 -0
- package/dist/generators/add-documentation/templates/static/team/yairn.jpeg +0 -0
- package/dist/generators/add-documentation/templates/tailwind.config.js +30 -0
- package/dist/generators/add-documentation/templates/tsconfig.json +7 -0
- package/dist/generators/add-package/add-package.d.ts.map +1 -1
- package/dist/generators/add-package/add-package.js +9 -4
- package/dist/generators/add-package/schema.d.ts +1 -1
- package/dist/generators/add-package/schema.json +18 -10
- package/dist/generators/rename-package/rename-package.d.ts.map +1 -1
- package/dist/generators/rename-package/rename-package.js +12 -0
- package/dist/generators/utils.d.ts +1 -1
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/generators/utils.js +8 -10
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts +10 -0
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts.map +1 -0
- package/dist/migrations/3-15-0/add-experience-documentation.js +20 -0
- package/dist/migrations/3-16-0/remove-rollup-patch.d.ts +10 -0
- package/dist/migrations/3-16-0/remove-rollup-patch.d.ts.map +1 -0
- package/dist/migrations/3-16-0/remove-rollup-patch.js +32 -0
- package/dist/migrations/3-6-3/remove-rollup-patch.d.ts +1 -1
- package/dist/migrations/3-6-3/remove-rollup-patch.d.ts.map +1 -1
- package/dist/migrations/3-6-3/remove-rollup-patch.js +16 -6
- package/dist/migrations/3-7-0/update-gitignore-claude-exclusions.d.ts +9 -0
- package/dist/migrations/3-7-0/update-gitignore-claude-exclusions.d.ts.map +1 -0
- package/dist/migrations/3-7-0/update-gitignore-claude-exclusions.js +68 -0
- package/dist/shared.d.ts +4 -2
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +3 -1
- package/migrations.json +35 -0
- package/package.json +1 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# add-documentation
|
|
2
|
+
|
|
3
|
+
Generate a Docusaurus documentation site for an experience.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx nx g @unisphere/nx:add-documentation
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The experience name is auto-resolved from `.unisphere` config.
|
|
12
|
+
|
|
13
|
+
## Flags
|
|
14
|
+
|
|
15
|
+
| Flag | Type | Default | Description |
|
|
16
|
+
|------|------|---------|-------------|
|
|
17
|
+
| `--name` | string | auto from `.unisphere` | Override the experience name |
|
|
18
|
+
| `--is-experience-level` | boolean | `false` | Skip sub-name prompt (top-level experience docs) |
|
|
19
|
+
| `--sub-name` | string | prompted | Sub-name for the documentation site |
|
|
20
|
+
|
|
21
|
+
## Examples
|
|
22
|
+
|
|
23
|
+
**Sub-level docs (default)** — prompts for sub-name:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npx nx g @unisphere/nx:add-documentation
|
|
27
|
+
# Experience name auto-resolved from .unisphere
|
|
28
|
+
# Prompts: "What is the documentation sub-name?"
|
|
29
|
+
# e.g. sub-name "models" → folder: unisphere/documentation/{experience}-models
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Sub-level docs with flags (no prompts):**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npx nx g @unisphere/nx:add-documentation --sub-name=models
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Experience-level docs (no sub-name):**
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx nx g @unisphere/nx:add-documentation --is-experience-level
|
|
42
|
+
# → folder: unisphere/documentation/{experience}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Override experience name:**
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npx nx g @unisphere/nx:add-documentation --name=cs --sub-name=models
|
|
49
|
+
# → folder: unisphere/documentation/cs-models
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Output
|
|
53
|
+
|
|
54
|
+
- `unisphere/documentation/{name}/` — Full Docusaurus site
|
|
55
|
+
- `.unisphere` — Updated with documentation entry
|
|
56
|
+
- `.nxignore` — Updated to exclude documentation node_modules
|
|
57
|
+
|
|
58
|
+
## After generation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
cd unisphere/documentation/{name}
|
|
62
|
+
npm install
|
|
63
|
+
npx unisphere documentation serve {name}
|
|
64
|
+
```
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
2
|
import { AddDocumentationGeneratorSchema } from './schema';
|
|
3
|
-
export declare function addDocumentationGenerator(tree: Tree, options: AddDocumentationGeneratorSchema): Promise<() => void>;
|
|
3
|
+
export declare function addDocumentationGenerator(tree: Tree, options: AddDocumentationGeneratorSchema): Promise<(() => void) | undefined>;
|
|
4
4
|
export default addDocumentationGenerator;
|
|
5
5
|
//# sourceMappingURL=add-documentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-documentation.d.ts","sourceRoot":"","sources":["../../../src/generators/add-documentation/add-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"add-documentation.d.ts","sourceRoot":"","sources":["../../../src/generators/add-documentation/add-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,IAAI,EAAiB,MAAM,YAAY,CAAC;AAG7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,UAAU,CAAC;AAY3D,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,+BAA+B,qCAwJzC;AAED,eAAe,yBAAyB,CAAC"}
|
|
@@ -3,13 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addDocumentationGenerator = addDocumentationGenerator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const path = tslib_1.__importStar(require("path"));
|
|
7
6
|
const child_process_1 = require("child_process");
|
|
8
|
-
const
|
|
7
|
+
const path = tslib_1.__importStar(require("path"));
|
|
9
8
|
const utils_1 = require("../utils");
|
|
9
|
+
async function getEnquirerPrompt() {
|
|
10
|
+
const enquirer = await import('enquirer');
|
|
11
|
+
return enquirer.prompt || enquirer.default?.prompt || enquirer;
|
|
12
|
+
}
|
|
10
13
|
async function addDocumentationGenerator(tree, options) {
|
|
11
14
|
// Validate .unisphere configuration exists
|
|
12
|
-
(0, utils_1.validateUnisphereConfig)(tree);
|
|
15
|
+
const unisphereConfig = (0, utils_1.validateUnisphereConfig)(tree);
|
|
13
16
|
// Check workspace pattern for documentation apps
|
|
14
17
|
const rootPackageJsonPath = 'package.json';
|
|
15
18
|
if (tree.exists(rootPackageJsonPath)) {
|
|
@@ -27,16 +30,52 @@ async function addDocumentationGenerator(tree, options) {
|
|
|
27
30
|
'This will update your workspace pattern to support documentation sites.');
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
|
-
|
|
33
|
+
// Resolve experience name: use --name flag, or auto-resolve from .unisphere config
|
|
34
|
+
const documentationName = options.name || unisphereConfig.name;
|
|
31
35
|
const documentationNameAsLowerDashCase = (0, devkit_1.names)(documentationName).fileName;
|
|
32
|
-
|
|
36
|
+
devkit_1.logger.info(`Using experience name: ${documentationNameAsLowerDashCase}`);
|
|
37
|
+
// If not experience-level, prompt for sub-name
|
|
38
|
+
let subName = options.subName;
|
|
39
|
+
if (!options.isExperienceLevel && !subName) {
|
|
40
|
+
const prompt = await getEnquirerPrompt();
|
|
41
|
+
const response = await prompt({
|
|
42
|
+
type: 'input',
|
|
43
|
+
name: 'subName',
|
|
44
|
+
message: 'What is the documentation sub-name? (letters, numbers, dashes and spaces allowed)',
|
|
45
|
+
validate: (value) => {
|
|
46
|
+
if (!value || !value.trim()) {
|
|
47
|
+
return 'Sub-name is required for non-experience-level documentation sites';
|
|
48
|
+
}
|
|
49
|
+
if (!/^[a-zA-Z][a-zA-Z0-9\-\s]*$/.test(value)) {
|
|
50
|
+
return 'Sub-name must start with a letter and contain only letters, numbers, dashes and spaces';
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
subName = response.subName;
|
|
56
|
+
}
|
|
57
|
+
// Build the full documentation name
|
|
58
|
+
const subNameAsLowerDashCase = subName ? (0, devkit_1.names)(subName).fileName : null;
|
|
59
|
+
const fullDocumentationName = subNameAsLowerDashCase
|
|
60
|
+
? `${documentationNameAsLowerDashCase}-${subNameAsLowerDashCase}`
|
|
61
|
+
: documentationNameAsLowerDashCase;
|
|
62
|
+
const projectRoot = `unisphere/documentation/${fullDocumentationName}`;
|
|
33
63
|
// Check if the documentation site already exists
|
|
34
64
|
if (tree.exists(projectRoot)) {
|
|
35
|
-
throw new Error(`Documentation site "${
|
|
65
|
+
throw new Error(`Documentation site "${fullDocumentationName}" already exists at ${projectRoot}.\n` +
|
|
36
66
|
'Please choose a different name or remove the existing documentation site first.');
|
|
37
67
|
}
|
|
68
|
+
// Generate files from template
|
|
69
|
+
const templateVariables = {
|
|
70
|
+
...(0, utils_1.createNameTransforms)(fullDocumentationName, 'documentationName'),
|
|
71
|
+
...(0, utils_1.createNameTransforms)(documentationNameAsLowerDashCase, 'experienceName'),
|
|
72
|
+
hasSubName: !!subNameAsLowerDashCase,
|
|
73
|
+
subNameKebab: subNameAsLowerDashCase || '',
|
|
74
|
+
tmpl: '',
|
|
75
|
+
};
|
|
76
|
+
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'templates'), projectRoot, templateVariables);
|
|
38
77
|
// Update .unisphere configuration
|
|
39
|
-
(0, utils_1.updateUnisphereConfig)(tree, 'documentation',
|
|
78
|
+
(0, utils_1.updateUnisphereConfig)(tree, 'documentation', fullDocumentationName, {
|
|
40
79
|
sourceRoot: projectRoot,
|
|
41
80
|
});
|
|
42
81
|
// Add documentation folder to .nxignore to prevent NX from scanning it
|
|
@@ -53,45 +92,45 @@ async function addDocumentationGenerator(tree, options) {
|
|
|
53
92
|
: `# Documentation site (Docusaurus) - has its own node_modules\n${ignoreEntry}\n`;
|
|
54
93
|
tree.write(nxIgnorePath, newContent);
|
|
55
94
|
}
|
|
95
|
+
// Copy .npmrc from workspace root so npm install can authenticate with private registries
|
|
96
|
+
const npmrcPath = '.npmrc';
|
|
97
|
+
if (tree.exists(npmrcPath)) {
|
|
98
|
+
const npmrcContent = tree.read(npmrcPath, 'utf-8');
|
|
99
|
+
if (npmrcContent) {
|
|
100
|
+
tree.write(`${projectRoot}/.npmrc`, npmrcContent);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
56
103
|
await (0, devkit_1.formatFiles)(tree);
|
|
57
|
-
|
|
104
|
+
devkit_1.logger.info('');
|
|
105
|
+
devkit_1.logger.info('Documentation site generated successfully!');
|
|
106
|
+
devkit_1.logger.info('');
|
|
107
|
+
devkit_1.logger.info(`Name: ${fullDocumentationName}`);
|
|
108
|
+
devkit_1.logger.info(`Type: Documentation Site (Docusaurus)`);
|
|
109
|
+
devkit_1.logger.info(`Location: ${projectRoot}`);
|
|
110
|
+
devkit_1.logger.info('');
|
|
111
|
+
if (options.skipInstall) {
|
|
112
|
+
devkit_1.logger.info('Skipping npm install (--skip-install).');
|
|
113
|
+
devkit_1.logger.info('');
|
|
114
|
+
devkit_1.logger.info(`To install: cd ${projectRoot} && npm install`);
|
|
115
|
+
devkit_1.logger.info(`To serve: npx unisphere documentation serve ${fullDocumentationName}`);
|
|
116
|
+
devkit_1.logger.info(`To build: npx unisphere documentation build ${fullDocumentationName}`);
|
|
117
|
+
devkit_1.logger.info('');
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
// Return callback to run npm install after the tree is flushed to disk
|
|
121
|
+
const workspaceRoot = tree.root;
|
|
58
122
|
return () => {
|
|
59
|
-
const workspaceRoot = process.cwd();
|
|
60
123
|
const fullProjectPath = path.join(workspaceRoot, projectRoot);
|
|
124
|
+
devkit_1.logger.info('Installing dependencies...');
|
|
61
125
|
devkit_1.logger.info('');
|
|
62
|
-
|
|
126
|
+
(0, child_process_1.execSync)('npm install', {
|
|
127
|
+
cwd: fullProjectPath,
|
|
128
|
+
stdio: 'inherit',
|
|
129
|
+
});
|
|
130
|
+
devkit_1.logger.info('');
|
|
131
|
+
devkit_1.logger.info(`To serve: npx unisphere documentation serve ${fullDocumentationName}`);
|
|
132
|
+
devkit_1.logger.info(`To build: npx unisphere documentation build ${fullDocumentationName}`);
|
|
63
133
|
devkit_1.logger.info('');
|
|
64
|
-
try {
|
|
65
|
-
// Create the parent directory if it doesn't exist
|
|
66
|
-
const parentDir = path.dirname(fullProjectPath);
|
|
67
|
-
if (!fs.existsSync(parentDir)) {
|
|
68
|
-
fs.mkdirSync(parentDir, { recursive: true });
|
|
69
|
-
}
|
|
70
|
-
// Run Docusaurus CLI to scaffold the project
|
|
71
|
-
// Docusaurus creates a self-contained project with its own package.json
|
|
72
|
-
// No NX integration needed - we just delegate to Docusaurus CLI for serve/build
|
|
73
|
-
// Use public npm registry explicitly (workspaces may have private registry configured)
|
|
74
|
-
devkit_1.logger.info('Running Docusaurus CLI...');
|
|
75
|
-
(0, child_process_1.execSync)(`npx --yes --registry https://registry.npmjs.org create-docusaurus@3 "${fullProjectPath}" classic --typescript`, {
|
|
76
|
-
stdio: 'inherit',
|
|
77
|
-
cwd: workspaceRoot,
|
|
78
|
-
});
|
|
79
|
-
devkit_1.logger.info('');
|
|
80
|
-
devkit_1.logger.info('Documentation site generated successfully!');
|
|
81
|
-
devkit_1.logger.info('');
|
|
82
|
-
devkit_1.logger.info(`Name: ${documentationNameAsLowerDashCase}`);
|
|
83
|
-
devkit_1.logger.info(`Type: Documentation Site (Docusaurus)`);
|
|
84
|
-
devkit_1.logger.info(`Location: ${projectRoot}`);
|
|
85
|
-
devkit_1.logger.info('');
|
|
86
|
-
devkit_1.logger.info(`To serve: npx unisphere documentation serve ${documentationNameAsLowerDashCase}`);
|
|
87
|
-
devkit_1.logger.info(`To build: npx unisphere documentation build ${documentationNameAsLowerDashCase}`);
|
|
88
|
-
devkit_1.logger.info('');
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
devkit_1.logger.error('Failed to create Docusaurus project:');
|
|
92
|
-
devkit_1.logger.error(error instanceof Error ? error.message : String(error));
|
|
93
|
-
throw error;
|
|
94
|
-
}
|
|
95
134
|
};
|
|
96
135
|
}
|
|
97
136
|
exports.default = addDocumentationGenerator;
|
|
@@ -6,16 +6,25 @@
|
|
|
6
6
|
"properties": {
|
|
7
7
|
"name": {
|
|
8
8
|
"type": "string",
|
|
9
|
-
"description": "
|
|
10
|
-
"pattern": "^[a-zA-Z][a-zA-Z0-9\\-\\s]*$"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
9
|
+
"description": "Experience name. Auto-resolved from .unisphere config if not provided.",
|
|
10
|
+
"pattern": "^[a-zA-Z][a-zA-Z0-9\\-\\s]*$"
|
|
11
|
+
},
|
|
12
|
+
"isExperienceLevel": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"description": "Whether this is an experience-level documentation site (no sub-name needed)",
|
|
15
|
+
"default": false
|
|
16
|
+
},
|
|
17
|
+
"subName": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Sub-name for the documentation site (used when not experience-level)",
|
|
20
|
+
"pattern": "^[a-zA-Z][a-zA-Z0-9\\-\\s]*$"
|
|
21
|
+
},
|
|
22
|
+
"skipInstall": {
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"description": "Internal: skip npm install (used by unisphere create)",
|
|
25
|
+
"default": false,
|
|
26
|
+
"x-internal": true
|
|
16
27
|
}
|
|
17
28
|
},
|
|
18
|
-
"required": [
|
|
19
|
-
"name"
|
|
20
|
-
]
|
|
29
|
+
"required": []
|
|
21
30
|
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { themes as prismThemes } from 'prism-react-renderer';
|
|
2
|
+
import type { Config } from '@docusaurus/types';
|
|
3
|
+
import type * as Preset from '@docusaurus/preset-classic';
|
|
4
|
+
|
|
5
|
+
const config: Config = {
|
|
6
|
+
<% if (hasSubName) { -%>
|
|
7
|
+
title: '<%= experienceName__humanReadable %> | <%= subNameKebab %> Documentation',
|
|
8
|
+
<% } else { -%>
|
|
9
|
+
title: '<%= experienceName__humanReadable %> Documentation',
|
|
10
|
+
<% } -%>
|
|
11
|
+
tagline: '',
|
|
12
|
+
favicon: 'img/favicon.ico',
|
|
13
|
+
|
|
14
|
+
url: 'https://docs.kaltura.com',
|
|
15
|
+
<% if (hasSubName) { -%>
|
|
16
|
+
baseUrl: '/_/<%= experienceName__lowerDashCase %>/<%= subNameKebab %>',
|
|
17
|
+
<% } else { -%>
|
|
18
|
+
baseUrl: '/<%= experienceName__lowerDashCase %>',
|
|
19
|
+
<% } -%>
|
|
20
|
+
|
|
21
|
+
onBrokenLinks: 'throw',
|
|
22
|
+
onBrokenMarkdownLinks: 'warn',
|
|
23
|
+
|
|
24
|
+
// Prevent search engine crawling and indexing
|
|
25
|
+
noIndex: true,
|
|
26
|
+
|
|
27
|
+
i18n: {
|
|
28
|
+
defaultLocale: 'en',
|
|
29
|
+
locales: ['en'],
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
presets: [
|
|
33
|
+
[
|
|
34
|
+
'classic',
|
|
35
|
+
{
|
|
36
|
+
docs: {
|
|
37
|
+
sidebarPath: './sidebars.ts',
|
|
38
|
+
exclude: [],
|
|
39
|
+
},
|
|
40
|
+
theme: {
|
|
41
|
+
customCss: './src/css/custom.css',
|
|
42
|
+
},
|
|
43
|
+
// Disable sitemap generation
|
|
44
|
+
sitemap: {
|
|
45
|
+
ignorePatterns: ['**'],
|
|
46
|
+
},
|
|
47
|
+
} satisfies Preset.Options,
|
|
48
|
+
],
|
|
49
|
+
],
|
|
50
|
+
plugins: [],
|
|
51
|
+
themes: [
|
|
52
|
+
'@docusaurus/theme-mermaid',
|
|
53
|
+
[
|
|
54
|
+
'@easyops-cn/docusaurus-search-local',
|
|
55
|
+
{
|
|
56
|
+
hashed: true,
|
|
57
|
+
indexBlog: false,
|
|
58
|
+
forceIgnoreNoIndex: true,
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
],
|
|
62
|
+
markdown: {
|
|
63
|
+
mermaid: true,
|
|
64
|
+
},
|
|
65
|
+
themeConfig: {
|
|
66
|
+
colorMode: {
|
|
67
|
+
defaultMode: 'light',
|
|
68
|
+
disableSwitch: false,
|
|
69
|
+
respectPrefersColorScheme: true,
|
|
70
|
+
},
|
|
71
|
+
image: 'img/social-card.png',
|
|
72
|
+
navbar: {
|
|
73
|
+
<% if (hasSubName) { -%>
|
|
74
|
+
title: '<%= experienceName__humanReadable %> | <%= subNameKebab %> Documentation',
|
|
75
|
+
<% } else { -%>
|
|
76
|
+
title: '<%= experienceName__humanReadable %> Documentation',
|
|
77
|
+
<% } -%>
|
|
78
|
+
logo: {
|
|
79
|
+
alt: 'Logo',
|
|
80
|
+
src: 'img/logo.svg',
|
|
81
|
+
srcDark: 'img/logo_dark.svg',
|
|
82
|
+
},
|
|
83
|
+
items: [
|
|
84
|
+
{
|
|
85
|
+
type: 'docSidebar',
|
|
86
|
+
sidebarId: 'gettingStarted',
|
|
87
|
+
position: 'left',
|
|
88
|
+
label: 'Getting Started',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: 'docSidebar',
|
|
92
|
+
sidebarId: 'api',
|
|
93
|
+
position: 'left',
|
|
94
|
+
label: 'API',
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: 'docSidebar',
|
|
98
|
+
sidebarId: 'changelog',
|
|
99
|
+
position: 'left',
|
|
100
|
+
label: 'Changelog',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
footer: {
|
|
105
|
+
style: 'dark',
|
|
106
|
+
links: [],
|
|
107
|
+
copyright: `Copyright © ${new Date().getFullYear()} Kaltura. Built with Docusaurus.`,
|
|
108
|
+
},
|
|
109
|
+
prism: {
|
|
110
|
+
theme: prismThemes.github,
|
|
111
|
+
darkTheme: prismThemes.dracula,
|
|
112
|
+
},
|
|
113
|
+
} satisfies Preset.ThemeConfig,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export default config;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= documentationName__lowerDashCase %>",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"docusaurus": "docusaurus",
|
|
7
|
+
"start": "docusaurus start",
|
|
8
|
+
"build": "docusaurus build",
|
|
9
|
+
"swizzle": "docusaurus swizzle",
|
|
10
|
+
"deploy": "docusaurus deploy",
|
|
11
|
+
"clear": "docusaurus clear",
|
|
12
|
+
"serve": "docusaurus serve",
|
|
13
|
+
"write-translations": "docusaurus write-translations",
|
|
14
|
+
"write-heading-ids": "docusaurus write-heading-ids",
|
|
15
|
+
"typecheck": "tsc"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@docusaurus/core": "^3.8.1",
|
|
19
|
+
"@docusaurus/preset-classic": "^3.8.1",
|
|
20
|
+
"@docusaurus/theme-mermaid": "^3.8.1",
|
|
21
|
+
"@easyops-cn/docusaurus-search-local": "^0.55.1",
|
|
22
|
+
"@heroicons/react": "^2.2.0",
|
|
23
|
+
"@mdx-js/react": "^3.0.0",
|
|
24
|
+
"@unisphere/notifications-core": "^1.24.0",
|
|
25
|
+
"@unisphere/runtime-js": "^1.83.0",
|
|
26
|
+
"autoprefixer": "^10.4.20",
|
|
27
|
+
"clsx": "^2.0.0",
|
|
28
|
+
"postcss": "^8.4.41",
|
|
29
|
+
"prism-react-renderer": "^2.3.0",
|
|
30
|
+
"react": "^18.0.0",
|
|
31
|
+
"react-dom": "^18.0.0",
|
|
32
|
+
"tailwindcss": "^3.4.10"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@docusaurus/module-type-aliases": "^3.8.1",
|
|
36
|
+
"@docusaurus/tsconfig": "^3.8.1",
|
|
37
|
+
"@docusaurus/types": "^3.8.1",
|
|
38
|
+
"docusaurus-plugin-typedoc": "^1.4.2",
|
|
39
|
+
"typedoc": "^0.28.17",
|
|
40
|
+
"typescript": "~5.2.2"
|
|
41
|
+
},
|
|
42
|
+
"browserslist": {
|
|
43
|
+
"production": [
|
|
44
|
+
">0.5%",
|
|
45
|
+
"not dead",
|
|
46
|
+
"not op_mini all"
|
|
47
|
+
],
|
|
48
|
+
"development": [
|
|
49
|
+
"last 3 chrome version",
|
|
50
|
+
"last 3 firefox version",
|
|
51
|
+
"last 5 safari version"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=18.0"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SidebarsConfig } from '@docusaurus/plugin-content-docs';
|
|
2
|
+
|
|
3
|
+
const sidebars: SidebarsConfig = {
|
|
4
|
+
gettingStarted: [{ type: 'autogenerated', dirName: 'getting-started' }],
|
|
5
|
+
api: [{ type: 'autogenerated', dirName: 'api' }],
|
|
6
|
+
changelog: [{ type: 'autogenerated', dirName: 'changelog' }],
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default sidebars;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PlaygroundCard } from '@site/src/components/ui-shared/playground-card';
|
|
3
|
+
|
|
4
|
+
const DemoPlaceholderCard: React.FC = () => {
|
|
5
|
+
const playIcon = (
|
|
6
|
+
<svg
|
|
7
|
+
width="48"
|
|
8
|
+
height="48"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
strokeWidth="1.5"
|
|
13
|
+
style={{
|
|
14
|
+
color: '#94a3b8',
|
|
15
|
+
opacity: 0.7
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
<circle cx="12" cy="12" r="10" />
|
|
19
|
+
<polygon points="10,8 16,12 10,16 10,8" />
|
|
20
|
+
</svg>
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<PlaygroundCard
|
|
25
|
+
title="Live Demonstration"
|
|
26
|
+
icon={playIcon}
|
|
27
|
+
>
|
|
28
|
+
A live demonstration will be added here soon
|
|
29
|
+
</PlaygroundCard>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export default DemoPlaceholderCard;
|