Skip to content

Commit 75ed706

Browse files
committed
fix(deps): add RTL support to delete-confirmation-prompt
2 parents 4d265f4 + 0e2ec72 commit 75ed706

File tree

97 files changed

+7112
-4508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+7112
-4508
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ runs:
3333
packages/*/node_modules
3434
packages/*/src/generated
3535
packages/scratch-gui/static/microbit
36-
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
36+
key: ${{ runner.os }}-npm-${{ hashFiles('.nvmrc', 'package-lock.json') }}
3737
- if: steps.restore-node-modules-cache.outputs.cache-hit != 'true'
3838
name: Install NPM dependencies
3939
working-directory: .
@@ -47,4 +47,4 @@ runs:
4747
packages/*/node_modules
4848
packages/*/src/generated
4949
packages/scratch-gui/static/microbit
50-
key: ${{ runner.os }}-npm-${{ hashFiles('package-lock.json') }}
50+
key: ${{ runner.os }}-npm-${{ hashFiles('.nvmrc', 'package-lock.json') }}

.github/actions/test-package/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Test package
22

3+
description: Test one of the packages in this monorepo.
4+
35
inputs:
46
package_name:
57
description: The name of the tested package

.github/actions/update-i18n/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Update i18n
22

3+
description: Update i18n files for one of the packages in this monorepo.
4+
35
inputs:
46
package_name:
57
description: The name of the updated package

.github/path-filters.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# The `&global` anchor defines a set of common paths to include by reference in the other filters.
2+
global: &global
3+
- ".github/path-filters.yml"
4+
- ".github/workflows/ci.yml"
5+
- ".nvmrc"
6+
- "package.json"
7+
- "package-lock.json"
8+
- "scripts/**"
9+
10+
any-workspace:
11+
- *global
12+
- "packages/**"
13+
14+
scratch-svg-renderer:
15+
- *global
16+
- "packages/scratch-svg-renderer/**"
17+
scratch-render:
18+
- *global
19+
- "packages/scratch-render/**"
20+
- "packages/scratch-svg-renderer/**"
21+
scratch-vm:
22+
- *global
23+
- "packages/scratch-render/**"
24+
- "packages/scratch-svg-renderer/**"
25+
- "packages/scratch-vm/**"
26+
scratch-gui:
27+
- *global
28+
- "packages/scratch-gui/**"
29+
- "packages/scratch-render/**"
30+
- "packages/scratch-svg-renderer/**"
31+
- "packages/scratch-vm/**"

.github/workflows/ci.yml

Lines changed: 67 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,78 +12,100 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
jobs:
15-
ci:
16-
name: Detect affected packages, build and test
15+
build:
16+
name: Build
1717
runs-on: ubuntu-latest
18+
outputs:
19+
any-workspace: ${{ steps.filter.outputs.any-workspace }}
20+
packages: ${{ steps.filter.outputs.changes }}
1821
steps:
1922
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2023
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
2124
with:
2225
cache: 'npm'
2326
node-version-file: '.nvmrc'
24-
- uses: wagoid/commitlint-github-action@9763196e10f27aef304c9b8b660d31d97fce0f99 # v5
2527
- name: Debug info
28+
# https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable
29+
env:
30+
GH_HEAD_REF: ${{ github.head_ref }}
2631
run: |
2732
cat <<EOF
2833
Scratch environment: ${{ vars.SCRATCH_ENV || '<none>' }}
2934
Node version: $(node --version)
3035
NPM version: $(npm --version)
3136
GitHub ref: ${{ github.ref }}
32-
GitHub head ref: ${{ github.head_ref }}
37+
GitHub head ref: ${GH_HEAD_REF}
3338
Working directory: $(pwd)
3439
EOF
3540
3641
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
3742
id: filter
3843
with:
39-
# Files in the `global` filter affect all workspaces, even if workspace-specific files have not changed.
40-
filters: |
41-
global:
42-
- ".github/workflows/ci.yml"
43-
- "package.json"
44-
- "package-lock.json"
45-
- "scripts/**"
46-
any-workspace:
47-
- "packages/**"
48-
scratch-svg-renderer:
49-
- "packages/scratch-svg-renderer/**"
50-
scratch-render:
51-
- "packages/scratch-render/**"
52-
- "packages/scratch-svg-renderer/**"
53-
scratch-vm:
54-
- "packages/scratch-render/**"
55-
- "packages/scratch-svg-renderer/**"
56-
- "packages/scratch-vm/**"
57-
scratch-gui:
58-
- "packages/scratch-gui/**"
59-
- "packages/scratch-render/**"
60-
- "packages/scratch-svg-renderer/**"
61-
- "packages/scratch-vm/**"
44+
filters: ./.github/path-filters.yml
6245

63-
- if: ${{ steps.filter.outputs.global == 'true' || steps.filter.outputs.any-workspace == 'true' }}
46+
- if: ${{ steps.filter.outputs.any-workspace == 'true' }}
6447
uses: ./.github/actions/install-dependencies
6548

6649
- name: Build packages
67-
if: ${{ steps.filter.outputs.global == 'true' || steps.filter.outputs.any-workspace == 'true' }}
50+
if: ${{ steps.filter.outputs.any-workspace == 'true' }}
6851
run: npm run build
6952

70-
- name: Test scratch-svg-renderer
71-
if: ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-svg-renderer == 'true') }}
72-
uses: ./.github/actions/test-package
53+
- name: Store build artifacts
54+
if: ${{ steps.filter.outputs.any-workspace == 'true' }}
55+
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4
7356
with:
74-
package_name: scratch-svg-renderer
75-
- name: Test scratch-render
76-
if: ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-render == 'true') }}
77-
uses: ./.github/actions/test-package
57+
name: build
58+
path: |
59+
packages/**/build
60+
packages/**/dist
61+
packages/**/playground
62+
63+
test:
64+
runs-on: ubuntu-latest
65+
needs: build
66+
if: ${{ needs.build.outputs.any-workspace == 'true' }}
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
package: ${{ fromJSON(needs.build.outputs.packages) }}
71+
exclude:
72+
- package: global
73+
- package: any-workspace
74+
name: Test ${{ matrix.package }}
75+
steps:
76+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
77+
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4
7878
with:
79-
package_name: scratch-render
80-
- name: Test scratch-vm
81-
if: ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-vm == 'true') }}
82-
uses: ./.github/actions/test-package
79+
cache: 'npm'
80+
node-version-file: '.nvmrc'
81+
- uses: ./.github/actions/install-dependencies
82+
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
8383
with:
84-
package_name: scratch-vm
85-
- name: Test scratch-gui
86-
if: ${{ !cancelled() && (steps.filter.outputs.global == 'true' || steps.filter.outputs.scratch-gui == 'true') }}
87-
uses: ./.github/actions/test-package
84+
name: build
85+
path: packages
86+
- uses: ./.github/actions/test-package
8887
with:
89-
package_name: scratch-gui
88+
package_name: ${{ matrix.package }}
89+
90+
results:
91+
name: Results
92+
runs-on: ubuntu-latest
93+
needs: test
94+
if: ${{ always() }}
95+
steps:
96+
- run: |
97+
case "${{ needs.test.result }}" in
98+
success)
99+
echo "Tests passed successfully."
100+
exit 0
101+
;;
102+
skipped)
103+
echo "Tests were unnecessary for these changes, so they were skipped."
104+
echo "If this is unexpected, check the path filters."
105+
exit 0
106+
;;
107+
*)
108+
echo "Tests failed."
109+
exit 1
110+
;;
111+
esac

.github/workflows/commitlint.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Lint commit messages
2+
on: [pull_request]
3+
4+
concurrency:
5+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.sha }}"
6+
7+
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
12+
- uses: wagoid/commitlint-github-action@9763196e10f27aef304c9b8b660d31d97fce0f99 # v5

.github/workflows/publish.yml

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,26 +72,55 @@ jobs:
7272
npm version "$NEW_VERSION" --no-git-tag-version
7373
git add package* && git commit -m "chore(release): $NEW_VERSION [skip ci]"
7474
75-
- name: Build packages
76-
run: npm run build
75+
# Install dependencies after the version update so that
76+
# the build outputs refer to the newest version of inner packages
77+
- uses: ./.github/actions/install-dependencies
7778

7879
- name: Publish scratch-svg-renderer
79-
run: npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-svg-renderer
80+
run: |
81+
npm run build --workspace @scratch/scratch-svg-renderer
82+
npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-svg-renderer
8083
env:
8184
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
8285

8386
- name: Publish scratch-render
84-
run: npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-render
87+
run: |
88+
npm run build --workspace @scratch/scratch-render
89+
npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-render
8590
env:
8691
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
8792

8893
- name: Publish scratch-vm
89-
run: npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-vm
94+
run: |
95+
npm run build --workspace @scratch/scratch-vm
96+
npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-vm
9097
env:
9198
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
9299

93100
- name: Publish scratch-gui
94-
run: npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-gui
101+
run: |
102+
cp ./packages/scratch-gui/package.json ./packages/scratch-gui/package-copy.json
103+
104+
jq 'del(.exports["./standalone"])' ./packages/scratch-gui/package.json | npx sponge ./packages/scratch-gui/package.json
105+
106+
npm run build:dist --workspace @scratch/scratch-gui
107+
npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-gui
108+
109+
mv ./packages/scratch-gui/package-copy.json ./packages/scratch-gui/package.json
110+
env:
111+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
112+
113+
- name: Publish scratch-gui-standalone
114+
run: |
115+
jq '
116+
.name = "@scratch/scratch-gui-standalone" |
117+
del(.peerDependencies) |
118+
.exports."." = .exports."./standalone" |
119+
del(.exports."./standalone")
120+
' ./packages/scratch-gui/package.json | npx sponge ./packages/scratch-gui/package.json
121+
122+
npm --workspace=@scratch/scratch-gui-standalone run clean && npm --workspace=@scratch/scratch-gui-standalone run build:dist-standalone
123+
npm publish --access=public --tag="${{steps.npm_tag.outputs.npm_tag}}" --workspace=@scratch/scratch-gui-standalone
95124
env:
96125
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
97126

.github/workflows/signature-assistant.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ permissions:
1313

1414
jobs:
1515
CLA-Assistant:
16-
if: github.event_name == 'pull_request_target' ||
16+
if: |
17+
github.event_name == 'pull_request_target' ||
1718
(
1819
github.event.comment.body == 'recheck' ||
1920
github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA'

.github/workflows/update-i18n.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ jobs:
2222
cache: 'npm'
2323
node-version-file: '.nvmrc'
2424
- name: Info
25+
# https://docs.github.com/en/actions/reference/security/secure-use#use-an-intermediate-environment-variable
26+
env:
27+
GH_HEAD_REF: ${{ github.head_ref }}
2528
run: |
2629
cat <<EOF
2730
Node version: $(node --version)
2831
NPM version: $(npm --version)
2932
GitHub ref: ${{ github.ref }}
30-
GitHub head ref: ${{ github.head_ref }}
33+
GitHub head ref: ${GH_HEAD_REF}
3134
EOF
3235
- name: Setup
3336
uses: ./.github/actions/install-dependencies

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.19.0
1+
20.19.4

0 commit comments

Comments
 (0)