@unisphere/nx 2.1.0 → 2.1.3
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-package/README.md +3 -3
- package/dist/migrations/1-22-0/check-nx-version.js +1 -1
- package/dist/migrations/1-22-0/replace-patches.d.ts.map +1 -1
- package/dist/migrations/1-22-0/replace-patches.js +1 -2
- package/dist/migrations/1-22-2/templates/cicd.template +1 -1
- package/dist/migrations/1-22-4/summary.d.ts.map +1 -1
- package/dist/migrations/1-22-4/summary.js +7 -2
- package/dist/migrations/{2-0-0/replace-patches.d.ts → 1-22-7/remove-storybook.d.ts} +1 -1
- package/dist/migrations/1-22-7/remove-storybook.d.ts.map +1 -0
- package/dist/migrations/1-22-7/remove-storybook.js +114 -0
- package/dist/migrations/1-22-7/update-git-ignore.d.ts +3 -0
- package/dist/migrations/1-22-7/update-git-ignore.d.ts.map +1 -0
- package/dist/migrations/1-22-7/update-git-ignore.js +55 -0
- package/dist/migrations/1-22-9/fix-prerelease-deploy.d.ts +3 -0
- package/dist/migrations/1-22-9/fix-prerelease-deploy.d.ts.map +1 -0
- package/dist/migrations/1-22-9/fix-prerelease-deploy.js +27 -0
- package/dist/migrations/1-22-9/templates/cicd.template +79 -0
- package/dist/migrations/1-23-0/delete-rollup-patch.d.ts +3 -0
- package/dist/migrations/1-23-0/delete-rollup-patch.d.ts.map +1 -0
- package/dist/migrations/1-23-0/delete-rollup-patch.js +14 -0
- package/dist/migrations/1-23-2/update-nvmrc.d.ts.map +1 -0
- package/dist/migrations/1-24-2/force-always-for-applications.d.ts +3 -0
- package/dist/migrations/1-24-2/force-always-for-applications.d.ts.map +1 -0
- package/dist/migrations/1-24-2/force-always-for-applications.js +36 -0
- package/dist/migrations/1-24-2/templates/_publish-artifacts.template +306 -0
- package/dist/migrations/2-0-0/summary.d.ts.map +1 -1
- package/dist/migrations/2-0-0/summary.js +7 -2
- package/dist/migrations/utils/open.d.ts +2 -0
- package/dist/migrations/utils/open.d.ts.map +1 -0
- package/dist/migrations/utils/open.js +16 -0
- package/migrations.json +57 -16
- package/package.json +2 -2
- package/dist/migrations/1-22-0/patches/@nx+rollup+22.1.3.patch +0 -27
- package/dist/migrations/2-0-0/patches/@nx+rollup+22.1.3.patch +0 -27
- package/dist/migrations/2-0-0/replace-patches.d.ts.map +0 -1
- package/dist/migrations/2-0-0/replace-patches.js +0 -56
- package/dist/migrations/2-0-0/update-nvmrc.d.ts.map +0 -1
- /package/dist/migrations/{2-0-0 → 1-23-2}/update-nvmrc.d.ts +0 -0
- /package/dist/migrations/{2-0-0 → 1-23-2}/update-nvmrc.js +0 -0
|
@@ -50,7 +50,7 @@ After packaging, install in your target repository:
|
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
# Install the generated package
|
|
53
|
-
npm install --save-dev path/to/unisphere-nx-
|
|
53
|
+
npm install --save-dev path/to/unisphere-nx-unisphere-generator-0.0.1.tgz
|
|
54
54
|
|
|
55
55
|
# Use the generator
|
|
56
56
|
npx nx g @unisphere/nx:add-package
|
|
@@ -61,10 +61,10 @@ npx nx g @unisphere/nx:add-package
|
|
|
61
61
|
1. **Direct file path** (for development):
|
|
62
62
|
|
|
63
63
|
```bash
|
|
64
|
-
npm install --save-dev file:../path/to/unisphere-nx
|
|
64
|
+
npm install --save-dev file:../path/to/unisphere-nx/unisphere-generator
|
|
65
65
|
```
|
|
66
66
|
|
|
67
67
|
2. **Using npx directly**:
|
|
68
68
|
```bash
|
|
69
|
-
npx --package file:../unisphere-nx
|
|
69
|
+
npx --package file:../unisphere-nx/unisphere-generator nx g @unisphere/nx:add-package
|
|
70
70
|
```
|
|
@@ -12,7 +12,7 @@ function checkNxVersion(tree) {
|
|
|
12
12
|
}
|
|
13
13
|
const majorVersion = parseInt(nxVersion.match(/\d+/)?.[0] ?? '0');
|
|
14
14
|
if (majorVersion < 22) {
|
|
15
|
-
const errorMessage = `❌ This migration requires Nx 22 or higher. read https://unisphere.kaltura.com/docs/create/changelog/1-22-
|
|
15
|
+
const errorMessage = `❌ This migration requires Nx 22 or higher. read https://unisphere.kaltura.com/docs/create/changelog/1-22-7-changelog`;
|
|
16
16
|
devkit_1.logger.error(errorMessage);
|
|
17
17
|
throw new Error(errorMessage);
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace-patches.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/replace-patches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"replace-patches.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/replace-patches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmC,MAAM,YAAY,CAAC;AAQnE,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwD9D"}
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = update;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const path_1 = require("path");
|
|
6
|
-
const removePatchList = ['
|
|
6
|
+
const removePatchList = ['@changesets+cli'];
|
|
7
7
|
const forcePatchVersions = {
|
|
8
|
-
'@nx/rollup': '22.1.3',
|
|
9
8
|
'@changesets/cli': '2.29.7'
|
|
10
9
|
};
|
|
11
10
|
async function update(tree) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-4/summary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-4/summary.ts"],"names":[],"mappings":"AAIA,0CAUC"}
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const open_1 = require("../utils/open");
|
|
6
|
+
const url = 'https://unisphere.kaltura.com/docs/create/changelog/v1-x-major-release';
|
|
5
7
|
async function default_1() {
|
|
6
8
|
devkit_1.logger.info('');
|
|
7
|
-
devkit_1.logger.info('🎉 Migration to
|
|
9
|
+
devkit_1.logger.info('🎉 Migration to Major 1 finished successfully!');
|
|
8
10
|
devkit_1.logger.info('');
|
|
9
11
|
devkit_1.logger.info('📋 Full details:');
|
|
10
|
-
devkit_1.logger.info(
|
|
12
|
+
devkit_1.logger.info(url);
|
|
13
|
+
devkit_1.logger.info('');
|
|
14
|
+
(0, open_1.openBrowser)(url);
|
|
15
|
+
devkit_1.logger.info('Opening changelog in browser...');
|
|
11
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-storybook.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-7/remove-storybook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAEtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAsI9D"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
async function update(tree) {
|
|
6
|
+
devkit_1.logger.info('🔄 Removing Storybook files and dependencies...');
|
|
7
|
+
let removedItems = 0;
|
|
8
|
+
// 1. Remove storybook folder if it exists
|
|
9
|
+
if (tree.exists('storybook')) {
|
|
10
|
+
tree.delete('storybook');
|
|
11
|
+
devkit_1.logger.info('📁 Removed storybook folder');
|
|
12
|
+
removedItems++;
|
|
13
|
+
}
|
|
14
|
+
// 2. Remove storybook dependencies from package.json
|
|
15
|
+
const packageJsonPath = 'package.json';
|
|
16
|
+
if (tree.exists(packageJsonPath)) {
|
|
17
|
+
try {
|
|
18
|
+
(0, devkit_1.updateJson)(tree, packageJsonPath, (packageJson) => {
|
|
19
|
+
let dependenciesRemoved = 0;
|
|
20
|
+
// Remove from dependencies
|
|
21
|
+
if (packageJson.dependencies) {
|
|
22
|
+
const depsToRemove = Object.keys(packageJson.dependencies).filter(dep => dep === 'storybook' || dep.startsWith('@storybook/') || dep === '@nx/storybook');
|
|
23
|
+
depsToRemove.forEach(dep => {
|
|
24
|
+
delete packageJson.dependencies[dep];
|
|
25
|
+
dependenciesRemoved++;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
// Remove from devDependencies
|
|
29
|
+
if (packageJson.devDependencies) {
|
|
30
|
+
const devDepsToRemove = Object.keys(packageJson.devDependencies).filter(dep => dep === 'storybook' || dep.startsWith('@storybook/'));
|
|
31
|
+
devDepsToRemove.forEach(dep => {
|
|
32
|
+
delete packageJson.devDependencies[dep];
|
|
33
|
+
dependenciesRemoved++;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
// Remove from peerDependencies
|
|
37
|
+
if (packageJson.peerDependencies) {
|
|
38
|
+
const peerDepsToRemove = Object.keys(packageJson.peerDependencies).filter(dep => dep === 'storybook' || dep.startsWith('@storybook/'));
|
|
39
|
+
peerDepsToRemove.forEach(dep => {
|
|
40
|
+
delete packageJson.peerDependencies[dep];
|
|
41
|
+
dependenciesRemoved++;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (dependenciesRemoved > 0) {
|
|
45
|
+
devkit_1.logger.info(`📦 Removed ${dependenciesRemoved} Storybook dependencies from package.json`);
|
|
46
|
+
removedItems++;
|
|
47
|
+
}
|
|
48
|
+
return packageJson;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
53
|
+
devkit_1.logger.warn(`⚠️ Could not update package.json: ${errorMessage}`);
|
|
54
|
+
throw new Error(`⚠️ Could not update package.json: ${errorMessage}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// 3. Remove storybook paths from tsconfig.base.json
|
|
58
|
+
const tsconfigPath = 'tsconfig.base.json';
|
|
59
|
+
if (tree.exists(tsconfigPath)) {
|
|
60
|
+
try {
|
|
61
|
+
(0, devkit_1.updateJson)(tree, tsconfigPath, (tsconfig) => {
|
|
62
|
+
let pathsRemoved = 0;
|
|
63
|
+
if (tsconfig.compilerOptions?.paths) {
|
|
64
|
+
const pathsToRemove = Object.entries(tsconfig.compilerOptions.paths).filter(([key, paths]) => paths.some(path => path.startsWith('storybook/'))).map(([key]) => key);
|
|
65
|
+
pathsToRemove.forEach(key => {
|
|
66
|
+
delete tsconfig.compilerOptions.paths[key];
|
|
67
|
+
pathsRemoved++;
|
|
68
|
+
});
|
|
69
|
+
if (pathsRemoved > 0) {
|
|
70
|
+
devkit_1.logger.info(`� Removed ${pathsRemoved} Storybook paths from tsconfig.base.json`);
|
|
71
|
+
removedItems++;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return tsconfig;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
79
|
+
throw new Error(`⚠️ Could not update tsconfig.base.json: ${errorMessage}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// 4. Remove @nx/storybook plugin from nx.json
|
|
83
|
+
const nxJsonPath = 'nx.json';
|
|
84
|
+
if (tree.exists(nxJsonPath)) {
|
|
85
|
+
try {
|
|
86
|
+
(0, devkit_1.updateJson)(tree, nxJsonPath, (nxJson) => {
|
|
87
|
+
let pluginsRemoved = 0;
|
|
88
|
+
if (nxJson.plugins && Array.isArray(nxJson.plugins)) {
|
|
89
|
+
const originalLength = nxJson.plugins.length;
|
|
90
|
+
nxJson.plugins = nxJson.plugins.filter((plugin) => {
|
|
91
|
+
const pluginName = typeof plugin === 'string' ? plugin : plugin.plugin;
|
|
92
|
+
return pluginName !== '@nx/storybook/plugin' && pluginName !== '@nx/storybook';
|
|
93
|
+
});
|
|
94
|
+
pluginsRemoved = originalLength - nxJson.plugins.length;
|
|
95
|
+
if (pluginsRemoved > 0) {
|
|
96
|
+
devkit_1.logger.info(`🔌 Removed ${pluginsRemoved} Storybook plugin(s) from nx.json`);
|
|
97
|
+
removedItems++;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return nxJson;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
105
|
+
throw new Error(`⚠️ Could not update nx.json: ${errorMessage}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (removedItems === 0) {
|
|
109
|
+
devkit_1.logger.info('ℹ️ No Storybook files, dependencies, or paths found to remove');
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
devkit_1.logger.info(`✅ Successfully removed Storybook components (${removedItems} operations completed)`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-git-ignore.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-7/update-git-ignore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAE1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD9D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
async function update(tree) {
|
|
6
|
+
devkit_1.logger.info('🔄 Updating .gitignore to add migration-related entries...');
|
|
7
|
+
const gitignorePath = '.gitignore';
|
|
8
|
+
if (!tree.exists(gitignorePath)) {
|
|
9
|
+
devkit_1.logger.warn('⚠️ .gitignore file not found, creating one');
|
|
10
|
+
tree.write(gitignorePath, '');
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
const currentContent = tree.read(gitignorePath, 'utf-8') || '';
|
|
14
|
+
let updatedContent = currentContent;
|
|
15
|
+
let addedItems = 0;
|
|
16
|
+
// Check if migrations.json is already in .gitignore
|
|
17
|
+
const migrationsJsonRegex = /^migrations\.json\s*$/gm;
|
|
18
|
+
if (!migrationsJsonRegex.test(updatedContent)) {
|
|
19
|
+
// Add migrations.json entry
|
|
20
|
+
if (!updatedContent.includes('# Migration files')) {
|
|
21
|
+
updatedContent = updatedContent.trim() + '\n\n# Migration files\n';
|
|
22
|
+
}
|
|
23
|
+
if (!updatedContent.includes('migrations.json')) {
|
|
24
|
+
updatedContent += 'migrations.json\n';
|
|
25
|
+
addedItems++;
|
|
26
|
+
devkit_1.logger.info('📝 Added migrations.json to .gitignore');
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
// Check if ai-migrations is already in .gitignore
|
|
30
|
+
const aiMigrationsRegex = /^ai-migrations\s*$/gm;
|
|
31
|
+
if (!aiMigrationsRegex.test(updatedContent)) {
|
|
32
|
+
// Add ai-migrations entry
|
|
33
|
+
if (!updatedContent.includes('# Migration files')) {
|
|
34
|
+
updatedContent = updatedContent.trim() + '\n\n# Migration files\n';
|
|
35
|
+
}
|
|
36
|
+
if (!updatedContent.includes('ai-migrations')) {
|
|
37
|
+
updatedContent += 'ai-migrations\n';
|
|
38
|
+
addedItems++;
|
|
39
|
+
devkit_1.logger.info('📝 Added ai-migrations to .gitignore');
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (addedItems > 0) {
|
|
43
|
+
tree.write(gitignorePath, updatedContent);
|
|
44
|
+
devkit_1.logger.info(`✅ Successfully updated .gitignore (added ${addedItems} entries)`);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
devkit_1.logger.info('ℹ️ Migration-related entries already exist in .gitignore');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
catch (error) {
|
|
51
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
52
|
+
devkit_1.logger.error(`❌ Failed to update .gitignore: ${errorMessage}`);
|
|
53
|
+
throw new Error(`Failed to update .gitignore: ${errorMessage}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-prerelease-deploy.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-9/fix-prerelease-deploy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB9D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
async function update(tree) {
|
|
8
|
+
devkit_1.logger.info('🔄 Updating .github/workflows/cicd file - fixing prerelease deploy logic');
|
|
9
|
+
try {
|
|
10
|
+
// Update cicd.yml
|
|
11
|
+
const cicdWorkflowPath = '.github/workflows/cicd.yml';
|
|
12
|
+
const cicdTemplatePath = (0, path_1.join)(__dirname, 'templates', 'cicd.template');
|
|
13
|
+
const cicdTemplateContent = (0, fs_1.readFileSync)(cicdTemplatePath, 'utf-8');
|
|
14
|
+
const cicdExists = tree.exists(cicdWorkflowPath);
|
|
15
|
+
tree.write(cicdWorkflowPath, cicdTemplateContent);
|
|
16
|
+
if (cicdExists) {
|
|
17
|
+
devkit_1.logger.info(`✅ Updated ${cicdWorkflowPath}`);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
devkit_1.logger.info(`✅ Created ${cicdWorkflowPath}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
devkit_1.logger.error(`❌ Failed to update GitHub workflows: ${error?.message || 'Unknown error'}`);
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
name: CI/CD
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- 'prerelease/**'
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
id-token: write
|
|
11
|
+
contents: write
|
|
12
|
+
packages: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
release:
|
|
16
|
+
name: Release
|
|
17
|
+
runs-on:
|
|
18
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
19
|
+
- instance-size:medium
|
|
20
|
+
outputs:
|
|
21
|
+
hasChangesets: ${{ steps.changesets.outputs.hasChangesets }}
|
|
22
|
+
steps:
|
|
23
|
+
- name: Checkout Repo
|
|
24
|
+
uses: actions/checkout@v4
|
|
25
|
+
|
|
26
|
+
- name: Check if part of prerelease or official release
|
|
27
|
+
id: check
|
|
28
|
+
run: |
|
|
29
|
+
if [ "${{ github.ref }}" = "refs/heads/main" ] && [ -f ".changeset/pre.json" ]; then
|
|
30
|
+
echo "main branch should not have pre.json file, skipping job"
|
|
31
|
+
exit 1
|
|
32
|
+
elif [[ "${{ github.ref }}" == "refs/heads/prerelease/"* ]] && [ ! -f ".changeset/pre.json" ]; then
|
|
33
|
+
echo "prerelease branch must have pre.json file, skipping job"
|
|
34
|
+
exit 1
|
|
35
|
+
elif [ "${{ github.ref }}" != "refs/heads/main" ] && [[ "${{ github.ref }}" != "refs/heads/prerelease/"* ]]; then
|
|
36
|
+
echo "not part of prerelease or official release, skipping job"
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
- name: Setup Node.js
|
|
41
|
+
uses: actions/setup-node@v4
|
|
42
|
+
with:
|
|
43
|
+
node-version-file: '.nvmrc'
|
|
44
|
+
|
|
45
|
+
- name: Run Kaltura Tools Check
|
|
46
|
+
uses: kaltura/kaltura-tools@unisphere
|
|
47
|
+
with:
|
|
48
|
+
repo-path: '${{ github.workspace }}'
|
|
49
|
+
|
|
50
|
+
- name: Setup JFrog
|
|
51
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
52
|
+
id: setup-jfrog
|
|
53
|
+
env:
|
|
54
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
55
|
+
with:
|
|
56
|
+
oidc-provider-name: ovp-github-oidc
|
|
57
|
+
|
|
58
|
+
- name: Install Dependencies
|
|
59
|
+
run: npm ci --include=optional
|
|
60
|
+
env:
|
|
61
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
62
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
63
|
+
|
|
64
|
+
- name: Create Release Pull Request or Publish to npm
|
|
65
|
+
id: changesets
|
|
66
|
+
uses: changesets/action@v1
|
|
67
|
+
env:
|
|
68
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
69
|
+
|
|
70
|
+
- name: Create release tags
|
|
71
|
+
if: steps.changesets.outputs.hasChangesets == 'false'
|
|
72
|
+
run: |
|
|
73
|
+
npx changeset tag
|
|
74
|
+
git push --follow-tags
|
|
75
|
+
|
|
76
|
+
publish-artifacts:
|
|
77
|
+
needs: release
|
|
78
|
+
if: needs.release.outputs.hasChangesets == 'false'
|
|
79
|
+
uses: ./.github/workflows/_publish-artifacts.yml
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-rollup-patch.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-23-0/delete-rollup-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAS9D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
async function update(tree) {
|
|
5
|
+
// Delete rollup patch file
|
|
6
|
+
const rollupPatchPath = 'patches/@nx+rollup+22.1.3.patch';
|
|
7
|
+
if (tree.exists(rollupPatchPath)) {
|
|
8
|
+
console.log(`Deleting rollup patch file: ${rollupPatchPath}`);
|
|
9
|
+
tree.delete(rollupPatchPath);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
throw new Error(`Rollup patch file not found at ${rollupPatchPath}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-nvmrc.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-23-2/update-nvmrc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,YAAY,CAAC;AAEvD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA0B9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"force-always-for-applications.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-24-2/force-always-for-applications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAkC9D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
async function update(tree) {
|
|
8
|
+
devkit_1.logger.info('🔄 force deploy of applications even when not having runtimes in the repo');
|
|
9
|
+
// Ensure .github/workflows directory exists
|
|
10
|
+
if (!tree.exists('.github')) {
|
|
11
|
+
tree.write('.github/.gitkeep', '');
|
|
12
|
+
devkit_1.logger.info('✅ Created .github directory');
|
|
13
|
+
}
|
|
14
|
+
if (!tree.exists('.github/workflows')) {
|
|
15
|
+
tree.write('.github/workflows/.gitkeep', '');
|
|
16
|
+
devkit_1.logger.info('✅ Created .github/workflows directory');
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
// Update _publish-artifacts.yml
|
|
20
|
+
const publishArtifactsWorkflowPath = '.github/workflows/_publish-artifacts.yml';
|
|
21
|
+
const publishArtifactsTemplatePath = (0, path_1.join)(__dirname, 'templates', '_publish-artifacts.template');
|
|
22
|
+
const publishArtifactsTemplateContent = (0, fs_1.readFileSync)(publishArtifactsTemplatePath, 'utf-8');
|
|
23
|
+
const publishArtifactsExists = tree.exists(publishArtifactsWorkflowPath);
|
|
24
|
+
tree.write(publishArtifactsWorkflowPath, publishArtifactsTemplateContent);
|
|
25
|
+
if (publishArtifactsExists) {
|
|
26
|
+
devkit_1.logger.info(`✅ Updated ${publishArtifactsWorkflowPath} `);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
devkit_1.logger.info(`✅ Created ${publishArtifactsWorkflowPath}`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
devkit_1.logger.error(`❌ Failed to update GitHub workflows: ${error?.message || 'Unknown error'}`);
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
name: Shared Deployment Jobs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
check-elements:
|
|
8
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
9
|
+
outputs:
|
|
10
|
+
has_packages: ${{ steps.check.outputs.has_packages }}
|
|
11
|
+
has_runtimes: ${{ steps.check.outputs.has_runtimes }}
|
|
12
|
+
has_applications: ${{ steps.check.outputs.has_applications }}
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Repo
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
18
|
+
fetch-tags: true
|
|
19
|
+
|
|
20
|
+
- name: Check elements in .unisphere
|
|
21
|
+
id: check
|
|
22
|
+
run: |
|
|
23
|
+
if [ -f .unisphere ]; then
|
|
24
|
+
PACKAGES=$(jq -r '.elements.packages // {} | length' .unisphere)
|
|
25
|
+
RUNTIMES=$(jq -r '(.elements.runtimes // {} | length) + (.elements.workspace // {} | length) + (.elements.loader // {} | length)' .unisphere)
|
|
26
|
+
APPLICATIONS=$(jq -r '.elements.applications // {} | length' .unisphere)
|
|
27
|
+
|
|
28
|
+
if [ "$PACKAGES" -gt 0 ]; then
|
|
29
|
+
echo "has_packages=true" >> $GITHUB_OUTPUT
|
|
30
|
+
else
|
|
31
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
if [ "$RUNTIMES" -gt 0 ]; then
|
|
35
|
+
echo "has_runtimes=true" >> $GITHUB_OUTPUT
|
|
36
|
+
else
|
|
37
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
if [ "$APPLICATIONS" -gt 0 ]; then
|
|
41
|
+
echo "has_applications=true" >> $GITHUB_OUTPUT
|
|
42
|
+
else
|
|
43
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
44
|
+
fi
|
|
45
|
+
else
|
|
46
|
+
echo "has_packages=false" >> $GITHUB_OUTPUT
|
|
47
|
+
echo "has_runtimes=false" >> $GITHUB_OUTPUT
|
|
48
|
+
echo "has_applications=false" >> $GITHUB_OUTPUT
|
|
49
|
+
fi
|
|
50
|
+
|
|
51
|
+
prepare-runtimes:
|
|
52
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
53
|
+
if: needs.check-elements.outputs.has_runtimes == 'true'
|
|
54
|
+
needs: check-elements
|
|
55
|
+
outputs:
|
|
56
|
+
unisphereElementsArtifactsFolder: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
57
|
+
hasArtifacts: ${{ steps.prepare-runtimes.outputs.hasArtifacts }}
|
|
58
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
59
|
+
steps:
|
|
60
|
+
- name: Checkout Repo
|
|
61
|
+
uses: actions/checkout@v4
|
|
62
|
+
with:
|
|
63
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
64
|
+
fetch-tags: true
|
|
65
|
+
- name: Setup Node.js
|
|
66
|
+
uses: actions/setup-node@v4
|
|
67
|
+
with:
|
|
68
|
+
node-version-file: '.nvmrc'
|
|
69
|
+
- name: Clean workspace
|
|
70
|
+
run: git reset --hard HEAD
|
|
71
|
+
- name: Clean npm cache
|
|
72
|
+
run: npm cache clean --force
|
|
73
|
+
|
|
74
|
+
- name: Setup JFrog
|
|
75
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
76
|
+
id: setup-jfrog
|
|
77
|
+
env:
|
|
78
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
79
|
+
with:
|
|
80
|
+
oidc-provider-name: ovp-github-oidc
|
|
81
|
+
|
|
82
|
+
- name: Install dependencies
|
|
83
|
+
run: npm ci --ignore-scripts
|
|
84
|
+
env:
|
|
85
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
86
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
87
|
+
|
|
88
|
+
- name: Prepare Unisphere Elements
|
|
89
|
+
id: prepare-runtimes
|
|
90
|
+
run: npx unisphere runtime publish prepare --verbose
|
|
91
|
+
- name: Capture Commit SHA
|
|
92
|
+
id: capture_commit_sha
|
|
93
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
94
|
+
- name: Set commit_sha as output
|
|
95
|
+
id: set_commit_sha
|
|
96
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
97
|
+
- uses: actions/upload-artifact@v4
|
|
98
|
+
id: upload-unisphere-elements-artifacts
|
|
99
|
+
with:
|
|
100
|
+
name: unisphere-elements
|
|
101
|
+
path: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
102
|
+
retention-days: 1
|
|
103
|
+
|
|
104
|
+
deploy-packages:
|
|
105
|
+
if: needs.check-elements.outputs.has_packages == 'true'
|
|
106
|
+
needs: check-elements
|
|
107
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
108
|
+
steps:
|
|
109
|
+
- name: Checkout Repo
|
|
110
|
+
uses: actions/checkout@v4
|
|
111
|
+
with:
|
|
112
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
113
|
+
fetch-tags: true
|
|
114
|
+
- name: Setup Node.js
|
|
115
|
+
uses: actions/setup-node@v4
|
|
116
|
+
with:
|
|
117
|
+
node-version-file: '.nvmrc'
|
|
118
|
+
|
|
119
|
+
- name: Setup JFrog
|
|
120
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
121
|
+
id: setup-jfrog
|
|
122
|
+
env:
|
|
123
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
124
|
+
with:
|
|
125
|
+
oidc-provider-name: ovp-github-oidc
|
|
126
|
+
|
|
127
|
+
- name: Install dependencies
|
|
128
|
+
run: |
|
|
129
|
+
npm ci --ignore-scripts
|
|
130
|
+
|
|
131
|
+
env:
|
|
132
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
133
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
134
|
+
|
|
135
|
+
- name: Get NPM Token from AWS Secrets Manager
|
|
136
|
+
id: get-npm-token
|
|
137
|
+
run: |
|
|
138
|
+
NPM_TOKEN=$(aws secretsmanager get-secret-value --secret-id arn:aws:secretsmanager:eu-central-1:785328604905:secret:unisphere-secrets-um86Cs --query SecretString --output text | jq -r '."NPM_UNISPHERE_TOKEN"')
|
|
139
|
+
echo "NPM_TOKEN=$NPM_TOKEN" >> $GITHUB_ENV
|
|
140
|
+
# Debug token existence (safely)
|
|
141
|
+
echo "::debug::Token exists: $([ ! -z "$NPM_TOKEN" ] && echo 'true' || echo 'false')"
|
|
142
|
+
- name: Deploy to registry
|
|
143
|
+
run: npx unisphere package publish --verbose --githubToken ${{ secrets.GITHUB_TOKEN }} --npmToken ${{ env.NPM_TOKEN }} --branch "${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}"
|
|
144
|
+
|
|
145
|
+
deploy-runtimes:
|
|
146
|
+
if: needs.prepare-runtimes.outputs.hasArtifacts == 'true'
|
|
147
|
+
needs: prepare-runtimes
|
|
148
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
149
|
+
strategy:
|
|
150
|
+
matrix:
|
|
151
|
+
envs_regions:
|
|
152
|
+
- { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
|
|
153
|
+
- { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
|
|
154
|
+
- { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
|
|
155
|
+
- { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
|
|
156
|
+
- { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
|
|
157
|
+
- { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
|
|
158
|
+
- { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
|
|
159
|
+
fail-fast: false
|
|
160
|
+
|
|
161
|
+
steps:
|
|
162
|
+
- name: Check available disk space
|
|
163
|
+
run: df -h
|
|
164
|
+
- name: Checkout Repo at specific commit
|
|
165
|
+
uses: actions/checkout@v4
|
|
166
|
+
with:
|
|
167
|
+
ref: ${{ needs.prepare-runtimes.outputs.commit_sha }}
|
|
168
|
+
fetch-tags: true
|
|
169
|
+
- name: Setup Node.js
|
|
170
|
+
uses: actions/setup-node@v4
|
|
171
|
+
with:
|
|
172
|
+
node-version-file: '.nvmrc'
|
|
173
|
+
|
|
174
|
+
- name: Setup JFrog
|
|
175
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
176
|
+
id: setup-jfrog
|
|
177
|
+
env:
|
|
178
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
179
|
+
with:
|
|
180
|
+
oidc-provider-name: ovp-github-oidc
|
|
181
|
+
|
|
182
|
+
- name: Install dependencies
|
|
183
|
+
run: |
|
|
184
|
+
npm ci --ignore-scripts
|
|
185
|
+
env:
|
|
186
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
187
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
188
|
+
|
|
189
|
+
- name: Download artifacts folder
|
|
190
|
+
uses: actions/download-artifact@v4
|
|
191
|
+
with:
|
|
192
|
+
name: unisphere-elements
|
|
193
|
+
path: ${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}
|
|
194
|
+
- name: Sync S3 bucket
|
|
195
|
+
run: |
|
|
196
|
+
npx unisphere runtime publish execute \
|
|
197
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
198
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
199
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
200
|
+
--artifacts-folder '${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}' \
|
|
201
|
+
--verbose
|
|
202
|
+
|
|
203
|
+
prepare-applications:
|
|
204
|
+
if: always() && needs.check-elements.outputs.has_applications == 'true'
|
|
205
|
+
needs: [deploy-runtimes, check-elements]
|
|
206
|
+
runs-on:
|
|
207
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
208
|
+
- instance-size:medium
|
|
209
|
+
outputs:
|
|
210
|
+
unisphereApplicationsArtifactsFolder: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
211
|
+
hasArtifacts: ${{ steps.prepare-applications.outputs.hasArtifacts }}
|
|
212
|
+
commit_sha: ${{ steps.capture_commit_sha.outputs.commit_sha }}
|
|
213
|
+
steps:
|
|
214
|
+
- name: Checkout Repo
|
|
215
|
+
uses: actions/checkout@v4
|
|
216
|
+
with:
|
|
217
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
218
|
+
fetch-tags: true
|
|
219
|
+
- name: Setup Node.js
|
|
220
|
+
uses: actions/setup-node@v4
|
|
221
|
+
with:
|
|
222
|
+
node-version-file: '.nvmrc'
|
|
223
|
+
- name: Clean workspace
|
|
224
|
+
run: git reset --hard HEAD
|
|
225
|
+
- name: Clean npm cache
|
|
226
|
+
run: npm cache clean --force
|
|
227
|
+
- name: Setup JFrog
|
|
228
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
229
|
+
id: setup-jfrog
|
|
230
|
+
env:
|
|
231
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
232
|
+
with:
|
|
233
|
+
oidc-provider-name: ovp-github-oidc
|
|
234
|
+
- name: Install dependencies
|
|
235
|
+
run: npm ci --ignore-scripts
|
|
236
|
+
env:
|
|
237
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
238
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
239
|
+
- name: Prepare Unisphere Applications
|
|
240
|
+
id: prepare-applications
|
|
241
|
+
run: npx unisphere application publish prepare --verbose
|
|
242
|
+
- name: Capture Commit SHA
|
|
243
|
+
id: capture_commit_sha
|
|
244
|
+
run: echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
|
245
|
+
- name: Set commit_sha as output
|
|
246
|
+
id: set_commit_sha
|
|
247
|
+
run: echo "commit_sha=${{ env.commit_sha }}" >> $GITHUB_OUTPUT
|
|
248
|
+
- uses: actions/upload-artifact@v4
|
|
249
|
+
id: upload-unisphere-applications-artifacts
|
|
250
|
+
with:
|
|
251
|
+
name: unisphere-applications
|
|
252
|
+
path: ${{ steps.prepare-applications.outputs.artifactsRootFolder }}
|
|
253
|
+
retention-days: 1
|
|
254
|
+
|
|
255
|
+
deploy-applications:
|
|
256
|
+
if: always() && needs.prepare-applications.outputs.hasArtifacts == 'true'
|
|
257
|
+
needs: [prepare-applications]
|
|
258
|
+
runs-on:
|
|
259
|
+
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
260
|
+
- instance-size:medium
|
|
261
|
+
strategy:
|
|
262
|
+
matrix:
|
|
263
|
+
envs_regions:
|
|
264
|
+
- { env: 'nvp1', region: 'us-east-1', accountid: '583352821080' }
|
|
265
|
+
- { env: 'frp2', region: 'eu-central-1', accountid: '082111255551' }
|
|
266
|
+
- { env: 'irp2', region: 'eu-west-1', accountid: '137576761235' }
|
|
267
|
+
- { env: 'nvq2', region: 'us-east-1', accountid: '383697330906' }
|
|
268
|
+
- { env: 'sgp2', region: 'ap-southeast-1', accountid: '882351240370' }
|
|
269
|
+
- { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
|
|
270
|
+
- { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
|
|
271
|
+
fail-fast: false
|
|
272
|
+
steps:
|
|
273
|
+
- name: Checkout Repo at specific commit
|
|
274
|
+
uses: actions/checkout@v4
|
|
275
|
+
with:
|
|
276
|
+
ref: ${{ needs.prepare-applications.outputs.commit_sha }}
|
|
277
|
+
fetch-tags: true
|
|
278
|
+
- name: Setup Node.js
|
|
279
|
+
uses: actions/setup-node@v4
|
|
280
|
+
with:
|
|
281
|
+
node-version-file: '.nvmrc'
|
|
282
|
+
- name: Setup JFrog
|
|
283
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
284
|
+
id: setup-jfrog
|
|
285
|
+
env:
|
|
286
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
287
|
+
with:
|
|
288
|
+
oidc-provider-name: ovp-github-oidc
|
|
289
|
+
- name: Install dependencies
|
|
290
|
+
run: npm ci --ignore-scripts
|
|
291
|
+
env:
|
|
292
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
293
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
294
|
+
- name: Download artifacts folder
|
|
295
|
+
uses: actions/download-artifact@v4
|
|
296
|
+
with:
|
|
297
|
+
name: unisphere-applications
|
|
298
|
+
path: ${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}
|
|
299
|
+
- name: Sync S3 bucket
|
|
300
|
+
run: |
|
|
301
|
+
npx unisphere application publish execute \
|
|
302
|
+
--env ${{ matrix.envs_regions.env }} \
|
|
303
|
+
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
304
|
+
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
305
|
+
--artifacts-folder '${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}' \
|
|
306
|
+
--verbose
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-0-0/summary.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-0-0/summary.ts"],"names":[],"mappings":"AAMA,0CAUC"}
|
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const open_1 = require("../utils/open");
|
|
6
|
+
const url = 'https://unisphere.kaltura.com/docs/create/changelog/v2-x-major-release';
|
|
7
|
+
const version = 'Major 2';
|
|
5
8
|
async function default_1() {
|
|
6
9
|
devkit_1.logger.info('');
|
|
7
|
-
devkit_1.logger.info(
|
|
10
|
+
devkit_1.logger.info(`🎉 Migration to ${version} finished successfully!`);
|
|
8
11
|
devkit_1.logger.info('');
|
|
9
12
|
devkit_1.logger.info('📋 Full details:');
|
|
10
|
-
devkit_1.logger.info(
|
|
13
|
+
devkit_1.logger.info(url);
|
|
11
14
|
devkit_1.logger.info('');
|
|
15
|
+
(0, open_1.openBrowser)(url);
|
|
16
|
+
devkit_1.logger.info('Opening changelog in browser...');
|
|
12
17
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../../src/migrations/utils/open.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,GAAI,KAAK,MAAM,SAYtC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.openBrowser = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
const openBrowser = (url) => {
|
|
6
|
+
try {
|
|
7
|
+
const command = process.platform === 'darwin' ? `open "${url}"` :
|
|
8
|
+
process.platform === 'win32' ? `start "" "${url}"` :
|
|
9
|
+
`xdg-open "${url}"`;
|
|
10
|
+
(0, node_child_process_1.exec)(command);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
console.error('Failed to open browser:', error);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
exports.openBrowser = openBrowser;
|
package/migrations.json
CHANGED
|
@@ -63,6 +63,39 @@
|
|
|
63
63
|
"description": "Migration completion summary for 1.22.4",
|
|
64
64
|
"factory": "./dist/migrations/1-22-4/summary.js"
|
|
65
65
|
},
|
|
66
|
+
"1-22-7-update-git-ignore": {
|
|
67
|
+
"version": "1.22.7",
|
|
68
|
+
"description": "Update .gitignore",
|
|
69
|
+
"factory": "./dist/migrations/1-22-7/update-git-ignore.js"
|
|
70
|
+
},
|
|
71
|
+
"1-22-7-remove-storybook": {
|
|
72
|
+
"version": "1.22.7",
|
|
73
|
+
"description": "Removes storybook files and dependencies",
|
|
74
|
+
"factory": "./dist/migrations/1-22-7/remove-storybook.js",
|
|
75
|
+
"cli": {
|
|
76
|
+
"postUpdateMessage": "✅ Storybook files and dependencies have been removed"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"1-22-9-fix-prerelease-deploy": {
|
|
80
|
+
"version": "1.22.9",
|
|
81
|
+
"description": "Fix prerelease deploy logic in GitHub workflow",
|
|
82
|
+
"factory": "./dist/migrations/1-22-9/fix-prerelease-deploy.js"
|
|
83
|
+
},
|
|
84
|
+
"1-23-0-delete-rollup-patch": {
|
|
85
|
+
"version": "1.23.0",
|
|
86
|
+
"description": "Delete rollup patch file",
|
|
87
|
+
"factory": "./dist/migrations/1-23-0/delete-rollup-patch.js"
|
|
88
|
+
},
|
|
89
|
+
"1-23-2-update-nvmrc": {
|
|
90
|
+
"version": "1.23.2",
|
|
91
|
+
"description": "Update .nvmrc to Node 24",
|
|
92
|
+
"factory": "./dist/migrations/1-23-2/update-nvmrc.js"
|
|
93
|
+
},
|
|
94
|
+
"1-24-2-force-always-for-applications": {
|
|
95
|
+
"version": "1.24.2",
|
|
96
|
+
"description": "Force always deploy applications in GitHub workflow",
|
|
97
|
+
"factory": "./dist/migrations/1-24-2/force-always-for-applications.js"
|
|
98
|
+
},
|
|
66
99
|
"2-0-0-update-npmrc": {
|
|
67
100
|
"version": "2.0.0",
|
|
68
101
|
"description": "Updates .npmrc to remove legacy-peer-deps=true",
|
|
@@ -91,22 +124,6 @@
|
|
|
91
124
|
"description": "Syncs package json files",
|
|
92
125
|
"factory": "./dist/migrations/2-0-0/sync-package-json-files.js"
|
|
93
126
|
},
|
|
94
|
-
"2-0-0-update-nvmrc": {
|
|
95
|
-
"version": "2.0.0",
|
|
96
|
-
"description": "Updates .nvmrc to Node 24 (creates if missing)",
|
|
97
|
-
"factory": "./dist/migrations/2-0-0/update-nvmrc.js",
|
|
98
|
-
"cli": {
|
|
99
|
-
"postUpdateMessage": "✅ .nvmrc has been updated to Node 24. Please ensure you have Node.js 24.x installed."
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"2-0-0-replace-patches": {
|
|
103
|
-
"version": "2.0.0",
|
|
104
|
-
"description": "Replaces patches",
|
|
105
|
-
"factory": "./dist/migrations/2-0-0/replace-patches.js",
|
|
106
|
-
"cli": {
|
|
107
|
-
"postUpdateMessage": "✅ Patches have been replaced"
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
127
|
"2-0-0-summary": {
|
|
111
128
|
"version": "2.0.0",
|
|
112
129
|
"description": "Migration completion summary for 2.0.0",
|
|
@@ -177,6 +194,26 @@
|
|
|
177
194
|
}
|
|
178
195
|
}
|
|
179
196
|
},
|
|
197
|
+
"1.22.9": {
|
|
198
|
+
"version": "1.22.9",
|
|
199
|
+
"cli": "nx",
|
|
200
|
+
"packages": {
|
|
201
|
+
"@unisphere/cli": {
|
|
202
|
+
"version": "^1.58.7",
|
|
203
|
+
"alwaysAddToPackageJson": true
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"1.24.1": {
|
|
208
|
+
"version": "1.24.1",
|
|
209
|
+
"cli": "nx",
|
|
210
|
+
"packages": {
|
|
211
|
+
"@unisphere/cli": {
|
|
212
|
+
"version": "^1.58.9",
|
|
213
|
+
"alwaysAddToPackageJson": true
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
180
217
|
"2.0.0": {
|
|
181
218
|
"version": "2.0.0",
|
|
182
219
|
"cli": "nx",
|
|
@@ -210,6 +247,10 @@
|
|
|
210
247
|
"version": "^12.2.2",
|
|
211
248
|
"alwaysAddToPackageJson": false
|
|
212
249
|
},
|
|
250
|
+
"@kaltura/ds-react-components": {
|
|
251
|
+
"version": "^12.2.2",
|
|
252
|
+
"alwaysAddToPackageJson": false
|
|
253
|
+
},
|
|
213
254
|
"@kaltura/ds-react-icons": {
|
|
214
255
|
"version": "^12.2.2",
|
|
215
256
|
"alwaysAddToPackageJson": false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unisphere/nx",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "https://github.com/kaltura/unisphere-nx
|
|
13
|
+
"url": "https://github.com/kaltura/unisphere-nx"
|
|
14
14
|
},
|
|
15
15
|
"author": {
|
|
16
16
|
"name": "Kaltura",
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
diff --git a/node_modules/@nx/rollup/src/plugins/with-nx/with-nx.js b/node_modules/@nx/rollup/src/plugins/with-nx/with-nx.js
|
|
2
|
-
index 1135bba..4762053 100644
|
|
3
|
-
--- a/node_modules/@nx/rollup/src/plugins/with-nx/with-nx.js
|
|
4
|
-
+++ b/node_modules/@nx/rollup/src/plugins/with-nx/with-nx.js
|
|
5
|
-
@@ -149,7 +149,13 @@ dependencies) {
|
|
6
|
-
else {
|
|
7
|
-
options.generatePackageJson ??= true;
|
|
8
|
-
}
|
|
9
|
-
- const compilerOptions = createTsCompilerOptions(projectRoot, tsConfig, options, dependencies);
|
|
10
|
-
+ let compilerOptionsInterceptor = ((config) => config);
|
|
11
|
-
+ if (rollupConfig.unisphere?.interceptors?.compilerOptions) {
|
|
12
|
-
+ console.log(`[unisphere.nx.rollup] using monkey patched interceptor for TS compiler options`);
|
|
13
|
-
+ compilerOptionsInterceptor = rollupConfig.unisphere?.interceptors?.compilerOptions;
|
|
14
|
-
+ }
|
|
15
|
-
+
|
|
16
|
-
+ const compilerOptions = compilerOptionsInterceptor(createTsCompilerOptions(projectRoot, tsConfig, options, dependencies));
|
|
17
|
-
compilerOptions.outDir = Array.isArray(finalConfig.output)
|
|
18
|
-
? finalConfig.output[0].dir
|
|
19
|
-
: finalConfig.output.dir;
|
|
20
|
-
@@ -170,6 +176,7 @@ dependencies) {
|
|
21
|
-
return require('rollup-plugin-typescript2')({
|
|
22
|
-
check: !options.skipTypeCheck,
|
|
23
|
-
tsconfig: tsConfigPath,
|
|
24
|
-
+ exclude: ['**/*.stories.ts', '**/*.stories.tsx'],
|
|
25
|
-
tsconfigOverride: {
|
|
26
|
-
compilerOptions,
|
|
27
|
-
},
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
diff --git a/node_modules/@nx/rollup/src/plugins/with-nx/with-nx.js b/node_modules/@nx/rollup/src/plugins/with-nx/with-nx.js
|
|
2
|
-
index 1135bba..4762053 100644
|
|
3
|
-
--- a/node_modules/@nx/rollup/src/plugins/with-nx/with-nx.js
|
|
4
|
-
+++ b/node_modules/@nx/rollup/src/plugins/with-nx/with-nx.js
|
|
5
|
-
@@ -149,7 +149,13 @@ dependencies) {
|
|
6
|
-
else {
|
|
7
|
-
options.generatePackageJson ??= true;
|
|
8
|
-
}
|
|
9
|
-
- const compilerOptions = createTsCompilerOptions(projectRoot, tsConfig, options, dependencies);
|
|
10
|
-
+ let compilerOptionsInterceptor = ((config) => config);
|
|
11
|
-
+ if (rollupConfig.unisphere?.interceptors?.compilerOptions) {
|
|
12
|
-
+ console.log(`[unisphere.nx.rollup] using monkey patched interceptor for TS compiler options`);
|
|
13
|
-
+ compilerOptionsInterceptor = rollupConfig.unisphere?.interceptors?.compilerOptions;
|
|
14
|
-
+ }
|
|
15
|
-
+
|
|
16
|
-
+ const compilerOptions = compilerOptionsInterceptor(createTsCompilerOptions(projectRoot, tsConfig, options, dependencies));
|
|
17
|
-
compilerOptions.outDir = Array.isArray(finalConfig.output)
|
|
18
|
-
? finalConfig.output[0].dir
|
|
19
|
-
: finalConfig.output.dir;
|
|
20
|
-
@@ -170,6 +176,7 @@ dependencies) {
|
|
21
|
-
return require('rollup-plugin-typescript2')({
|
|
22
|
-
check: !options.skipTypeCheck,
|
|
23
|
-
tsconfig: tsConfigPath,
|
|
24
|
-
+ exclude: ['**/*.stories.ts', '**/*.stories.tsx'],
|
|
25
|
-
tsconfigOverride: {
|
|
26
|
-
compilerOptions,
|
|
27
|
-
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replace-patches.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-0-0/replace-patches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmC,MAAM,YAAY,CAAC;AAQnE,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwD9D"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = update;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const removePatchList = ['nx+rollup+'];
|
|
7
|
-
const forcePatchVersions = {
|
|
8
|
-
'@nx/rollup': '22.1.3'
|
|
9
|
-
};
|
|
10
|
-
async function update(tree) {
|
|
11
|
-
devkit_1.logger.info('🔄 Creating patches');
|
|
12
|
-
try {
|
|
13
|
-
// Check @nx/rollup version
|
|
14
|
-
if (Object.keys(forcePatchVersions).length !== 0) {
|
|
15
|
-
devkit_1.logger.info('removing patches of older versions');
|
|
16
|
-
const pkg = (0, devkit_1.readJson)(tree, 'package.json');
|
|
17
|
-
Object.keys(forcePatchVersions).forEach(key => {
|
|
18
|
-
const version = pkg.devDependencies?.[key] || pkg.dependencies?.[key];
|
|
19
|
-
if (version !== forcePatchVersions[key]) {
|
|
20
|
-
devkit_1.logger.error(`❌ ${key} version must be exactly ${forcePatchVersions[key]}`);
|
|
21
|
-
throw new Error(`${key} version must be exactly ${forcePatchVersions[key]}. did you migrate nx to other version?`);
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
// Create patches
|
|
26
|
-
const patchesPath = 'patches';
|
|
27
|
-
const patchesTemplatePath = (0, path_1.join)(__dirname, 'patches');
|
|
28
|
-
// Delete existing patches folder content if it exists
|
|
29
|
-
if (tree.exists(patchesPath)) {
|
|
30
|
-
const existingFiles = tree.children(patchesPath);
|
|
31
|
-
for (const file of existingFiles) {
|
|
32
|
-
if (removePatchList.some(patch => file.includes(patch))) {
|
|
33
|
-
devkit_1.logger.info(`🗑️ Removing existing patch: ${file}`);
|
|
34
|
-
tree.delete((0, path_1.join)(patchesPath, file));
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
devkit_1.logger.info(`✅ Patch: ${file} is up to date`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
devkit_1.logger.info(`🧹 Cleaned up existing patches folder`);
|
|
41
|
-
}
|
|
42
|
-
// Copy all patch files using generateFiles
|
|
43
|
-
(0, devkit_1.generateFiles)(tree, patchesTemplatePath, `./${patchesPath}`, {});
|
|
44
|
-
// Log created patches
|
|
45
|
-
const createdPatches = tree.children(patchesPath);
|
|
46
|
-
for (const patchFile of createdPatches) {
|
|
47
|
-
devkit_1.logger.info(`✅ Created patch: ${patchFile}`);
|
|
48
|
-
}
|
|
49
|
-
// Always log that patches were created
|
|
50
|
-
devkit_1.logger.info(`✅ All patches created successfully`);
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
devkit_1.logger.error(`❌ Failed to create patches: ${error?.message || 'Unknown error'}`);
|
|
54
|
-
throw error;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-nvmrc.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-0-0/update-nvmrc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,YAAY,CAAC;AAEvD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA0B9D"}
|
|
File without changes
|
|
File without changes
|