@geolonia/embed 6.0.0-pre.4 → 6.0.0-pre.5
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/.github/dependabot.yml +89 -0
- package/.github/workflows/build.yml +84 -32
- package/.pinact.yml +80 -0
- package/.tool-versions +1 -0
- package/CHANGELOG.md +17 -0
- package/README.md +36 -7
- package/dist/embed +1 -1
- package/dist/embed-chunks/00ecbfa5ec913dd002fb.js +2 -0
- package/dist/embed-chunks/{18a79c1f77cc6894d617.js → 4574b15eb540c5efc533.js} +1 -1
- package/dist/embed-chunks/{b50d8f9685823588d639.js → 4b5b1b54a5dac816ef15.js} +1 -1
- package/dist/embed-chunks/52e84382012e7ba206d5.js +2 -0
- package/dist/embed-chunks/{cfb9cc05d697ae310f6a.js → d1fe32cb4bfb0e9c6575.js} +1 -1
- package/dist/embed-chunks/ffdb8e820d823ee3571c.js +1 -0
- package/dist/embed-core.js +2 -1
- package/dist/embed-core.js.LICENSE.txt +4 -0
- package/dist/embed.js +1 -1
- package/dist/embed.js.LICENSE.txt +1 -1
- package/dist/version.d.ts +1 -1
- package/e2e/helper.ts +2 -1
- package/e2e/production-bundle.spec.ts +56 -0
- package/package.json +21 -21
- package/playwright.config.ts +1 -1
- package/pnpm-workspace.yaml +23 -0
- package/src/version.ts +1 -1
- package/webpack.config.js +27 -1
- package/dist/embed-chunks/88308c97950af0326501.js +0 -1
- package/dist/embed-chunks/c22ad704365fc721df0a.js +0 -2
- package/dist/embed-chunks/ec26dd45d3c0fe2695b2.js +0 -2
- /package/dist/embed-chunks/{c22ad704365fc721df0a.js.LICENSE.txt → 00ecbfa5ec913dd002fb.js.LICENSE.txt} +0 -0
- /package/dist/embed-chunks/{ec26dd45d3c0fe2695b2.js.LICENSE.txt → 52e84382012e7ba206d5.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Dependabot の設定。
|
|
2
|
+
#
|
|
3
|
+
# embed は pnpm を使うが、Dependabot では pnpm も `package-ecosystem: npm` で扱う
|
|
4
|
+
# (pnpm-lock.yaml を更新する)。pnpm 12 のマルチドキュメント lock でも version updates は
|
|
5
|
+
# 動作する。依存グラフ側のパーサーだけが 1 つ目のドキュメントしか読めないため、
|
|
6
|
+
# pnpm-workspace.yaml の `pmOnFail: ignore` で lock を単一ドキュメントに保っている。
|
|
7
|
+
# 詳細は pnpm-workspace.yaml のコメントと geolonia/embed#524 を参照。
|
|
8
|
+
version: 2
|
|
9
|
+
updates:
|
|
10
|
+
- package-ecosystem: npm
|
|
11
|
+
directory: /
|
|
12
|
+
schedule:
|
|
13
|
+
interval: weekly
|
|
14
|
+
# リリース直後の不安定な版を掴まないよう、公開から 8 日待つ。
|
|
15
|
+
cooldown:
|
|
16
|
+
default-days: 8
|
|
17
|
+
# major の定期更新は当面見送る。いま溜まっているだけで 16 件あり
|
|
18
|
+
# (typescript 5->7, eslint 9->10, vitest 4->5, webpack-cli 5->7 など)、
|
|
19
|
+
# いずれも設定変更を伴うため自動 PR で片付く性質のものではない。
|
|
20
|
+
# まず仕組みを動かすことを優先し、メジャー更新は個別に計画して行う。
|
|
21
|
+
#
|
|
22
|
+
# `version-update:` の接頭辞が示すとおり、この ignore は version updates に
|
|
23
|
+
# だけ効く。脆弱性由来の security updates は major でも従来どおり出る。
|
|
24
|
+
ignore:
|
|
25
|
+
- dependency-name: '*'
|
|
26
|
+
update-types:
|
|
27
|
+
- version-update:semver-major
|
|
28
|
+
groups:
|
|
29
|
+
# 残る minor / patch は週 1 本の PR にまとめる。security updates は
|
|
30
|
+
# グループに入らず個別のまま (groups の既定は applies-to: version-updates)。
|
|
31
|
+
npm:
|
|
32
|
+
patterns:
|
|
33
|
+
- '*'
|
|
34
|
+
update-types:
|
|
35
|
+
- minor
|
|
36
|
+
- patch
|
|
37
|
+
|
|
38
|
+
# GitHub Actions のピン運用は Geolonia の標準に従う。canonical な設定は
|
|
39
|
+
# geolonia/.github の `pinact/dependabot.yml` と `.pinact.yml`、解説は
|
|
40
|
+
# geolonia/skills の skills/geolonia-actions-pinning/SKILL.md。
|
|
41
|
+
#
|
|
42
|
+
# Dependabot は SHA と行末の版コメントの両方を書き換えるので、SHA 固定が
|
|
43
|
+
# 腐らない。cooldown を 8 日にしてあるのは .pinact.yml の min_age (7 日) より
|
|
44
|
+
# 1 日長くするため。Dependabot は暦日で数え pinact は 168 時間で判定するので、
|
|
45
|
+
# この 1 日ぶんの余裕で version updates の PR は pinact の min_age を満たす。
|
|
46
|
+
#
|
|
47
|
+
# ただし cooldown は version updates 専用で、security updates には効かない
|
|
48
|
+
# (GitHub のドキュメントに明記がある)。脆弱性の修正版が公開直後に提案されると
|
|
49
|
+
# pinact の min_age (always: true なので既存のピンも毎回監査される) に引っかかる。
|
|
50
|
+
# その場合は「待つ」を選ばない。脆弱性を抱えたまま 7 日置くほうが危険なので、
|
|
51
|
+
# 取り込みを優先して例外を切る:
|
|
52
|
+
#
|
|
53
|
+
# 1. .pinact.yml の rules に当該 action だけの一時例外を足す。geolonia/* の
|
|
54
|
+
# 免除と同じ書き方で、conditions の ActionName を当該 action にして
|
|
55
|
+
# `min_age: 0` を付ける
|
|
56
|
+
# 2. マージする
|
|
57
|
+
# 3. リリースから 7 日経ったら 1. の例外を外す
|
|
58
|
+
#
|
|
59
|
+
# CI のゲートはリポジトリの .pinact.yml を読むので、効くのは 1. の方法だけ。
|
|
60
|
+
# CLI の `--min-age 0` では上書きできない (設定ファイルが優先される。実測済み)。
|
|
61
|
+
# 手元で一度だけ黙らせたいときは `pinact run --check --exclude '<正規表現>'`。
|
|
62
|
+
#
|
|
63
|
+
# なお Action Pinning Check (org の Security Suite の一部) はこのリポジトリには
|
|
64
|
+
# まだ入っていないので、現時点でこれがゲートになることはない。導入時に効いてくる。
|
|
65
|
+
#
|
|
66
|
+
# なぜ今まで 1 件も来なかったか: この設定ファイル自体が #525 まで存在せず、
|
|
67
|
+
# 設定の無い Dependabot は security updates しか動かない。そのため
|
|
68
|
+
# aws-actions/configure-aws-credentials と chetan/git-restore-mtime-action は
|
|
69
|
+
# 長く v1 のままだった (OIDC などの互換性が理由ではない)。その間 action.yml の
|
|
70
|
+
# 宣言は node12 / node16 のままで GitHub に 2 度強制移行され
|
|
71
|
+
# (node12/16 -> node20 -> node24)、リリースのたびに「forced to run on
|
|
72
|
+
# Node.js 24」と `set-output` の非推奨警告が出ていた。両 action は
|
|
73
|
+
# この設定を入れた PR で最新版に上げてある。
|
|
74
|
+
- package-ecosystem: github-actions
|
|
75
|
+
directory: /
|
|
76
|
+
schedule:
|
|
77
|
+
interval: weekly
|
|
78
|
+
cooldown:
|
|
79
|
+
default-days: 8
|
|
80
|
+
groups:
|
|
81
|
+
# minor / patch は週 1 本の PR にまとめる。major はここから外してあるので
|
|
82
|
+
# 個別の PR として届き、破壊的変更を単独でレビューできる。security updates も
|
|
83
|
+
# 個別のまま (groups の既定は applies-to: version-updates)。
|
|
84
|
+
github-actions:
|
|
85
|
+
patterns:
|
|
86
|
+
- '*'
|
|
87
|
+
update-types:
|
|
88
|
+
- minor
|
|
89
|
+
- patch
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
2
2
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
3
3
|
|
|
4
|
+
# action は commit SHA で固定する (Geolonia の標準。geolonia/skills の
|
|
5
|
+
# skills/geolonia-actions-pinning/SKILL.md を参照)。`@v6` のようなタグは可変で、
|
|
6
|
+
# 付け替えられると気づかないまま別のコードが走る (tj-actions/changed-files の事例)。
|
|
7
|
+
#
|
|
8
|
+
# SHA と行末の版コメントは手で書かない。`pinact run` が生成し、更新は Dependabot の
|
|
9
|
+
# github-actions エコシステムが SHA ごと書き換える (.github/dependabot.yml)。
|
|
10
|
+
# 設定は .pinact.yml (geolonia/.github の canonical をそのまま置いたもの)。
|
|
11
|
+
|
|
4
12
|
name: build
|
|
5
13
|
|
|
6
14
|
on:
|
|
@@ -29,18 +37,46 @@ jobs:
|
|
|
29
37
|
matrix:
|
|
30
38
|
node-version: ['22.x']
|
|
31
39
|
steps:
|
|
32
|
-
- uses: actions/checkout@
|
|
40
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
41
|
+
# setup-node の cache: 'pnpm' は store path を引くのに pnpm を必要とするので先に入れる。
|
|
42
|
+
# pnpm のバージョンは package.json の packageManager から読まれる。
|
|
43
|
+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
33
44
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
34
|
-
uses: actions/setup-node@
|
|
45
|
+
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
35
46
|
with:
|
|
36
47
|
node-version: ${{ matrix.node-version }}
|
|
37
|
-
cache: '
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
48
|
+
cache: 'pnpm'
|
|
49
|
+
|
|
50
|
+
# pnpm のバージョンは package.json の packageManager と .tool-versions の 2 箇所に
|
|
51
|
+
# 固定されている。pnpm-workspace.yaml で pmOnFail: ignore にしているため、両者が
|
|
52
|
+
# 食い違っても pnpm 自身は何も言わない (ignore にした理由は pnpm-workspace.yaml の
|
|
53
|
+
# コメントを参照)。黙ってズレるのを防ぐためここで突き合わせる。
|
|
54
|
+
#
|
|
55
|
+
# Node のピン (.tool-versions / .nvmrc / この workflow) は粒度を変えて運用しているので
|
|
56
|
+
# 対象外。ここで見ているのは pnpm だけ。
|
|
57
|
+
- name: Check the pnpm pins agree
|
|
58
|
+
run: |
|
|
59
|
+
set -euo pipefail
|
|
60
|
+
# corepack use は packageManager を "pnpm@12.9.1+sha512.xxx" の形で書くので + 以降を落とす。
|
|
61
|
+
pm="$(node -p "(require('./package.json').packageManager || '').replace(/^pnpm@/, '').split('+')[0]")"
|
|
62
|
+
# .tool-versions は 1 行に複数版を書けるので先頭 (既定) だけを見る。# 始まりはコメント。
|
|
63
|
+
tv="$(awk '!/^[[:space:]]*#/ && $1=="pnpm" {print $2; exit}' .tool-versions)"
|
|
64
|
+
if [ -z "$pm" ] || [ -z "$tv" ]; then
|
|
65
|
+
echo "pnpm のピンが見つかりません (packageManager='$pm' .tool-versions='$tv')"
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
68
|
+
if [ "$pm" != "$tv" ]; then
|
|
69
|
+
echo "pnpm のピンが不一致です: package.json の packageManager=$pm / .tool-versions=$tv"
|
|
70
|
+
exit 1
|
|
71
|
+
fi
|
|
72
|
+
echo "pnpm pin OK: $pm"
|
|
73
|
+
|
|
74
|
+
- run: pnpm install --frozen-lockfile
|
|
75
|
+
- run: pnpm run lint
|
|
76
|
+
- run: pnpm run test
|
|
77
|
+
- run: pnpm run build
|
|
42
78
|
- name: save the built
|
|
43
|
-
uses: actions/upload-artifact@v7
|
|
79
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
44
80
|
if: "!failure()"
|
|
45
81
|
with:
|
|
46
82
|
retention-days: 1
|
|
@@ -54,18 +90,29 @@ jobs:
|
|
|
54
90
|
timeout-minutes: 30
|
|
55
91
|
needs: build
|
|
56
92
|
steps:
|
|
57
|
-
- uses: actions/checkout@
|
|
58
|
-
- uses:
|
|
93
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
94
|
+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
95
|
+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
59
96
|
with:
|
|
60
97
|
node-version: '22.x'
|
|
61
|
-
cache: '
|
|
62
|
-
- run:
|
|
98
|
+
cache: 'pnpm'
|
|
99
|
+
- run: pnpm install --frozen-lockfile
|
|
100
|
+
|
|
101
|
+
# production 出力 (docs/embed.js) は .gitignore 対象で、このジョブは build を
|
|
102
|
+
# 実行しない。e2e/production-bundle.spec.ts が読むので build ジョブの成果物を
|
|
103
|
+
# 展開する。dev サーバーの出力ファイル名は `embed` なので、`embed.js` は
|
|
104
|
+
# ここで展開した production の出力が静的配信される。
|
|
105
|
+
- name: load the built
|
|
106
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
107
|
+
with:
|
|
108
|
+
name: the-built
|
|
109
|
+
|
|
63
110
|
- name: Install Playwright
|
|
64
|
-
run:
|
|
111
|
+
run: pnpm exec playwright install --with-deps chromium
|
|
65
112
|
- name: Run e2e tests
|
|
66
|
-
run:
|
|
113
|
+
run: pnpm run e2e
|
|
67
114
|
- name: Upload Playwright report
|
|
68
|
-
uses: actions/upload-artifact@v7
|
|
115
|
+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
69
116
|
if: ${{ !cancelled() }}
|
|
70
117
|
with:
|
|
71
118
|
name: playwright-report
|
|
@@ -80,8 +127,8 @@ jobs:
|
|
|
80
127
|
- act-test
|
|
81
128
|
if: ${{ github.ref == 'refs/heads/master' }}
|
|
82
129
|
steps:
|
|
83
|
-
- uses: actions/checkout@
|
|
84
|
-
- uses: actions/setup-node@
|
|
130
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
131
|
+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
85
132
|
with:
|
|
86
133
|
node-version: '22.x'
|
|
87
134
|
- name: Clean repo
|
|
@@ -89,7 +136,7 @@ jobs:
|
|
|
89
136
|
git checkout --orphan gh-pages
|
|
90
137
|
git rm -rf . > /dev/null 2>&1
|
|
91
138
|
- name: load the built
|
|
92
|
-
uses: actions/download-artifact@v8
|
|
139
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
93
140
|
with:
|
|
94
141
|
name: the-built
|
|
95
142
|
- name: Setup and deploy Github Pages
|
|
@@ -114,27 +161,30 @@ jobs:
|
|
|
114
161
|
- act-test
|
|
115
162
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
116
163
|
steps:
|
|
117
|
-
- uses: actions/checkout@
|
|
118
|
-
- uses:
|
|
164
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
165
|
+
- uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
|
|
166
|
+
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
|
119
167
|
with:
|
|
120
168
|
node-version: '22.x'
|
|
121
169
|
registry-url: 'https://registry.npmjs.org'
|
|
122
170
|
scope: '@geolonia'
|
|
123
171
|
- name: load the built
|
|
124
|
-
uses: actions/download-artifact@v8
|
|
172
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
125
173
|
with:
|
|
126
174
|
name: the-built
|
|
127
175
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
176
|
+
# trusted publishing (OIDC) と provenance は pnpm も対応している。npm は OIDC で
|
|
177
|
+
# publish すると provenance を自動で付けるが、pnpm は明示が要るので --provenance を渡す。
|
|
178
|
+
# --no-git-checks は、このジョブがタグを checkout したうえにビルド成果物を
|
|
179
|
+
# 作業ツリーへ展開するため、pnpm 既定の git チェック
|
|
180
|
+
# (ERR_PNPM_GIT_UNCLEAN / ERR_PNPM_GIT_NOT_CORRECT_BRANCH) に引っかかるのを避けるもの。
|
|
131
181
|
- name: 'Publish to NPM (latest)'
|
|
132
182
|
if: "!contains(github.ref, '-pre.')"
|
|
133
|
-
run:
|
|
183
|
+
run: pnpm publish --access=public --provenance --no-git-checks
|
|
134
184
|
|
|
135
185
|
- name: 'Publish to NPM (next)'
|
|
136
186
|
if: "contains(github.ref, '-pre.')"
|
|
137
|
-
run:
|
|
187
|
+
run: pnpm publish --access=public --tag=next --provenance --no-git-checks
|
|
138
188
|
|
|
139
189
|
deploy:
|
|
140
190
|
needs: [build, e2e]
|
|
@@ -147,11 +197,11 @@ jobs:
|
|
|
147
197
|
contents: read
|
|
148
198
|
|
|
149
199
|
steps:
|
|
150
|
-
- uses: actions/checkout@
|
|
200
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
151
201
|
with:
|
|
152
202
|
fetch-depth: 0
|
|
153
203
|
|
|
154
|
-
- uses: actions/download-artifact@v8
|
|
204
|
+
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
155
205
|
with: { name: the-built, path: ./ }
|
|
156
206
|
|
|
157
207
|
- name: Read version
|
|
@@ -164,19 +214,21 @@ jobs:
|
|
|
164
214
|
echo "major_version=$MAJOR" >> "$GITHUB_OUTPUT"
|
|
165
215
|
|
|
166
216
|
- name: Restore timestamps
|
|
167
|
-
uses: chetan/git-restore-mtime-action@
|
|
217
|
+
uses: chetan/git-restore-mtime-action@d186aca54f8760da4dec55313195e51ed3ebb0b3 # v2.3
|
|
168
218
|
|
|
169
219
|
- name: Configure AWS Credentials for test
|
|
170
220
|
if: ${{ env.ACT }}
|
|
171
|
-
uses: aws-actions/configure-aws-credentials@
|
|
221
|
+
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
|
|
172
222
|
with:
|
|
173
223
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
174
224
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
175
|
-
|
|
225
|
+
# 下の deploy 用ステップと同じリージョンに揃える。以前は未定義の
|
|
226
|
+
# env.AWS_REGION を参照していた (v6 で aws-region は required)。
|
|
227
|
+
aws-region: ap-northeast-1
|
|
176
228
|
|
|
177
229
|
- name: Configure AWS Credentials for deploy
|
|
178
230
|
if: ${{ !env.ACT }}
|
|
179
|
-
uses: aws-actions/configure-aws-credentials@
|
|
231
|
+
uses: aws-actions/configure-aws-credentials@e1253824e5c10ff9df46874f81ed3ec929e19cfd # v6.3.0
|
|
180
232
|
with:
|
|
181
233
|
aws-region: ap-northeast-1
|
|
182
234
|
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
|
package/.pinact.yml
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Canonical pinact config for the Geolonia org.
|
|
2
|
+
#
|
|
3
|
+
# Drop this file at the root of your repository as `.pinact.yml`. pinact
|
|
4
|
+
# reads it both locally (pre-commit, manual `pinact run`) and in CI (the
|
|
5
|
+
# Action Pinning Check), so local and CI behave identically. Requires
|
|
6
|
+
# pinact v4+ (the `version` field below).
|
|
7
|
+
#
|
|
8
|
+
# What it does:
|
|
9
|
+
#
|
|
10
|
+
# min_age.value: 7 Do not pin (or update to) an action release that
|
|
11
|
+
# is younger than 7 days. A freshly published tag or
|
|
12
|
+
# release is the window when a hijacked-tag supply
|
|
13
|
+
# chain attack is most likely to still be live, so
|
|
14
|
+
# we wait it out. This is the GitHub Actions analog
|
|
15
|
+
# of pnpm's `minimumReleaseAge`.
|
|
16
|
+
#
|
|
17
|
+
# min_age.always: true Verify the 7-day age of CURRENT pins on every
|
|
18
|
+
# run, not only when `--verify-min-age` is passed.
|
|
19
|
+
# Keeps the rule on by default for local runs.
|
|
20
|
+
#
|
|
21
|
+
# rules (geolonia/*) Exempt our own org from the cooldown. The 7-day
|
|
22
|
+
# window guards against a hijacked THIRD-PARTY
|
|
23
|
+
# release; we author and control geolonia/* releases
|
|
24
|
+
# ourselves, and a brand-new geolonia/.github
|
|
25
|
+
# reusable would otherwise be un-adoptable for a
|
|
26
|
+
# week (no older release contains it). Still
|
|
27
|
+
# SHA-pinned; Dependabot maintains them.
|
|
28
|
+
#
|
|
29
|
+
# Pin comments use pinact's default single-space separator (`@<sha> # vX.Y.Z`),
|
|
30
|
+
# which is also what Prettier emits for YAML, so the two never fight.
|
|
31
|
+
#
|
|
32
|
+
# Bump an action by letting Dependabot (github-actions, weekly, with an
|
|
33
|
+
# 8-day cooldown: one day over this min_age, so its PRs always clear the
|
|
34
|
+
# pinact gate) open the PR, or run `pinact run --update`
|
|
35
|
+
# locally. Do not hand-edit the SHA or the version comment; pinact keeps
|
|
36
|
+
# the two in sync.
|
|
37
|
+
version: 3
|
|
38
|
+
# Besides this repo's own workflows, also verify the GitHub Actions pinned in the
|
|
39
|
+
# org workflow templates served by the "New workflow" picker (workflow-templates/).
|
|
40
|
+
# The picker copies these files verbatim, so they must already be SHA-pinned for
|
|
41
|
+
# an adopting repo's Action Pinning Check to pass on first commit. Dependabot's
|
|
42
|
+
# github-actions ecosystem only scans .github/workflows, so it cannot reach these
|
|
43
|
+
# template files; this check covers them here, catching any unpinned or
|
|
44
|
+
# comment-mismatched ref at PR time. Setting `files` replaces pinact's default
|
|
45
|
+
# list, so the default workflow and composite-action patterns are repeated first.
|
|
46
|
+
files:
|
|
47
|
+
- pattern: .github/workflows/*.yml
|
|
48
|
+
- pattern: .github/workflows/*.yaml
|
|
49
|
+
- pattern: .github/actions/*/action.yml
|
|
50
|
+
- pattern: .github/actions/*/action.yaml
|
|
51
|
+
- pattern: workflow-templates/*.yml
|
|
52
|
+
- pattern: workflow-templates/*.yaml
|
|
53
|
+
min_age:
|
|
54
|
+
value: 7
|
|
55
|
+
always: true
|
|
56
|
+
rules:
|
|
57
|
+
- min_age: 0
|
|
58
|
+
conditions:
|
|
59
|
+
- expr: |
|
|
60
|
+
ActionName matches "geolonia/.*"
|
|
61
|
+
# Let geolonia/.github reusable workflows float on a major tag (v1, v2, ...)
|
|
62
|
+
# instead of being SHA-pinned. Our reusables use bot-moved major tags by
|
|
63
|
+
# design (a vX.Y.Z push fast-forwards vX), so a caller pinned to @v1 always
|
|
64
|
+
# gets the newest release with no chain-bump. That is what the org "Security
|
|
65
|
+
# Suite" ruleset relies on: security-suite.yml -> reusable-security-suite.yml
|
|
66
|
+
# -> the scanner reusables, all at @v1, so a suite change ships in one
|
|
67
|
+
# release instead of a caller-bump-per-release treadmill.
|
|
68
|
+
#
|
|
69
|
+
# Scope and safety: this only exempts references to geolonia org actions and
|
|
70
|
+
# reusables at a bare major tag (^v[0-9]+$). SHA pins still pass (ignore
|
|
71
|
+
# never forces un-pinning), and mutable refs like @main or a branch are
|
|
72
|
+
# still flagged. It reuses the same `geolonia/*` scope as the cooldown
|
|
73
|
+
# exemption above, on the same "we author and control these releases" basis;
|
|
74
|
+
# a hijacked @v1 here is the same threat as this repo being compromised.
|
|
75
|
+
# (The org zizmor.yml mirrors this with an unpinned-uses ref-pin policy for
|
|
76
|
+
# `geolonia/*`.) Third-party actions remain SHA-pinned as normal.
|
|
77
|
+
- ignore: true
|
|
78
|
+
conditions:
|
|
79
|
+
- expr: |
|
|
80
|
+
ActionName matches "geolonia/.*" && ActionVersion matches "^v[0-9]+$"
|
package/.tool-versions
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
## @geolonia/embed
|
|
4
4
|
|
|
5
|
+
### v6.0.0-pre.5
|
|
6
|
+
|
|
7
|
+
配布物に関わる変更は、maplibre-gl の更新とライセンス表記の修正の 2 点です。それ以外は開発環境と CI の整備で、`dist/` の中身は 6.0.0-pre.4 と実質同一です。
|
|
8
|
+
|
|
9
|
+
- **Fix**: 同梱する maplibre-gl を `6.11.2` から `6.12.0` へ更新しました。利用者に関係する修正として、1 つの attribution に閉じていないタグがあると他の attribution まで消えてしまう問題(各 attribution を個別にサニタイズするよう修正、maplibre-gl-js#8569)、`GeoJSONSource#setData` を worker の処理より速く呼ぶとメモリが増え続けてページがクラッシュする問題、terrain 有効時に `fill-outline-color` と塗りのアンチエイリアス縁が描画されない問題などが含まれます。
|
|
10
|
+
- **Note**: 6.12.0 には、WebGL コンテキストが失われている最中に `setStyle` を呼ぶと未捕捉エラーになる不具合があります(maplibre-gl-js#8693 で 6.14.0 にて修正)。embed 自身はこのコードパスを通りませんが、`window.geolonia` 経由で `map.setStyle()` を直接呼んでいる場合は該当しえます。
|
|
11
|
+
- **回避策**: コンテキストが失われている間は `setStyle()` を呼ばず、`map.on('webglcontextrestored', ...)` の中で適用してください。maplibre はコンテキスト復元時に painter を再生成したうえでこのイベントを発火するため、この中での `setStyle()` は安全です。喪失は `map.on('webglcontextlost', ...)` で検知できます。
|
|
12
|
+
- なお maplibre は**喪失前のスタイルを復元時に自動で適用し直す**ため、スタイルを切り替えていない場合は特に対処は要りません。
|
|
13
|
+
- `try`/`catch` では防げません。エラーは `setStyle()` の呼び出し時ではなく、破棄済みの painter でレンダリングしようとした時点で発生します(6.14.0 の修正も、コンテキスト喪失中はレンダリングを飛ばすというものです)。
|
|
14
|
+
- 6.14.0 への更新は [#534](https://github.com/geolonia/embed/issues/534) で対応します。
|
|
15
|
+
- **Fix**: `dist/embed-core.js` に maplibre-gl のライセンス表記が付かなくなっていた問題を修正しました。6.0.0-pre.4 では `dist/embed-core.js.LICENSE.txt` が出力されず、maplibre-gl を同梱しながら表記が無い状態で公開されていました(6.0.0-pre.3 までは出力されていました)。terser が maplibre のソース先頭の `@license` コメントを、付随するコードごと落としていたのが原因です。webpack の `BannerPlugin` で明示的に付与するよう変更し、偶然に依存しないようにしました。
|
|
16
|
+
- **Internal**: パッケージマネージャを npm から pnpm へ移行しました([#520](https://github.com/geolonia/embed/issues/520))。配布物の中身は変わりません。`@types/geojson` を devDependencies に明示(これまで hoist に依存していました)、`.npmrc` の設定を `pnpm-workspace.yaml` へ移設、CI と publish を pnpm 化しています。
|
|
17
|
+
- **Internal**: Dependabot が動かなくなっていた問題を解消しました([#524](https://github.com/geolonia/embed/issues/524))。pnpm 12 は `pnpm-lock.yaml` を複数ドキュメントで書き出しますが、GitHub の依存グラフのパーサーは先頭のドキュメントしか読まないため、グラフが 23 パッケージまで縮んでアラートが出ない状態でした。`pnpm-workspace.yaml` の `pmOnFail: ignore` で単一ドキュメントに戻し(796 パッケージに回復)、あわせて `.github/dependabot.yml` を追加しています。
|
|
18
|
+
- **Internal**: webpack 系のツールチェーンをまとめて更新しました([#527](https://github.com/geolonia/embed/issues/527))。webpack-dev-server 6 / webpack-cli 7 / webpack-bundle-analyzer 5 / css-loader 7 / style-loader 4 へ上げ、未使用だった babel-loader を削除しています。いずれも開発時のみの依存です。これにより `uuid` の脆弱性アラート(GHSA-w5hq-g745-h8pq、webpack-dev-server 5 の sockjs 経由)が解消し、open なアラートは 0 件になりました。出力の差分は webpack の内部モジュール ID の採番のみで、ファイル構成は一致しています。
|
|
19
|
+
- **Internal**: production バンドル(`dist/embed.js`)を直接読み込む e2e を追加しました([#529](https://github.com/geolonia/embed/pull/529))。これまでの e2e は dev サーバーのバンドルを読んでおり、minify やローダーの更新で production だけが壊れる事故を検知できませんでした。
|
|
20
|
+
- **Internal**: 開発環境と CI を整備しました。pnpm を `.tool-versions` で管理し、`package.json` の `packageManager` とのズレを CI で検査します([#526](https://github.com/geolonia/embed/pull/526))。また workflow の GitHub Actions をすべて commit SHA で固定し([#530](https://github.com/geolonia/embed/pull/530))、長く `@v1` のままだった `aws-actions/configure-aws-credentials`(→ v6.3.0)と `chetan/git-restore-mtime-action`(→ v2.3)、および `actions/checkout`(→ v7.0.1)、`actions/setup-node`(→ v7.0.0)を更新しました。
|
|
21
|
+
|
|
5
22
|
### v6.0.0-pre.4
|
|
6
23
|
|
|
7
24
|
- **Breaking**: バンドルする maplibre-gl を v6 系(`6.11.2`)へ更新しました([#518](https://github.com/geolonia/embed/issues/518))。`@geolonia/maps-core` `^0.6.0` の `peerDependencies` が `maplibre-gl: ^6.0.0` になったことへの追従です。maplibre-gl v6 にデフォルトエクスポートはありません。`window.geolonia` 経由で maplibre の API を直接触っている場合は [maplibre-gl v6 の変更点](https://github.com/maplibre/maplibre-gl-js/releases) を確認してください。
|
package/README.md
CHANGED
|
@@ -152,22 +152,51 @@ You can see more examples at [https://geolonia.github.io/embed/](https://geoloni
|
|
|
152
152
|
|
|
153
153
|
### How to build
|
|
154
154
|
|
|
155
|
+
This project uses [pnpm](https://pnpm.io/). The version is pinned in two places, which must be kept
|
|
156
|
+
in sync: the `packageManager` field of `package.json` (used by
|
|
157
|
+
[Corepack](https://nodejs.org/api/corepack.html) and by `pnpm/action-setup` in CI) and
|
|
158
|
+
`.tool-versions` (used by [asdf](https://asdf-vm.com/) and [mise](https://mise.jdx.dev/)).
|
|
159
|
+
`pnpm-workspace.yaml` sets `pmOnFail: ignore`, so pnpm itself will not correct a mismatch; the
|
|
160
|
+
`build` workflow compares the two pins instead and fails if they disagree.
|
|
161
|
+
|
|
155
162
|
```shell
|
|
156
163
|
$ git clone git@github.com:geolonia/embed.git
|
|
157
164
|
$ cd embed
|
|
158
|
-
$
|
|
159
|
-
$
|
|
160
|
-
$
|
|
161
|
-
$
|
|
162
|
-
$
|
|
165
|
+
$ pnpm install
|
|
166
|
+
$ pnpm start # run dev server
|
|
167
|
+
$ pnpm test # run tests
|
|
168
|
+
$ pnpm run e2e # run e2e tests (run `pnpm run build` first to include the production-bundle test)
|
|
169
|
+
$ pnpm run build # build production bundle
|
|
163
170
|
```
|
|
164
171
|
|
|
165
172
|
Then you can see `http://localhost:3000/`.
|
|
166
173
|
|
|
174
|
+
## Dependency updates
|
|
175
|
+
|
|
176
|
+
Dependencies are updated by Dependabot, configured in `.github/dependabot.yml`. Minor and patch
|
|
177
|
+
updates arrive as one grouped weekly PR. Major version updates are ignored for now — there is a
|
|
178
|
+
backlog of them and each needs its own plan — but security updates still arrive for any version,
|
|
179
|
+
major included, because an `ignore` on `version-update:semver-major` only scopes version updates.
|
|
180
|
+
|
|
181
|
+
`pnpm-workspace.yaml` sets `pmOnFail: ignore`, and that line is load-bearing: without it pnpm 12
|
|
182
|
+
writes `pnpm-lock.yaml` as two YAML documents, GitHub's dependency-graph parser reads only the
|
|
183
|
+
first one (which holds nothing but pnpm itself), and no npm package ever reaches the graph — so no
|
|
184
|
+
Dependabot alert is raised. See `pnpm-workspace.yaml` and
|
|
185
|
+
[dependabot-core#15904](https://github.com/dependabot/dependabot-core/issues/15904). Keep the
|
|
186
|
+
lockfile a single YAML document.
|
|
187
|
+
|
|
188
|
+
To check by hand:
|
|
189
|
+
|
|
190
|
+
```shell
|
|
191
|
+
$ pnpm audit # vulnerabilities
|
|
192
|
+
$ pnpm outdated # available updates
|
|
193
|
+
$ pnpm why maplibre-gl # who pulls a package in
|
|
194
|
+
```
|
|
195
|
+
|
|
167
196
|
## Run Bundle analyzer
|
|
168
197
|
|
|
169
198
|
```shell
|
|
170
|
-
$
|
|
199
|
+
$ pnpm run analyze
|
|
171
200
|
```
|
|
172
201
|
|
|
173
202
|
## Snapshot testing
|
|
@@ -177,6 +206,6 @@ $ npm run analyze
|
|
|
177
206
|
```shell
|
|
178
207
|
$ cp .envrc.sample .envrc
|
|
179
208
|
$ vi .envrc
|
|
180
|
-
$
|
|
209
|
+
$ pnpm run build
|
|
181
210
|
$ docker build . -t geolonia/embed
|
|
182
211
|
```
|