@unisphere/nx 1.21.2 → 1.22.1
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/migrations/1-22-0/check-nx-version.d.ts.map +1 -0
- package/dist/migrations/{update-1-1-5/update-nvmrc.d.ts → 1-22-0/replace-npmrc.d.ts} +1 -1
- package/dist/migrations/1-22-0/replace-npmrc.d.ts.map +1 -0
- package/dist/migrations/1-22-0/replace-npmrc.js +27 -0
- package/dist/migrations/{update-1-1-5/fix-playground-apps.d.ts → 1-22-0/replace-patches.d.ts} +1 -1
- package/dist/migrations/1-22-0/replace-patches.d.ts.map +1 -0
- package/dist/migrations/1-22-0/replace-patches.js +42 -0
- package/dist/migrations/1-22-0/summary.d.ts +2 -0
- package/dist/migrations/1-22-0/summary.d.ts.map +1 -0
- package/dist/migrations/1-22-0/summary.js +12 -0
- package/dist/migrations/1-22-0/templates/.npmrc.template +5 -0
- package/dist/migrations/{update-1-1-5 → 1-22-0}/templates/_publish-artifacts.template +76 -44
- package/dist/migrations/{update-1-1-5 → 1-22-0}/templates/cicd.template +16 -2
- package/dist/migrations/1-22-0/templates/patches/@changesets+cli+2.29.7.patch +56 -0
- package/dist/migrations/1-22-0/templates/patches/@nx+rollup+22.1.3.patch +27 -0
- package/dist/migrations/1-22-0/update-github-workflow.d.ts.map +1 -0
- package/dist/migrations/{update-1-1-5 → 1-22-0}/update-github-workflow.js +8 -6
- package/dist/migrations/{update-1-1-5/rename-widgetname-to-widgetname.d.ts → 1-22-1/add-kaltura-tools-to-pre-install.d.ts} +1 -1
- package/dist/migrations/1-22-1/add-kaltura-tools-to-pre-install.d.ts.map +1 -0
- package/dist/migrations/1-22-1/add-kaltura-tools-to-pre-install.js +22 -0
- package/dist/migrations/1-22-1/fix-dependency-versions.d.ts.map +1 -0
- package/dist/migrations/1-22-1/sync-package-json-files.d.ts.map +1 -0
- package/dist/migrations/{update-1-1-5 → 1-22-1}/sync-package-json-files.js +10 -0
- package/dist/migrations.json +54 -123
- package/generators.json +1 -27
- package/migrations.json +54 -123
- package/package.json +1 -1
- package/dist/generators/unisphere-migrate/generator.d.ts +0 -15
- package/dist/generators/unisphere-migrate/generator.d.ts.map +0 -1
- package/dist/generators/unisphere-migrate/generator.js +0 -169
- package/dist/generators/unisphere-migrate/run-locally.md +0 -21
- package/dist/generators/unisphere-migrate/schema.json +0 -10
- package/dist/generators/unisphere-migrate/upgrade-guide.md +0 -108
- package/dist/migrations/update-1-1-5/_update-languages.d.ts +0 -3
- package/dist/migrations/update-1-1-5/_update-languages.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/_update-languages.js +0 -130
- package/dist/migrations/update-1-1-5/check-nx-version.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/fix-dependency-versions.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/fix-playground-apps.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/fix-playground-apps.js +0 -86
- package/dist/migrations/update-1-1-5/move-runtime-info-to-core.d.ts +0 -3
- package/dist/migrations/update-1-1-5/move-runtime-info-to-core.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/move-runtime-info-to-core.js +0 -217
- package/dist/migrations/update-1-1-5/rename-widgetname-to-widgetname.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/rename-widgetname-to-widgetname.js +0 -38
- package/dist/migrations/update-1-1-5/sync-package-json-files.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/update-github-workflow.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/update-npmrc.d.ts +0 -3
- package/dist/migrations/update-1-1-5/update-npmrc.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/update-npmrc.js +0 -48
- package/dist/migrations/update-1-1-5/update-nvmrc.d.ts.map +0 -1
- package/dist/migrations/update-1-1-5/update-nvmrc.js +0 -26
- /package/dist/migrations/{update-1-1-5 → 1-22-0}/check-nx-version.d.ts +0 -0
- /package/dist/migrations/{update-1-1-5 → 1-22-0}/check-nx-version.js +0 -0
- /package/dist/migrations/{update-1-1-5 → 1-22-0}/update-github-workflow.d.ts +0 -0
- /package/dist/migrations/{update-1-1-5 → 1-22-1}/fix-dependency-versions.d.ts +0 -0
- /package/dist/migrations/{update-1-1-5 → 1-22-1}/fix-dependency-versions.js +0 -0
- /package/dist/migrations/{update-1-1-5 → 1-22-1}/sync-package-json-files.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-nx-version.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/check-nx-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AAEpD,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAsBvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-npmrc.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/replace-npmrc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB9D"}
|
|
@@ -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 .npmrc file');
|
|
9
|
+
try {
|
|
10
|
+
// Update .npmrc
|
|
11
|
+
const npmrcPath = '.npmrc';
|
|
12
|
+
const npmrcTemplatePath = (0, path_1.join)(__dirname, 'templates', '.npmrc.template');
|
|
13
|
+
const npmrcTemplateContent = (0, fs_1.readFileSync)(npmrcTemplatePath, 'utf-8');
|
|
14
|
+
const exists = tree.exists(npmrcPath);
|
|
15
|
+
tree.write(npmrcPath, npmrcTemplateContent);
|
|
16
|
+
if (exists) {
|
|
17
|
+
devkit_1.logger.info(`✅ Updated ${npmrcPath}`);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
devkit_1.logger.info(`✅ Created ${npmrcPath}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
devkit_1.logger.error(`❌ Failed to update .npmrc: ${error?.message || 'Unknown error'}`);
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +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;AAGnE,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAgD9D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
async function update(tree) {
|
|
7
|
+
devkit_1.logger.info('🔄 Creating patches');
|
|
8
|
+
try {
|
|
9
|
+
// Check @nx/rollup version
|
|
10
|
+
const pkg = (0, devkit_1.readJson)(tree, 'package.json');
|
|
11
|
+
const nxVersion = pkg.devDependencies?.['@nx/rollup'] || pkg.dependencies?.['@nx/rollup'];
|
|
12
|
+
if (nxVersion !== '22.1.3') {
|
|
13
|
+
devkit_1.logger.error('❌ @nx/rollup version must be exactly 22.1.3');
|
|
14
|
+
throw new Error('@nx/rollup version must be exactly 22.1.3. did you migrate nx to other version?');
|
|
15
|
+
}
|
|
16
|
+
// Create patches
|
|
17
|
+
const patchesPath = 'patches';
|
|
18
|
+
const patchesTemplatePath = (0, path_1.join)(__dirname, 'templates', 'patches');
|
|
19
|
+
// Delete existing patches folder content if it exists
|
|
20
|
+
if (tree.exists(patchesPath)) {
|
|
21
|
+
const existingFiles = tree.children(patchesPath);
|
|
22
|
+
for (const file of existingFiles) {
|
|
23
|
+
devkit_1.logger.info(`🗑️ Removing existing patch: ${file}`);
|
|
24
|
+
tree.delete((0, path_1.join)(patchesPath, file));
|
|
25
|
+
}
|
|
26
|
+
devkit_1.logger.info(`🧹 Cleaned up existing patches folder`);
|
|
27
|
+
}
|
|
28
|
+
// Copy all patch files using generateFiles
|
|
29
|
+
(0, devkit_1.generateFiles)(tree, patchesTemplatePath, `./${patchesPath}`, {});
|
|
30
|
+
// Log created patches
|
|
31
|
+
const createdPatches = tree.children(patchesPath);
|
|
32
|
+
for (const patchFile of createdPatches) {
|
|
33
|
+
devkit_1.logger.info(`✅ Created patch: ${patchFile}`);
|
|
34
|
+
}
|
|
35
|
+
// Always log that patches were created
|
|
36
|
+
devkit_1.logger.info(`✅ All patches created successfully`);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
devkit_1.logger.error(`❌ Failed to create patches: ${error?.message || 'Unknown error'}`);
|
|
40
|
+
throw error;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/summary.ts"],"names":[],"mappings":"AAEA,0CAOC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
async function default_1() {
|
|
6
|
+
devkit_1.logger.info('');
|
|
7
|
+
devkit_1.logger.info('🎉 Migration to @unisphere/nx 1.22.0 finished successfully!');
|
|
8
|
+
devkit_1.logger.info('');
|
|
9
|
+
devkit_1.logger.info('📋 Full details:');
|
|
10
|
+
devkit_1.logger.info('https://unisphere.kaltura.com/docs/create/changelog/1-22-0-changelog');
|
|
11
|
+
devkit_1.logger.info('');
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
registry=https://kalturaa.jfrog.io/artifactory/api/npm/platform-npm/
|
|
2
|
+
//kalturaa.jfrog.io/artifactory/api/npm/platform-npm/:_authToken=${KALTURA_JFROG_TOKEN}
|
|
3
|
+
@kaltura:registry=https://npm.pkg.github.com
|
|
4
|
+
//npm.pkg.github.com/:_authToken=${GIT_TOKEN}
|
|
5
|
+
legacy-peer-deps=true
|
|
@@ -5,9 +5,8 @@ on:
|
|
|
5
5
|
|
|
6
6
|
jobs:
|
|
7
7
|
prepare-runtimes:
|
|
8
|
-
runs-on:
|
|
9
|
-
|
|
10
|
-
- instance-size:medium
|
|
8
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
9
|
+
|
|
11
10
|
outputs:
|
|
12
11
|
unisphereElementsArtifactsFolder: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
13
12
|
hasArtifacts: ${{ steps.prepare-runtimes.outputs.hasArtifacts }}
|
|
@@ -26,10 +25,21 @@ jobs:
|
|
|
26
25
|
run: git reset --hard HEAD
|
|
27
26
|
- name: Clean npm cache
|
|
28
27
|
run: npm cache clean --force
|
|
28
|
+
|
|
29
|
+
- name: Setup JFrog
|
|
30
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
31
|
+
id: setup-jfrog
|
|
32
|
+
env:
|
|
33
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
34
|
+
with:
|
|
35
|
+
oidc-provider-name: ovp-github-oidc
|
|
36
|
+
|
|
29
37
|
- name: Install dependencies
|
|
30
|
-
run: npm ci --include=optional
|
|
38
|
+
run: npm ci --include=optional
|
|
31
39
|
env:
|
|
32
40
|
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
41
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
42
|
+
|
|
33
43
|
- name: Prepare Unisphere Elements
|
|
34
44
|
id: prepare-runtimes
|
|
35
45
|
run: npx unisphere runtime publish prepare --verbose
|
|
@@ -46,12 +56,49 @@ jobs:
|
|
|
46
56
|
path: ${{ steps.prepare-runtimes.outputs.artifactsRootFolder }}
|
|
47
57
|
retention-days: 1
|
|
48
58
|
|
|
59
|
+
deploy-packages:
|
|
60
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
61
|
+
steps:
|
|
62
|
+
- name: Checkout Repo
|
|
63
|
+
uses: actions/checkout@v3
|
|
64
|
+
with:
|
|
65
|
+
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
66
|
+
fetch-tags: true
|
|
67
|
+
- name: Setup Node.js
|
|
68
|
+
uses: actions/setup-node@v4
|
|
69
|
+
with:
|
|
70
|
+
node-version: 20
|
|
71
|
+
|
|
72
|
+
- name: Setup JFrog
|
|
73
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
74
|
+
id: setup-jfrog
|
|
75
|
+
env:
|
|
76
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
77
|
+
with:
|
|
78
|
+
oidc-provider-name: ovp-github-oidc
|
|
79
|
+
|
|
80
|
+
- name: Install dependencies
|
|
81
|
+
run: |
|
|
82
|
+
npm ci --include=optional
|
|
83
|
+
|
|
84
|
+
env:
|
|
85
|
+
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
86
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
87
|
+
|
|
88
|
+
- name: Get NPM Token from AWS Secrets Manager
|
|
89
|
+
id: get-npm-token
|
|
90
|
+
run: |
|
|
91
|
+
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"')
|
|
92
|
+
echo "NPM_TOKEN=$NPM_TOKEN" >> $GITHUB_ENV
|
|
93
|
+
# Debug token existence (safely)
|
|
94
|
+
echo "::debug::Token exists: $([ ! -z "$NPM_TOKEN" ] && echo 'true' || echo 'false')"
|
|
95
|
+
- name: Deploy to registry
|
|
96
|
+
run: npx unisphere package publish --verbose --githubToken ${{ secrets.GITHUB_TOKEN }} --jfrogToken ${{ steps.setup-jfrog.outputs.oidc-token }} --npmToken ${{ env.NPM_TOKEN }} --branch "${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}"
|
|
97
|
+
|
|
49
98
|
deploy-runtimes:
|
|
50
99
|
if: needs.prepare-runtimes.outputs.hasArtifacts == 'true'
|
|
51
100
|
needs: prepare-runtimes
|
|
52
|
-
runs-on:
|
|
53
|
-
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
54
|
-
- instance-size:medium
|
|
101
|
+
runs-on: codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
55
102
|
strategy:
|
|
56
103
|
matrix:
|
|
57
104
|
envs_regions:
|
|
@@ -63,7 +110,10 @@ jobs:
|
|
|
63
110
|
- { env: 'syp2', region: 'ap-southeast-2', accountid: '650755435642' }
|
|
64
111
|
- { env: 'cap2', region: 'ca-central-1', accountid: '948632009361' }
|
|
65
112
|
fail-fast: false
|
|
113
|
+
|
|
66
114
|
steps:
|
|
115
|
+
- name: Check available disk space
|
|
116
|
+
run: df -h
|
|
67
117
|
- name: Checkout Repo at specific commit
|
|
68
118
|
uses: actions/checkout@v3
|
|
69
119
|
with:
|
|
@@ -72,11 +122,23 @@ jobs:
|
|
|
72
122
|
- name: Setup Node.js
|
|
73
123
|
uses: actions/setup-node@v4
|
|
74
124
|
with:
|
|
75
|
-
node-version
|
|
125
|
+
node-version: 20
|
|
126
|
+
|
|
127
|
+
- name: Setup JFrog
|
|
128
|
+
uses: jfrog/setup-jfrog-cli@v4
|
|
129
|
+
id: setup-jfrog
|
|
130
|
+
env:
|
|
131
|
+
JF_URL: https://kalturaa.jfrog.io
|
|
132
|
+
with:
|
|
133
|
+
oidc-provider-name: ovp-github-oidc
|
|
134
|
+
|
|
76
135
|
- name: Install dependencies
|
|
77
|
-
run:
|
|
136
|
+
run: |
|
|
137
|
+
npm ci --include=optional
|
|
78
138
|
env:
|
|
79
139
|
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
140
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
141
|
+
|
|
80
142
|
- name: Download artifacts folder
|
|
81
143
|
uses: actions/download-artifact@v4
|
|
82
144
|
with:
|
|
@@ -91,38 +153,8 @@ jobs:
|
|
|
91
153
|
--artifacts-folder '${{ needs.prepare-runtimes.outputs.unisphereElementsArtifactsFolder }}' \
|
|
92
154
|
--verbose
|
|
93
155
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
needs: [prepare-runtimes, deploy-runtimes]
|
|
97
|
-
runs-on:
|
|
98
|
-
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
99
|
-
- instance-size:medium
|
|
100
|
-
steps:
|
|
101
|
-
- name: Checkout Repo
|
|
102
|
-
uses: actions/checkout@v3
|
|
103
|
-
with:
|
|
104
|
-
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.ref }}
|
|
105
|
-
fetch-tags: true
|
|
106
|
-
- name: Setup Node.js
|
|
107
|
-
uses: actions/setup-node@v4
|
|
108
|
-
with:
|
|
109
|
-
node-version: 20
|
|
110
|
-
- name: Install dependencies
|
|
111
|
-
run: npm ci --include=optional
|
|
112
|
-
env:
|
|
113
|
-
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
114
|
-
- name: Get NPM Token from AWS Secrets Manager
|
|
115
|
-
id: get-npm-token
|
|
116
|
-
run: |
|
|
117
|
-
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"')
|
|
118
|
-
echo "NPM_TOKEN=$NPM_TOKEN" >> $GITHUB_ENV
|
|
119
|
-
echo "::debug::Token exists: $([ ! -z "$NPM_TOKEN" ] && echo 'true' || echo 'false')"
|
|
120
|
-
- name: Deploy to registry
|
|
121
|
-
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 }}"
|
|
122
|
-
|
|
123
|
-
prepare-applications:
|
|
124
|
-
if: always()
|
|
125
|
-
needs: [prepare-runtimes, deploy-runtimes]
|
|
156
|
+
prepare-applications:
|
|
157
|
+
needs: [deploy-runtimes]
|
|
126
158
|
runs-on:
|
|
127
159
|
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
128
160
|
- instance-size:medium
|
|
@@ -165,8 +197,8 @@ jobs:
|
|
|
165
197
|
retention-days: 1
|
|
166
198
|
|
|
167
199
|
deploy-applications:
|
|
168
|
-
if:
|
|
169
|
-
needs: [prepare-applications
|
|
200
|
+
if: needs.prepare-applications.outputs.hasArtifacts == 'true'
|
|
201
|
+
needs: [prepare-applications]
|
|
170
202
|
runs-on:
|
|
171
203
|
- codebuild-ovp-unisphere-runner-${{ github.run_id }}-${{ github.attempt }}
|
|
172
204
|
- instance-size:medium
|
|
@@ -207,4 +239,4 @@ jobs:
|
|
|
207
239
|
--aws-region '${{ matrix.envs_regions.region }}' \
|
|
208
240
|
--aws-arn 'arn:aws:iam::${{matrix.envs_regions.accountid }}:role/${{ matrix.envs_regions.env }}-unisphere-content-role' \
|
|
209
241
|
--artifacts-folder '${{ needs.prepare-applications.outputs.unisphereApplicationsArtifactsFolder }}' \
|
|
210
|
-
--verbose
|
|
242
|
+
--verbose
|
|
@@ -6,6 +6,11 @@ on:
|
|
|
6
6
|
- main
|
|
7
7
|
- 'prerelease/**'
|
|
8
8
|
|
|
9
|
+
permissions:
|
|
10
|
+
id-token: write
|
|
11
|
+
contents: write
|
|
12
|
+
packages: read
|
|
13
|
+
|
|
9
14
|
jobs:
|
|
10
15
|
release:
|
|
11
16
|
name: Release
|
|
@@ -30,7 +35,7 @@ jobs:
|
|
|
30
35
|
fi
|
|
31
36
|
|
|
32
37
|
- name: Checkout Repo
|
|
33
|
-
uses: actions/checkout@
|
|
38
|
+
uses: actions/checkout@v4
|
|
34
39
|
|
|
35
40
|
- name: Setup Node.js
|
|
36
41
|
uses: actions/setup-node@v4
|
|
@@ -41,11 +46,20 @@ jobs:
|
|
|
41
46
|
uses: kaltura/kaltura-tools@main
|
|
42
47
|
with:
|
|
43
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
|
|
44
57
|
|
|
45
58
|
- name: Install Dependencies
|
|
46
|
-
run: npm ci --include=optional
|
|
59
|
+
run: npm ci --include=optional
|
|
47
60
|
env:
|
|
48
61
|
GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
62
|
+
KALTURA_JFROG_TOKEN: ${{ steps.setup-jfrog.outputs.oidc-token }}
|
|
49
63
|
|
|
50
64
|
- name: Create Release Pull Request or Publish to npm
|
|
51
65
|
id: changesets
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
diff --git a/node_modules/@changesets/cli/dist/changesets-cli.cjs.js b/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
|
|
2
|
+
index 53fc925..8ee486e 100644
|
|
3
|
+
--- a/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
|
|
4
|
+
+++ b/node_modules/@changesets/cli/dist/changesets-cli.cjs.js
|
|
5
|
+
@@ -310,22 +310,7 @@ async function createChangeset(changedPackages, allPackages) {
|
|
6
|
+
const packagesToRelease = await getPackagesToRelease(changedPackages, allPackages);
|
|
7
|
+
let pkgJsonsByName = getPkgJsonsByName(allPackages);
|
|
8
|
+
let pkgsLeftToGetBumpTypeFor = new Set(packagesToRelease);
|
|
9
|
+
- let pkgsThatShouldBeMajorBumped = (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
10
|
+
- name: "all packages",
|
|
11
|
+
- choices: packagesToRelease.map(pkgName => {
|
|
12
|
+
- return {
|
|
13
|
+
- name: pkgName,
|
|
14
|
+
- message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
|
|
15
|
+
- };
|
|
16
|
+
- })
|
|
17
|
+
- }], x => {
|
|
18
|
+
- // this removes changed packages and unchanged packages from the list
|
|
19
|
+
- // of packages shown after selection
|
|
20
|
+
- if (Array.isArray(x)) {
|
|
21
|
+
- return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
|
|
22
|
+
- }
|
|
23
|
+
- return x;
|
|
24
|
+
- })).filter(x => x !== "all packages");
|
|
25
|
+
+ let pkgsThatShouldBeMajorBumped = [];
|
|
26
|
+
for (const pkgName of pkgsThatShouldBeMajorBumped) {
|
|
27
|
+
// for packages that are under v1, we want to make sure major releases are intended,
|
|
28
|
+
// as some repo-wide sweeping changes have mistakenly release first majors
|
|
29
|
+
diff --git a/node_modules/@changesets/cli/dist/changesets-cli.esm.js b/node_modules/@changesets/cli/dist/changesets-cli.esm.js
|
|
30
|
+
index 6c363c0..40aad33 100644
|
|
31
|
+
--- a/node_modules/@changesets/cli/dist/changesets-cli.esm.js
|
|
32
|
+
+++ b/node_modules/@changesets/cli/dist/changesets-cli.esm.js
|
|
33
|
+
@@ -272,22 +272,7 @@ async function createChangeset(changedPackages, allPackages) {
|
|
34
|
+
const packagesToRelease = await getPackagesToRelease(changedPackages, allPackages);
|
|
35
|
+
let pkgJsonsByName = getPkgJsonsByName(allPackages);
|
|
36
|
+
let pkgsLeftToGetBumpTypeFor = new Set(packagesToRelease);
|
|
37
|
+
- let pkgsThatShouldBeMajorBumped = (await askCheckboxPlus(bold(`Which packages should have a ${red("major")} bump?`), [{
|
|
38
|
+
- name: "all packages",
|
|
39
|
+
- choices: packagesToRelease.map(pkgName => {
|
|
40
|
+
- return {
|
|
41
|
+
- name: pkgName,
|
|
42
|
+
- message: formatPkgNameAndVersion(pkgName, pkgJsonsByName.get(pkgName).version)
|
|
43
|
+
- };
|
|
44
|
+
- })
|
|
45
|
+
- }], x => {
|
|
46
|
+
- // this removes changed packages and unchanged packages from the list
|
|
47
|
+
- // of packages shown after selection
|
|
48
|
+
- if (Array.isArray(x)) {
|
|
49
|
+
- return x.filter(x => x !== "all packages").map(x => cyan(x)).join(", ");
|
|
50
|
+
- }
|
|
51
|
+
- return x;
|
|
52
|
+
- })).filter(x => x !== "all packages");
|
|
53
|
+
+ let pkgsThatShouldBeMajorBumped = [];
|
|
54
|
+
for (const pkgName of pkgsThatShouldBeMajorBumped) {
|
|
55
|
+
// for packages that are under v1, we want to make sure major releases are intended,
|
|
56
|
+
// as some repo-wide sweeping changes have mistakenly release first majors
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-github-workflow.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-0/update-github-workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAU,MAAM,YAAY,CAAC;AAI1C,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA8C9D"}
|
|
@@ -20,23 +20,25 @@ async function update(tree) {
|
|
|
20
20
|
const cicdWorkflowPath = '.github/workflows/cicd.yml';
|
|
21
21
|
const cicdTemplatePath = (0, path_1.join)(__dirname, 'templates', 'cicd.template');
|
|
22
22
|
const cicdTemplateContent = (0, fs_1.readFileSync)(cicdTemplatePath, 'utf-8');
|
|
23
|
+
const cicdExists = tree.exists(cicdWorkflowPath);
|
|
23
24
|
tree.write(cicdWorkflowPath, cicdTemplateContent);
|
|
24
|
-
if (
|
|
25
|
-
devkit_1.logger.info(`✅ Updated ${cicdWorkflowPath}
|
|
25
|
+
if (cicdExists) {
|
|
26
|
+
devkit_1.logger.info(`✅ Updated ${cicdWorkflowPath}`);
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
28
|
-
devkit_1.logger.info(`✅ Created ${cicdWorkflowPath}
|
|
29
|
+
devkit_1.logger.info(`✅ Created ${cicdWorkflowPath}`);
|
|
29
30
|
}
|
|
30
31
|
// Update _publish-artifacts.yml
|
|
31
32
|
const publishArtifactsWorkflowPath = '.github/workflows/_publish-artifacts.yml';
|
|
32
33
|
const publishArtifactsTemplatePath = (0, path_1.join)(__dirname, 'templates', '_publish-artifacts.template');
|
|
33
34
|
const publishArtifactsTemplateContent = (0, fs_1.readFileSync)(publishArtifactsTemplatePath, 'utf-8');
|
|
35
|
+
const publishArtifactsExists = tree.exists(publishArtifactsWorkflowPath);
|
|
34
36
|
tree.write(publishArtifactsWorkflowPath, publishArtifactsTemplateContent);
|
|
35
|
-
if (
|
|
36
|
-
devkit_1.logger.info(`✅ Updated ${publishArtifactsWorkflowPath}
|
|
37
|
+
if (publishArtifactsExists) {
|
|
38
|
+
devkit_1.logger.info(`✅ Updated ${publishArtifactsWorkflowPath} `);
|
|
37
39
|
}
|
|
38
40
|
else {
|
|
39
|
-
devkit_1.logger.info(`✅ Created ${publishArtifactsWorkflowPath}
|
|
41
|
+
devkit_1.logger.info(`✅ Created ${publishArtifactsWorkflowPath}`);
|
|
40
42
|
}
|
|
41
43
|
}
|
|
42
44
|
catch (error) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-kaltura-tools-to-pre-install.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-1/add-kaltura-tools-to-pre-install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAEtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB9D"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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('🔄 Adding kaltura-tools preinstall script...');
|
|
7
|
+
try {
|
|
8
|
+
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
|
9
|
+
if (!json.scripts) {
|
|
10
|
+
json.scripts = {};
|
|
11
|
+
}
|
|
12
|
+
json.scripts.preinstall =
|
|
13
|
+
'npx --yes --prefer-online --registry=https://npm.pkg.github.com --package @kaltura/kaltura-tools@latest kaltura-tools check --root=.';
|
|
14
|
+
return json;
|
|
15
|
+
});
|
|
16
|
+
devkit_1.logger.info('✅ Successfully added kaltura-tools preinstall script');
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
devkit_1.logger.error(`❌ Failed to add preinstall script: ${error?.message || 'Unknown error'}`);
|
|
20
|
+
throw error;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fix-dependency-versions.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-1/fix-dependency-versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAuB,MAAM,YAAY,CAAC;AAEvD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA8E9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-package-json-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/1-22-1/sync-package-json-files.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAIL,MAAM,YAAY,CAAC;AAEpB,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,GAAG,MAAM,EAAE,CAAC,CAiFzE"}
|
|
@@ -27,6 +27,11 @@ async function update(tree) {
|
|
|
27
27
|
let hasChanges = false;
|
|
28
28
|
// Sync dependencies
|
|
29
29
|
if (packageJson.dependencies) {
|
|
30
|
+
if (packageJson.dependencies["@nextgis/cancelable-promise"]) {
|
|
31
|
+
devkit_1.logger.info(`🔄 deleting dependency '@nextgis/cancelable-promise'`);
|
|
32
|
+
delete packageJson.dependencies["@nextgis/cancelable-promise"];
|
|
33
|
+
hasChanges = true;
|
|
34
|
+
}
|
|
30
35
|
for (const [depName, currentVersion] of Object.entries(packageJson.dependencies)) {
|
|
31
36
|
if (targetVersions[depName] && currentVersion !== targetVersions[depName]) {
|
|
32
37
|
devkit_1.logger.info(`🔄 Updating ${depName} from ${currentVersion} to ${targetVersions[depName]} in ${filePath}`);
|
|
@@ -37,6 +42,11 @@ async function update(tree) {
|
|
|
37
42
|
}
|
|
38
43
|
// Sync devDependencies
|
|
39
44
|
if (packageJson.devDependencies) {
|
|
45
|
+
if (packageJson.devDependencies["@nextgis/cancelable-promise"]) {
|
|
46
|
+
devkit_1.logger.info(`🔄 deleting devDependencies '@nextgis/cancelable-promise'`);
|
|
47
|
+
delete packageJson.devDependencies["@nextgis/cancelable-promise"];
|
|
48
|
+
hasChanges = true;
|
|
49
|
+
}
|
|
40
50
|
for (const [depName, currentVersion] of Object.entries(packageJson.devDependencies)) {
|
|
41
51
|
if (targetVersions[depName] && currentVersion !== targetVersions[depName]) {
|
|
42
52
|
devkit_1.logger.info(`🔄 Updating ${depName} from ${currentVersion} to ${targetVersions[depName]} in ${filePath}`);
|