@unisphere/nx 4.15.7 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generators/utils.d.ts +2 -2
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/generators/utils.js +1 -1
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts +3 -4
- package/dist/migrations/3-15-0/add-experience-documentation.d.ts.map +1 -1
- package/dist/migrations/3-15-0/add-experience-documentation.js +4 -18
- package/dist/migrations/3-23-0/update-documentation-typedoc-plugins.d.ts +3 -6
- package/dist/migrations/3-23-0/update-documentation-typedoc-plugins.d.ts.map +1 -1
- package/dist/migrations/3-23-0/update-documentation-typedoc-plugins.js +4 -166
- package/dist/migrations/4-15-2/move-cli-to-dev-dependencies.d.ts +4 -0
- package/dist/migrations/4-15-2/move-cli-to-dev-dependencies.d.ts.map +1 -1
- package/dist/migrations/4-15-2/move-cli-to-dev-dependencies.js +70 -0
- package/dist/migrations/4-15-8/templates/_publish-artifacts.template +361 -0
- package/dist/migrations/4-15-8/update-publish-artifacts-workflow.d.ts +8 -0
- package/dist/migrations/4-15-8/update-publish-artifacts-workflow.d.ts.map +1 -0
- package/dist/migrations/4-15-8/update-publish-artifacts-workflow.js +40 -0
- package/dist/migrations/4-15-9/templates/_publish-artifacts.template +361 -0
- package/dist/migrations/4-15-9/update-publish-artifacts-workflow.d.ts +10 -0
- package/dist/migrations/4-15-9/update-publish-artifacts-workflow.d.ts.map +1 -0
- package/dist/migrations/4-15-9/update-publish-artifacts-workflow.js +42 -0
- package/dist/migrations/5-0-0/remove-documentation.d.ts +9 -0
- package/dist/migrations/5-0-0/remove-documentation.d.ts.map +1 -0
- package/dist/migrations/5-0-0/remove-documentation.js +45 -0
- package/generators.json +0 -5
- package/migrations.json +25 -0
- package/package.json +1 -1
- package/dist/generators/add-documentation/USAGE.md +0 -64
- package/dist/generators/add-documentation/add-documentation.d.ts +0 -5
- package/dist/generators/add-documentation/add-documentation.d.ts.map +0 -1
- package/dist/generators/add-documentation/add-documentation.js +0 -145
- package/dist/generators/add-documentation/discover-typedoc-plugins.d.ts +0 -23
- package/dist/generators/add-documentation/discover-typedoc-plugins.d.ts.map +0 -1
- package/dist/generators/add-documentation/discover-typedoc-plugins.js +0 -128
- package/dist/generators/add-documentation/schema.d.ts +0 -4
- package/dist/generators/add-documentation/schema.json +0 -20
- package/dist/generators/add-documentation/templates/babel.config.js +0 -3
- package/dist/generators/add-documentation/templates/docs/changelog/overview.md +0 -9
- package/dist/generators/add-documentation/templates/docs/documentations/overview.md +0 -9
- package/dist/generators/add-documentation/templates/docs/reference/overview.md +0 -9
- package/dist/generators/add-documentation/templates/docusaurus.config.ts.template +0 -134
- package/dist/generators/add-documentation/templates/package.json.template +0 -59
- package/dist/generators/add-documentation/templates/plugins/discover-typedoc-plugins.mjs +0 -156
- package/dist/generators/add-documentation/templates/plugins/typedoc-plugins.ts.template +0 -7
- package/dist/generators/add-documentation/templates/postcss.config.js +0 -6
- package/dist/generators/add-documentation/templates/sidebars.ts +0 -9
- package/dist/generators/add-documentation/templates/src/components/demo-placeholder-card.tsx +0 -33
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/genie/integrate-genie-guide.tsx +0 -149
- package/dist/generators/add-documentation/templates/src/components/guides/experiences/notifications/notifications-react-guide.tsx +0 -211
- package/dist/generators/add-documentation/templates/src/components/homepage-features/index.tsx +0 -141
- package/dist/generators/add-documentation/templates/src/components/homepage-features/styles.module.css +0 -87
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/index.tsx +0 -76
- package/dist/generators/add-documentation/templates/src/components/homepage-modules/styles.module.css +0 -120
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/index.tsx +0 -22
- package/dist/generators/add-documentation/templates/src/components/homepage-start-now/styles.module.css +0 -38
- package/dist/generators/add-documentation/templates/src/components/interactive-code-panel.tsx +0 -258
- package/dist/generators/add-documentation/templates/src/components/introductions/developer-toolbox-experience.tsx +0 -84
- package/dist/generators/add-documentation/templates/src/components/introductions/hello-world-experience.tsx +0 -133
- package/dist/generators/add-documentation/templates/src/components/introductions/notificaitons-experience.tsx +0 -635
- package/dist/generators/add-documentation/templates/src/components/introductions/reactions-experience.tsx +0 -117
- package/dist/generators/add-documentation/templates/src/components/ui-shared/introduction-card.tsx +0 -117
- package/dist/generators/add-documentation/templates/src/components/ui-shared/playground-card.tsx +0 -67
- package/dist/generators/add-documentation/templates/src/components/ui-shared/use-color-mode.ts +0 -20
- package/dist/generators/add-documentation/templates/src/components/ui-shared/utils.ts +0 -8
- package/dist/generators/add-documentation/templates/src/css/custom.css +0 -710
- package/dist/generators/add-documentation/templates/src/css/hero.module.css +0 -190
- package/dist/generators/add-documentation/templates/src/pages/index.module.css +0 -59
- package/dist/generators/add-documentation/templates/src/pages/index.tsx.template +0 -79
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/index.tsx +0 -103
- package/dist/generators/add-documentation/templates/src/theme/Navbar/Content/styles.module.css +0 -9
- package/dist/generators/add-documentation/templates/src/theme/Navbar/MobileSidebar/Header/index.tsx +0 -45
- package/dist/generators/add-documentation/templates/static/.nojekyll +0 -0
- package/dist/generators/add-documentation/templates/static/homepage/divider.svg +0 -5
- package/dist/generators/add-documentation/templates/static/homepage/icons/Architecture.svg +0 -4
- package/dist/generators/add-documentation/templates/static/homepage/icons/Cost.svg +0 -4
- package/dist/generators/add-documentation/templates/static/homepage/icons/ExternalLink.svg +0 -3
- package/dist/generators/add-documentation/templates/static/homepage/icons/Infra.svg +0 -8
- package/dist/generators/add-documentation/templates/static/homepage/icons/Redundancies.svg +0 -6
- package/dist/generators/add-documentation/templates/static/homepage/icons/Speed.svg +0 -6
- package/dist/generators/add-documentation/templates/static/homepage/icons/Standards.svg +0 -4
- package/dist/generators/add-documentation/templates/static/homepage/icons/Unified.svg +0 -12
- 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 +0 -6
- package/dist/generators/add-documentation/templates/static/img/logo_dark.svg +0 -6
- package/dist/generators/add-documentation/templates/static/robots.txt +0 -5
- package/dist/generators/add-documentation/templates/tailwind.config.js +0 -30
- package/dist/generators/add-documentation/templates/tsconfig.json +0 -7
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addDocumentationGenerator = addDocumentationGenerator;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const child_process_1 = require("child_process");
|
|
7
|
-
const path = tslib_1.__importStar(require("path"));
|
|
8
|
-
const utils_1 = require("../utils");
|
|
9
|
-
const discover_typedoc_plugins_1 = require("./discover-typedoc-plugins");
|
|
10
|
-
function validateOptions(options) {
|
|
11
|
-
if (options.subName) {
|
|
12
|
-
const subNamePattern = /^[a-zA-Z][a-zA-Z0-9\-\s]*$/;
|
|
13
|
-
if (!subNamePattern.test(options.subName)) {
|
|
14
|
-
throw new Error(`Invalid value '${options.subName}' for option 'subName'\n` +
|
|
15
|
-
` Pattern: ^[a-zA-Z][a-zA-Z0-9\\-\\s]*$\n` +
|
|
16
|
-
` Received: ${options.subName}`);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
async function addDocumentationGenerator(tree, options) {
|
|
21
|
-
// Validate options
|
|
22
|
-
validateOptions(options);
|
|
23
|
-
// Validate .unisphere configuration exists
|
|
24
|
-
const unisphereConfig = (0, utils_1.validateUnisphereConfig)(tree);
|
|
25
|
-
// Check workspace pattern for documentation apps
|
|
26
|
-
const rootPackageJsonPath = 'package.json';
|
|
27
|
-
if (tree.exists(rootPackageJsonPath)) {
|
|
28
|
-
const packageJson = JSON.parse(tree.read(rootPackageJsonPath, 'utf-8') || '{}');
|
|
29
|
-
const workspaces = packageJson.workspaces || [];
|
|
30
|
-
// Check if using the old catch-all pattern that doesn't work with documentation apps
|
|
31
|
-
const hasCatchAllPattern = workspaces.includes('unisphere/**');
|
|
32
|
-
if (hasCatchAllPattern) {
|
|
33
|
-
throw new Error('Documentation sites require @unisphere/nx version 3.1.0 or higher.\n\n' +
|
|
34
|
-
'Your workspace is using an old npm workspaces pattern that prevents documentation sites ' +
|
|
35
|
-
'from having their own node_modules.\n\n' +
|
|
36
|
-
'Please upgrade by running:\n' +
|
|
37
|
-
' npx nx migrate @unisphere/nx@latest\n' +
|
|
38
|
-
' npx nx migrate --run-migrations\n\n' +
|
|
39
|
-
'This will update your workspace pattern to support documentation sites.');
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
// Resolve experience name from .unisphere config
|
|
43
|
-
const documentationName = unisphereConfig.name;
|
|
44
|
-
const documentationNameAsLowerDashCase = (0, devkit_1.names)(documentationName).fileName;
|
|
45
|
-
devkit_1.logger.info(`Using experience name: ${documentationNameAsLowerDashCase}`);
|
|
46
|
-
// Build the full documentation name
|
|
47
|
-
const subNameAsLowerDashCase = options.subName ? (0, devkit_1.names)(options.subName).fileName : null;
|
|
48
|
-
const fullDocumentationName = subNameAsLowerDashCase
|
|
49
|
-
? `${documentationNameAsLowerDashCase}-${subNameAsLowerDashCase}`
|
|
50
|
-
: documentationNameAsLowerDashCase;
|
|
51
|
-
const projectRoot = `unisphere/documentation/${fullDocumentationName}`;
|
|
52
|
-
// Check if name already exists across all element types in .unisphere
|
|
53
|
-
(0, utils_1.validateElementNameUnique)(tree, fullDocumentationName, 'documentation');
|
|
54
|
-
// Check if documentation already exists on filesystem
|
|
55
|
-
if (tree.exists(projectRoot)) {
|
|
56
|
-
const docType = subNameAsLowerDashCase ? `sub-documentation "${subNameAsLowerDashCase}"` : 'main documentation';
|
|
57
|
-
throw new Error(`Documentation site already exists: ${docType} at ${projectRoot}.\n` +
|
|
58
|
-
'Please choose a different sub-name or remove the existing documentation site first.');
|
|
59
|
-
}
|
|
60
|
-
// Discover publishable packages for typedoc plugin auto-configuration
|
|
61
|
-
const discoveredPlugins = (0, discover_typedoc_plugins_1.discoverTypedocPlugins)(tree, projectRoot);
|
|
62
|
-
if (discoveredPlugins.length > 0) {
|
|
63
|
-
devkit_1.logger.info(`📚 Auto-discovered ${discoveredPlugins.length} package(s) for TypeDoc API documentation`);
|
|
64
|
-
}
|
|
65
|
-
// Generate files from template
|
|
66
|
-
const templateVariables = {
|
|
67
|
-
...(0, utils_1.createNameTransforms)(fullDocumentationName, 'documentationName'),
|
|
68
|
-
...(0, utils_1.createNameTransforms)(documentationNameAsLowerDashCase, 'experienceName'),
|
|
69
|
-
hasSubName: !!subNameAsLowerDashCase,
|
|
70
|
-
subNameKebab: subNameAsLowerDashCase || '',
|
|
71
|
-
typedocPluginsConfig: (0, discover_typedoc_plugins_1.buildTypedocPluginsCode)(discoveredPlugins),
|
|
72
|
-
tmpl: '',
|
|
73
|
-
};
|
|
74
|
-
(0, devkit_1.generateFiles)(tree, path.join(__dirname, 'templates'), projectRoot, templateVariables);
|
|
75
|
-
// Write .gitignore explicitly — npm strips .gitignore files from published packages
|
|
76
|
-
tree.write(`${projectRoot}/.gitignore`, `# Dependencies
|
|
77
|
-
node_modules
|
|
78
|
-
|
|
79
|
-
# Production
|
|
80
|
-
build
|
|
81
|
-
|
|
82
|
-
# Generated files
|
|
83
|
-
.docusaurus
|
|
84
|
-
.cache-loader
|
|
85
|
-
`);
|
|
86
|
-
// Update .unisphere configuration
|
|
87
|
-
(0, utils_1.updateUnisphereConfig)(tree, 'documentation', fullDocumentationName, {
|
|
88
|
-
sourceRoot: projectRoot,
|
|
89
|
-
});
|
|
90
|
-
// Add documentation folder to .nxignore to prevent NX from scanning it
|
|
91
|
-
// Docusaurus has its own node_modules which can slow down NX
|
|
92
|
-
const nxIgnorePath = '.nxignore';
|
|
93
|
-
const ignoreEntry = `${projectRoot}/node_modules`;
|
|
94
|
-
let nxIgnoreContent = '';
|
|
95
|
-
if (tree.exists(nxIgnorePath)) {
|
|
96
|
-
nxIgnoreContent = tree.read(nxIgnorePath, 'utf-8') || '';
|
|
97
|
-
}
|
|
98
|
-
if (!nxIgnoreContent.includes(ignoreEntry)) {
|
|
99
|
-
const newContent = nxIgnoreContent
|
|
100
|
-
? `${nxIgnoreContent.trimEnd()}\n\n# Documentation site (Docusaurus) - has its own node_modules\n${ignoreEntry}\n`
|
|
101
|
-
: `# Documentation site (Docusaurus) - has its own node_modules\n${ignoreEntry}\n`;
|
|
102
|
-
tree.write(nxIgnorePath, newContent);
|
|
103
|
-
}
|
|
104
|
-
// Copy .npmrc from workspace root so npm install can authenticate with private registries
|
|
105
|
-
const npmrcPath = '.npmrc';
|
|
106
|
-
if (tree.exists(npmrcPath)) {
|
|
107
|
-
const npmrcContent = tree.read(npmrcPath, 'utf-8');
|
|
108
|
-
if (npmrcContent) {
|
|
109
|
-
tree.write(`${projectRoot}/.npmrc`, npmrcContent);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
113
|
-
devkit_1.logger.info('');
|
|
114
|
-
devkit_1.logger.info('Documentation site generated successfully!');
|
|
115
|
-
devkit_1.logger.info('');
|
|
116
|
-
devkit_1.logger.info(`Name: ${fullDocumentationName}`);
|
|
117
|
-
devkit_1.logger.info(`Type: Documentation Site (Docusaurus)`);
|
|
118
|
-
devkit_1.logger.info(`Location: ${projectRoot}`);
|
|
119
|
-
devkit_1.logger.info('');
|
|
120
|
-
if (options.skipInstall) {
|
|
121
|
-
devkit_1.logger.info('Skipping npm install (--skip-install).');
|
|
122
|
-
devkit_1.logger.info('');
|
|
123
|
-
devkit_1.logger.info(`To install: cd ${projectRoot} && npm install`);
|
|
124
|
-
devkit_1.logger.info(`To serve: npx unisphere documentation serve ${fullDocumentationName}`);
|
|
125
|
-
devkit_1.logger.info(`To build: npx unisphere documentation build ${fullDocumentationName}`);
|
|
126
|
-
devkit_1.logger.info('');
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
// Return callback to run npm install after the tree is flushed to disk
|
|
130
|
-
const workspaceRoot = tree.root;
|
|
131
|
-
return () => {
|
|
132
|
-
const fullProjectPath = path.join(workspaceRoot, projectRoot);
|
|
133
|
-
devkit_1.logger.info('Installing dependencies...');
|
|
134
|
-
devkit_1.logger.info('');
|
|
135
|
-
(0, child_process_1.execSync)('npm install', {
|
|
136
|
-
cwd: fullProjectPath,
|
|
137
|
-
stdio: 'inherit',
|
|
138
|
-
});
|
|
139
|
-
devkit_1.logger.info('');
|
|
140
|
-
devkit_1.logger.info(`To serve: npx unisphere documentation serve ${fullDocumentationName}`);
|
|
141
|
-
devkit_1.logger.info(`To build: npx unisphere documentation build ${fullDocumentationName}`);
|
|
142
|
-
devkit_1.logger.info('');
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
exports.default = addDocumentationGenerator;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
2
|
-
interface TypdocPluginConfig {
|
|
3
|
-
id: string;
|
|
4
|
-
packageName: string;
|
|
5
|
-
entryPointsRelative: string;
|
|
6
|
-
tsconfigRelative: string;
|
|
7
|
-
out: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Discovers publishable packages from .unisphere config and generates
|
|
11
|
-
* docusaurus-plugin-typedoc configuration entries.
|
|
12
|
-
*
|
|
13
|
-
* Excludes packages whose sourceRoot contains '/local/' (internal packages).
|
|
14
|
-
* The docsProjectRoot is used to compute relative paths (e.g. "unisphere/documentation/genie").
|
|
15
|
-
*/
|
|
16
|
-
export declare function discoverTypedocPlugins(tree: Tree, docsProjectRoot: string): TypdocPluginConfig[];
|
|
17
|
-
/**
|
|
18
|
-
* Serialises the discovered plugin configs into a TypeScript source fragment
|
|
19
|
-
* suitable for injection into docusaurus.config.ts via EJS (<%- typedocPluginsConfig %>).
|
|
20
|
-
*/
|
|
21
|
-
export declare function buildTypedocPluginsCode(plugins: TypdocPluginConfig[]): string;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=discover-typedoc-plugins.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"discover-typedoc-plugins.d.ts","sourceRoot":"","sources":["../../../src/generators/add-documentation/discover-typedoc-plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AAepD,UAAU,kBAAkB;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;CACb;AAsCD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,eAAe,EAAE,MAAM,GACtB,kBAAkB,EAAE,CAkDtB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAyB7E"}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.discoverTypedocPlugins = discoverTypedocPlugins;
|
|
4
|
-
exports.buildTypedocPluginsCode = buildTypedocPluginsCode;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const path = tslib_1.__importStar(require("path"));
|
|
8
|
-
/**
|
|
9
|
-
* Non-local scopes whose packages should be documented.
|
|
10
|
-
* Packages under 'local' are internal-only and excluded.
|
|
11
|
-
*/
|
|
12
|
-
const DOCUMENTED_SCOPES = [
|
|
13
|
-
'kaltura-corp',
|
|
14
|
-
'kaltura-apps',
|
|
15
|
-
'kaltura-ui',
|
|
16
|
-
'kaltura-sdk',
|
|
17
|
-
'unisphere',
|
|
18
|
-
];
|
|
19
|
-
/**
|
|
20
|
-
* Returns the npm package name for a given sourceRoot by looking up
|
|
21
|
-
* tsconfig.base.json paths.
|
|
22
|
-
* e.g. sourceRoot "unisphere/packages/kaltura-corp/shared-react"
|
|
23
|
-
* → "@kaltura-corp/unisphere-genie-shared-react"
|
|
24
|
-
*/
|
|
25
|
-
function findPackageName(tree, sourceRoot) {
|
|
26
|
-
if (!tree.exists('tsconfig.base.json'))
|
|
27
|
-
return null;
|
|
28
|
-
try {
|
|
29
|
-
const tsconfig = (0, devkit_1.readJson)(tree, 'tsconfig.base.json');
|
|
30
|
-
const paths = tsconfig?.compilerOptions?.paths ?? {};
|
|
31
|
-
const expectedPath = `${sourceRoot}/src/index.ts`;
|
|
32
|
-
for (const [alias, pathList] of Object.entries(paths)) {
|
|
33
|
-
if (Array.isArray(pathList) && pathList.includes(expectedPath)) {
|
|
34
|
-
return alias;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
// ignore
|
|
40
|
-
}
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Derives a short plugin id from an npm package name.
|
|
45
|
-
* "@kaltura-corp/unisphere-genie-shared-react" → "unisphere-genie-shared-react"
|
|
46
|
-
* "@unisphere/genie-types" → "genie-types"
|
|
47
|
-
*/
|
|
48
|
-
function shortName(packageName) {
|
|
49
|
-
const parts = packageName.split('/');
|
|
50
|
-
return parts[parts.length - 1];
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Discovers publishable packages from .unisphere config and generates
|
|
54
|
-
* docusaurus-plugin-typedoc configuration entries.
|
|
55
|
-
*
|
|
56
|
-
* Excludes packages whose sourceRoot contains '/local/' (internal packages).
|
|
57
|
-
* The docsProjectRoot is used to compute relative paths (e.g. "unisphere/documentation/genie").
|
|
58
|
-
*/
|
|
59
|
-
function discoverTypedocPlugins(tree, docsProjectRoot) {
|
|
60
|
-
if (!tree.exists('.unisphere'))
|
|
61
|
-
return [];
|
|
62
|
-
let config;
|
|
63
|
-
try {
|
|
64
|
-
config = (0, devkit_1.readJson)(tree, '.unisphere');
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
return [];
|
|
68
|
-
}
|
|
69
|
-
const packages = config?.elements?.packages ?? {};
|
|
70
|
-
const plugins = [];
|
|
71
|
-
for (const [, pkgConfig] of Object.entries(packages)) {
|
|
72
|
-
const sourceRoot = pkgConfig?.sourceRoot;
|
|
73
|
-
if (!sourceRoot)
|
|
74
|
-
continue;
|
|
75
|
-
// Determine the scope directory from the sourceRoot path
|
|
76
|
-
// Expected: unisphere/packages/<scope>/<name>
|
|
77
|
-
const parts = sourceRoot.split('/');
|
|
78
|
-
if (parts.length < 4)
|
|
79
|
-
continue;
|
|
80
|
-
const scope = parts[2]; // e.g. "local", "kaltura-corp", "unisphere"
|
|
81
|
-
if (!DOCUMENTED_SCOPES.includes(scope))
|
|
82
|
-
continue;
|
|
83
|
-
const packageName = findPackageName(tree, sourceRoot);
|
|
84
|
-
if (!packageName) {
|
|
85
|
-
devkit_1.logger.warn(`⚠️ Could not find npm package name for ${sourceRoot} — skipping in typedoc plugins`);
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
const short = shortName(packageName);
|
|
89
|
-
// Relative path from docs site root to the package
|
|
90
|
-
// docsProjectRoot: "unisphere/documentation/genie"
|
|
91
|
-
// sourceRoot: "unisphere/packages/kaltura-corp/shared-react"
|
|
92
|
-
const relativeBase = path.relative(docsProjectRoot, sourceRoot).replace(/\\/g, '/');
|
|
93
|
-
plugins.push({
|
|
94
|
-
id: `api-${short}`,
|
|
95
|
-
packageName,
|
|
96
|
-
entryPointsRelative: `${relativeBase}/src/index.ts`,
|
|
97
|
-
tsconfigRelative: `${relativeBase}/tsconfig.json`,
|
|
98
|
-
out: `docs/api/${short}/v1`,
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
return plugins;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Serialises the discovered plugin configs into a TypeScript source fragment
|
|
105
|
-
* suitable for injection into docusaurus.config.ts via EJS (<%- typedocPluginsConfig %>).
|
|
106
|
-
*/
|
|
107
|
-
function buildTypedocPluginsCode(plugins) {
|
|
108
|
-
if (plugins.length === 0)
|
|
109
|
-
return '[]';
|
|
110
|
-
const entries = plugins
|
|
111
|
-
.map((p) => `\n // ${p.packageName}\n` +
|
|
112
|
-
` [\n` +
|
|
113
|
-
` 'docusaurus-plugin-typedoc',\n` +
|
|
114
|
-
` {\n` +
|
|
115
|
-
` id: '${p.id}',\n` +
|
|
116
|
-
` entryPoints: ['${p.entryPointsRelative}'],\n` +
|
|
117
|
-
` tsconfig: '${p.tsconfigRelative}',\n` +
|
|
118
|
-
` out: '${p.out}',\n` +
|
|
119
|
-
` readme: 'none',\n` +
|
|
120
|
-
` excludePrivate: true,\n` +
|
|
121
|
-
` excludeProtected: true,\n` +
|
|
122
|
-
` excludeInternal: true,\n` +
|
|
123
|
-
` disableSources: true,\n` +
|
|
124
|
-
` },\n` +
|
|
125
|
-
` ]`)
|
|
126
|
-
.join(',');
|
|
127
|
-
return `[${entries},\n ]`;
|
|
128
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"$id": "AddDocumentation",
|
|
4
|
-
"title": "Add Documentation Generator",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"subName": {
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "Sub-name for the documentation site. If not provided, creates the main experience-level documentation.",
|
|
10
|
-
"pattern": "^[a-zA-Z][a-zA-Z0-9\\-\\s]*$"
|
|
11
|
-
},
|
|
12
|
-
"skipInstall": {
|
|
13
|
-
"type": "boolean",
|
|
14
|
-
"description": "Internal: skip npm install (used by unisphere create)",
|
|
15
|
-
"default": false,
|
|
16
|
-
"x-internal": true
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"required": []
|
|
20
|
-
}
|
|
@@ -1,134 +0,0 @@
|
|
|
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
|
-
import typedocPlugins from './plugins/typedoc-plugins';
|
|
5
|
-
|
|
6
|
-
const config: Config = {
|
|
7
|
-
<% if (hasSubName) { -%>
|
|
8
|
-
title: '<%= experienceName__humanReadable %> | <%= subNameKebab %> Documentation',
|
|
9
|
-
<% } else { -%>
|
|
10
|
-
title: '<%= experienceName__humanReadable %> Documentation',
|
|
11
|
-
<% } -%>
|
|
12
|
-
tagline: '',
|
|
13
|
-
favicon: 'img/favicon.ico',
|
|
14
|
-
|
|
15
|
-
url: 'https://docs.kaltura.com',
|
|
16
|
-
<% if (hasSubName) { -%>
|
|
17
|
-
baseUrl: '/_/<%= experienceName__lowerDashCase %>/<%= subNameKebab %>',
|
|
18
|
-
<% } else { -%>
|
|
19
|
-
baseUrl: '/<%= experienceName__lowerDashCase %>',
|
|
20
|
-
<% } -%>
|
|
21
|
-
|
|
22
|
-
onBrokenLinks: 'warn',
|
|
23
|
-
onBrokenMarkdownLinks: 'warn',
|
|
24
|
-
|
|
25
|
-
noIndex: true,
|
|
26
|
-
|
|
27
|
-
i18n: {
|
|
28
|
-
defaultLocale: 'en',
|
|
29
|
-
locales: ['en'],
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
presets: [
|
|
33
|
-
[
|
|
34
|
-
'classic',
|
|
35
|
-
{
|
|
36
|
-
docs: false,
|
|
37
|
-
blog: false,
|
|
38
|
-
theme: {
|
|
39
|
-
customCss: './src/css/custom.css',
|
|
40
|
-
},
|
|
41
|
-
sitemap: {
|
|
42
|
-
ignorePatterns: ['**'],
|
|
43
|
-
},
|
|
44
|
-
} satisfies Preset.Options,
|
|
45
|
-
],
|
|
46
|
-
],
|
|
47
|
-
plugins: [
|
|
48
|
-
[
|
|
49
|
-
'@docusaurus/plugin-content-docs',
|
|
50
|
-
{
|
|
51
|
-
path: 'docs/documentations',
|
|
52
|
-
routeBasePath: 'documentations',
|
|
53
|
-
sidebarPath: './sidebars.ts',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
[
|
|
57
|
-
'@docusaurus/plugin-content-docs',
|
|
58
|
-
{
|
|
59
|
-
id: 'reference',
|
|
60
|
-
path: 'docs/reference',
|
|
61
|
-
routeBasePath: 'reference',
|
|
62
|
-
sidebarPath: './sidebars.ts',
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
[
|
|
66
|
-
'@docusaurus/plugin-content-docs',
|
|
67
|
-
{
|
|
68
|
-
id: 'changelog',
|
|
69
|
-
path: 'docs/changelog',
|
|
70
|
-
routeBasePath: 'changelog',
|
|
71
|
-
sidebarPath: './sidebars.ts',
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
...typedocPlugins,
|
|
75
|
-
],
|
|
76
|
-
themes: [
|
|
77
|
-
'@docusaurus/theme-mermaid',
|
|
78
|
-
[
|
|
79
|
-
'@easyops-cn/docusaurus-search-local',
|
|
80
|
-
{
|
|
81
|
-
hashed: true,
|
|
82
|
-
indexBlog: false,
|
|
83
|
-
forceIgnoreNoIndex: true,
|
|
84
|
-
docsRouteBasePath: ['documentations', 'reference', 'changelog'],
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
],
|
|
88
|
-
markdown: {
|
|
89
|
-
mermaid: true,
|
|
90
|
-
},
|
|
91
|
-
themeConfig: {
|
|
92
|
-
colorMode: {
|
|
93
|
-
defaultMode: 'light',
|
|
94
|
-
disableSwitch: false,
|
|
95
|
-
respectPrefersColorScheme: true,
|
|
96
|
-
},
|
|
97
|
-
image: 'img/social-card.png',
|
|
98
|
-
navbar: {
|
|
99
|
-
<% if (hasSubName) { -%>
|
|
100
|
-
title: '<%= experienceName__humanReadable %> | <%= subNameKebab %>',
|
|
101
|
-
<% } else { -%>
|
|
102
|
-
title: '<%= experienceName__humanReadable %>',
|
|
103
|
-
<% } -%>
|
|
104
|
-
logo: {
|
|
105
|
-
alt: 'Logo',
|
|
106
|
-
src: 'img/logo.svg',
|
|
107
|
-
srcDark: 'img/logo_dark.svg',
|
|
108
|
-
},
|
|
109
|
-
items: [
|
|
110
|
-
{
|
|
111
|
-
to: 'documentations/overview',
|
|
112
|
-
label: 'Documentations',
|
|
113
|
-
position: 'left',
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
to: 'reference/overview',
|
|
117
|
-
label: 'Reference',
|
|
118
|
-
position: 'left',
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
to: 'changelog/overview',
|
|
122
|
-
label: 'Changelog',
|
|
123
|
-
position: 'left',
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
},
|
|
127
|
-
prism: {
|
|
128
|
-
theme: prismThemes.github,
|
|
129
|
-
darkTheme: prismThemes.dracula,
|
|
130
|
-
},
|
|
131
|
-
} satisfies Preset.ThemeConfig,
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
export default config;
|
|
@@ -1,59 +0,0 @@
|
|
|
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
|
-
"clear": "docusaurus clear",
|
|
10
|
-
"serve": "docusaurus serve",
|
|
11
|
-
"write-heading-ids": "docusaurus write-heading-ids",
|
|
12
|
-
"typecheck": "tsc",
|
|
13
|
-
"discover-plugins": "node plugins/discover-typedoc-plugins.mjs"
|
|
14
|
-
},
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@docusaurus/core": "^3.8.1",
|
|
17
|
-
"@docusaurus/preset-classic": "^3.8.1",
|
|
18
|
-
"@docusaurus/theme-mermaid": "^3.8.1",
|
|
19
|
-
"@easyops-cn/docusaurus-search-local": "^0.55.1",
|
|
20
|
-
"@heroicons/react": "^2.2.0",
|
|
21
|
-
"@mdx-js/react": "^3.0.0",
|
|
22
|
-
"@unisphere/notifications-core": "^1.24.0",
|
|
23
|
-
"@unisphere/runtime-js": "^1.83.0",
|
|
24
|
-
"autoprefixer": "^10.4.20",
|
|
25
|
-
"clsx": "^2.0.0",
|
|
26
|
-
"postcss": "^8.4.41",
|
|
27
|
-
"prism-react-renderer": "^2.3.0",
|
|
28
|
-
"react": "^18.0.0",
|
|
29
|
-
"react-dom": "^18.0.0",
|
|
30
|
-
"tailwindcss": "^3.4.10"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@docusaurus/module-type-aliases": "^3.8.1",
|
|
34
|
-
"@docusaurus/tsconfig": "^3.8.1",
|
|
35
|
-
"@docusaurus/types": "^3.8.1",
|
|
36
|
-
"docusaurus-plugin-typedoc": "^1.4.2",
|
|
37
|
-
"typedoc": "^0.28.17",
|
|
38
|
-
"typedoc-plugin-markdown": "^4.8.0",
|
|
39
|
-
"typescript": "~5.2.2"
|
|
40
|
-
},
|
|
41
|
-
"browserslist": {
|
|
42
|
-
"production": [
|
|
43
|
-
">0.5%",
|
|
44
|
-
"not dead",
|
|
45
|
-
"not op_mini all"
|
|
46
|
-
],
|
|
47
|
-
"development": [
|
|
48
|
-
"last 3 chrome version",
|
|
49
|
-
"last 3 firefox version",
|
|
50
|
-
"last 5 safari version"
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
"engines": {
|
|
54
|
-
"node": ">=18.0"
|
|
55
|
-
},
|
|
56
|
-
"overrides": {
|
|
57
|
-
"webpack": "5.105.4"
|
|
58
|
-
}
|
|
59
|
-
}
|