@unisphere/nx 2.0.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/README.md +1 -164
- package/dist/generators/add-application/add-application.js +1 -1
- package/dist/generators/add-application/templates/default/package.json.template +2 -5
- package/dist/generators/add-application/templates/local-dev-playground/package.json +1 -0
- package/dist/generators/add-package/README.md +3 -3
- package/dist/generators/add-package/add-package.d.ts.map +1 -1
- package/dist/generators/add-package/add-package.js +0 -83
- package/dist/generators/add-package/templates/new-package/package.json.template +1 -10
- package/dist/generators/add-package/templates/new-package/src/index.ts.template +0 -1
- package/dist/generators/add-package/templates/new-package/src/lib/.keep +0 -0
- package/dist/generators/add-runtime/add-runtime.d.ts.map +1 -1
- package/dist/generators/add-runtime/add-runtime.js +6 -16
- package/dist/generators/add-runtime/schema.d.ts +1 -1
- package/dist/generators/add-runtime/schema.json +9 -9
- 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 +20 -0
- package/dist/migrations/1-22-2/add-os-and-cpu.js +1 -1
- package/dist/migrations/1-22-2/templates/_publish-artifacts.template +28 -12
- package/dist/migrations/1-22-2/templates/cicd.template +1 -1
- package/dist/migrations/{summaries/2-0-0-summary.d.ts → 1-22-4/summary.d.ts} +1 -1
- package/dist/migrations/1-22-4/summary.d.ts.map +1 -0
- package/dist/migrations/1-22-4/summary.js +16 -0
- 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 +2 -0
- package/dist/migrations/2-0-0/summary.d.ts.map +1 -0
- package/dist/migrations/2-0-0/summary.js +17 -0
- package/dist/migrations/2-1-0/remove-react-overrides.d.ts +3 -0
- package/dist/migrations/2-1-0/remove-react-overrides.d.ts.map +1 -0
- package/dist/migrations/2-1-0/remove-react-overrides.js +59 -0
- package/dist/migrations/2-1-0/remove-rollup-plugin-node-builtins.d.ts +3 -0
- package/dist/migrations/2-1-0/remove-rollup-plugin-node-builtins.d.ts.map +1 -0
- package/dist/migrations/2-1-0/remove-rollup-plugin-node-builtins.js +54 -0
- package/dist/migrations/2-1-0/remove-storybook.d.ts +3 -0
- package/dist/migrations/2-1-0/remove-storybook.d.ts.map +1 -0
- package/dist/migrations/2-1-0/remove-storybook.js +88 -0
- package/dist/migrations/2-1-0/replace-readme-md.d.ts +3 -0
- package/dist/migrations/2-1-0/replace-readme-md.d.ts.map +1 -0
- package/dist/migrations/2-1-0/replace-readme-md.js +50 -0
- package/dist/migrations/2-1-0/templates/readme.md.template +134 -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 +109 -20
- package/package.json +2 -2
- 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/summaries/1-22-4-summary.d.ts +0 -2
- package/dist/migrations/summaries/1-22-4-summary.d.ts.map +0 -1
- package/dist/migrations/summaries/1-22-4-summary.js +0 -12
- package/dist/migrations/summaries/2-0-0-summary.d.ts.map +0 -1
- package/dist/migrations/summaries/2-0-0-summary.js +0 -12
- /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
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"summary.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-0-0/summary.ts"],"names":[],"mappings":"AAMA,0CAUC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
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';
|
|
8
|
+
async function default_1() {
|
|
9
|
+
devkit_1.logger.info('');
|
|
10
|
+
devkit_1.logger.info(`🎉 Migration to ${version} finished successfully!`);
|
|
11
|
+
devkit_1.logger.info('');
|
|
12
|
+
devkit_1.logger.info('📋 Full details:');
|
|
13
|
+
devkit_1.logger.info(url);
|
|
14
|
+
devkit_1.logger.info('');
|
|
15
|
+
(0, open_1.openBrowser)(url);
|
|
16
|
+
devkit_1.logger.info('Opening changelog in browser...');
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-react-overrides.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-1-0/remove-react-overrides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAEtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA+D9D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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 React overrides from package.json...');
|
|
7
|
+
const packageJsonPath = 'package.json';
|
|
8
|
+
if (!tree.exists(packageJsonPath)) {
|
|
9
|
+
devkit_1.logger.warn('⚠️ package.json not found');
|
|
10
|
+
throw new Error('package.json not found');
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
(0, devkit_1.updateJson)(tree, packageJsonPath, (packageJson) => {
|
|
14
|
+
let overridesRemoved = 0;
|
|
15
|
+
if (packageJson.overrides) {
|
|
16
|
+
// Find overrides that contain React-related dependencies
|
|
17
|
+
const overridesToRemove = Object.keys(packageJson.overrides).filter(key => {
|
|
18
|
+
const override = packageJson.overrides[key];
|
|
19
|
+
// Check if the override contains React-related dependencies
|
|
20
|
+
if (typeof override === 'object' && override !== null) {
|
|
21
|
+
return Object.entries(override).some(([dep, version]) => (dep === 'react' ||
|
|
22
|
+
dep.startsWith('react-') ||
|
|
23
|
+
dep.startsWith('@types/react')) && (typeof version === 'string' && (version.startsWith('18') || version.startsWith('^18'))));
|
|
24
|
+
}
|
|
25
|
+
// Check if the key itself is React-related
|
|
26
|
+
return key === 'react' ||
|
|
27
|
+
key.startsWith('react-') ||
|
|
28
|
+
key.startsWith('@types/react');
|
|
29
|
+
});
|
|
30
|
+
// Remove the identified overrides
|
|
31
|
+
overridesToRemove.forEach(key => {
|
|
32
|
+
delete packageJson.overrides[key];
|
|
33
|
+
overridesRemoved++;
|
|
34
|
+
});
|
|
35
|
+
// If overrides object is now empty, remove it entirely
|
|
36
|
+
if (Object.keys(packageJson.overrides).length === 0) {
|
|
37
|
+
delete packageJson.overrides;
|
|
38
|
+
devkit_1.logger.info('📦 Removed empty overrides object');
|
|
39
|
+
}
|
|
40
|
+
if (overridesRemoved > 0) {
|
|
41
|
+
devkit_1.logger.info(`📦 Removed ${overridesRemoved} React-related overrides from package.json`);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
devkit_1.logger.info('ℹ️ No React-related overrides found to remove');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
devkit_1.logger.info('ℹ️ No overrides section found in package.json');
|
|
49
|
+
}
|
|
50
|
+
return packageJson;
|
|
51
|
+
});
|
|
52
|
+
devkit_1.logger.info('✅ Successfully processed React overrides removal');
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
56
|
+
devkit_1.logger.error(`❌ Could not update package.json: ${errorMessage}`);
|
|
57
|
+
throw new Error(`Could not update package.json: ${errorMessage}`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-rollup-plugin-node-builtins.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-1-0/remove-rollup-plugin-node-builtins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAsB,MAAM,YAAY,CAAC;AAEtD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAwD9D"}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 rollup-plugin-node-builtins dependency...');
|
|
7
|
+
const packageJsonPath = 'package.json';
|
|
8
|
+
if (!tree.exists(packageJsonPath)) {
|
|
9
|
+
devkit_1.logger.warn('⚠️ package.json not found');
|
|
10
|
+
throw new Error('package.json not found');
|
|
11
|
+
}
|
|
12
|
+
try {
|
|
13
|
+
let dependencyRemoved = false;
|
|
14
|
+
(0, devkit_1.updateJson)(tree, packageJsonPath, (packageJson) => {
|
|
15
|
+
const targetDependency = 'rollup-plugin-node-builtins';
|
|
16
|
+
// Check and remove from dependencies
|
|
17
|
+
if (packageJson.dependencies && packageJson.dependencies[targetDependency]) {
|
|
18
|
+
delete packageJson.dependencies[targetDependency];
|
|
19
|
+
dependencyRemoved = true;
|
|
20
|
+
devkit_1.logger.info(`📦 Removed ${targetDependency} from dependencies`);
|
|
21
|
+
}
|
|
22
|
+
// Check and remove from devDependencies
|
|
23
|
+
if (packageJson.devDependencies && packageJson.devDependencies[targetDependency]) {
|
|
24
|
+
delete packageJson.devDependencies[targetDependency];
|
|
25
|
+
dependencyRemoved = true;
|
|
26
|
+
devkit_1.logger.info(`📦 Removed ${targetDependency} from devDependencies`);
|
|
27
|
+
}
|
|
28
|
+
// Check and remove from peerDependencies
|
|
29
|
+
if (packageJson.peerDependencies && packageJson.peerDependencies[targetDependency]) {
|
|
30
|
+
delete packageJson.peerDependencies[targetDependency];
|
|
31
|
+
dependencyRemoved = true;
|
|
32
|
+
devkit_1.logger.info(`📦 Removed ${targetDependency} from peerDependencies`);
|
|
33
|
+
}
|
|
34
|
+
// Check and remove from optionalDependencies
|
|
35
|
+
if (packageJson.optionalDependencies && packageJson.optionalDependencies[targetDependency]) {
|
|
36
|
+
delete packageJson.optionalDependencies[targetDependency];
|
|
37
|
+
dependencyRemoved = true;
|
|
38
|
+
devkit_1.logger.info(`📦 Removed ${targetDependency} from optionalDependencies`);
|
|
39
|
+
}
|
|
40
|
+
return packageJson;
|
|
41
|
+
});
|
|
42
|
+
if (dependencyRemoved) {
|
|
43
|
+
devkit_1.logger.info('✅ Successfully removed rollup-plugin-node-builtins dependency');
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
devkit_1.logger.info('ℹ️ rollup-plugin-node-builtins dependency not found');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
51
|
+
devkit_1.logger.error(`❌ Could not update package.json: ${errorMessage}`);
|
|
52
|
+
throw new Error(`Could not update package.json: ${errorMessage}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-storybook.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-1-0/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,CAsG9D"}
|
|
@@ -0,0 +1,88 @@
|
|
|
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/'));
|
|
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
|
+
if (removedItems === 0) {
|
|
83
|
+
devkit_1.logger.info('ℹ️ No Storybook files, dependencies, or paths found to remove');
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
devkit_1.logger.info(`✅ Successfully removed Storybook components (${removedItems} operations completed)`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-readme-md.d.ts","sourceRoot":"","sources":["../../../src/migrations/2-1-0/replace-readme-md.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAoB,MAAM,YAAY,CAAC;AAIpD,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAiD9D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
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('🔄 Replacing README.md from template...');
|
|
9
|
+
const readmePath = 'README.md';
|
|
10
|
+
const readmeTemplatePath = (0, path_1.join)(__dirname, 'templates', 'readme.md.template');
|
|
11
|
+
const unispherePath = '.unisphere';
|
|
12
|
+
// Read the template content
|
|
13
|
+
const readmeTemplateContent = (0, fs_1.readFileSync)(readmeTemplatePath, 'utf-8');
|
|
14
|
+
// Read and parse .unisphere file
|
|
15
|
+
let processedContent = readmeTemplateContent;
|
|
16
|
+
if (tree.exists(unispherePath)) {
|
|
17
|
+
try {
|
|
18
|
+
const unisphereContent = (0, devkit_1.readJson)(tree, unispherePath);
|
|
19
|
+
if (!unisphereContent) {
|
|
20
|
+
throw new Error('.unisphere file is empty');
|
|
21
|
+
}
|
|
22
|
+
const unisphereConfig = JSON.parse(unisphereContent);
|
|
23
|
+
// Replace placeholders with values from .unisphere
|
|
24
|
+
if (unisphereConfig.company) {
|
|
25
|
+
processedContent = processedContent.replace(/\{\{company-name\|human-readable\}\}/g, unisphereConfig.company);
|
|
26
|
+
}
|
|
27
|
+
if (unisphereConfig.name) {
|
|
28
|
+
processedContent = processedContent.replace(/\{\{project-name\|human-readable\}\}/g, unisphereConfig.name);
|
|
29
|
+
}
|
|
30
|
+
devkit_1.logger.info(` Replaced template placeholders with company: "${unisphereConfig.company}", name: "${unisphereConfig.name}"`);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
34
|
+
devkit_1.logger.warn(` Could not parse .unisphere file: ${errorMessage}`);
|
|
35
|
+
devkit_1.logger.info(' Using template content without placeholder replacement');
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
devkit_1.logger.warn(' .unisphere file not found');
|
|
40
|
+
devkit_1.logger.info(' Using template content without placeholder replacement');
|
|
41
|
+
}
|
|
42
|
+
const readmeExists = tree.exists(readmePath);
|
|
43
|
+
tree.write(readmePath, processedContent);
|
|
44
|
+
if (readmeExists) {
|
|
45
|
+
devkit_1.logger.info(`✅ Updated ${readmePath}`);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
devkit_1.logger.info(`✅ Created ${readmePath}`);
|
|
49
|
+
}
|
|
50
|
+
}
|