@unisphere/nx 2.1.0 → 2.2.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-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/2-2-0/replace-github-workflow.d.ts +3 -0
- package/dist/migrations/2-2-0/replace-github-workflow.d.ts.map +1 -0
- package/dist/migrations/2-2-0/replace-github-workflow.js +36 -0
- package/dist/migrations/2-2-0/templates/_publish-artifacts.template +309 -0
- 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 +66 -17
- 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
|
+
}
|