@geolonia/embed 5.0.0 → 5.0.2
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/workflows/build.yml +16 -14
- package/.nvmrc +1 -1
- package/.prettierrc.json +4 -0
- package/.tool-versions +1 -1
- package/README.md +7 -1
- package/dist/embed +1 -1
- package/dist/embed-chunks/2489af4328c51b71e92d.js +2 -0
- package/dist/embed-chunks/6e05bbf5f391fda5b858.js +1 -0
- package/dist/embed.js +1 -1
- package/dist/src/embed.d.ts +3 -1
- package/dist/src/lib/geolonia-map.d.ts +1 -2
- package/dist/src/lib/geolonia-marker.d.ts +1 -2
- package/dist/src/lib/util.d.ts +1 -0
- package/dist/src/version.d.ts +1 -1
- package/e2e/map.spec.ts +1 -1
- package/eslint.config.js +232 -0
- package/package.json +19 -10
- package/src/embed.ts +13 -7
- package/src/lib/CustomAttributionControl.ts +52 -29
- package/src/lib/geolonia-map.ts +126 -39
- package/src/lib/geolonia-marker.ts +9 -6
- package/src/lib/keyring.test.ts +18 -0
- package/src/lib/keyring.ts +11 -13
- package/src/lib/maplibre-util.ts +31 -19
- package/src/lib/parse-atts.test.ts +2 -3
- package/src/lib/render.ts +18 -7
- package/src/lib/simplestyle-vector.ts +42 -13
- package/src/lib/simplestyle.test.ts +80 -69
- package/src/lib/simplestyle.ts +55 -34
- package/src/lib/util.test.ts +71 -22
- package/src/lib/util.ts +88 -32
- package/src/testability.test.ts +7 -4
- package/webpack.config.js +10 -1
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -17
- package/.prettierrc.js +0 -1
- package/dist/embed-chunks/416af3373e37004e65f4.js +0 -1
- package/dist/embed-chunks/488aacb380a87ea633f6.js +0 -2
- /package/dist/embed-chunks/{488aacb380a87ea633f6.js.LICENSE.txt → 2489af4328c51b71e92d.js.LICENSE.txt} +0 -0
|
@@ -27,7 +27,7 @@ jobs:
|
|
|
27
27
|
runs-on: ubuntu-latest
|
|
28
28
|
strategy:
|
|
29
29
|
matrix:
|
|
30
|
-
node-version: ['
|
|
30
|
+
node-version: ['22.x']
|
|
31
31
|
steps:
|
|
32
32
|
- uses: actions/checkout@v4
|
|
33
33
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
@@ -38,11 +38,11 @@ jobs:
|
|
|
38
38
|
uses: actions/cache@v4
|
|
39
39
|
with:
|
|
40
40
|
path: node_modules
|
|
41
|
-
key: modules-cache-v1-${{ runner.os }}-${{ hashFiles('
|
|
42
|
-
- run:
|
|
43
|
-
- run:
|
|
44
|
-
- run:
|
|
45
|
-
- run:
|
|
41
|
+
key: modules-cache-v1-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
|
|
42
|
+
- run: npm install
|
|
43
|
+
- run: npm run lint
|
|
44
|
+
- run: npm run test
|
|
45
|
+
- run: npm run build
|
|
46
46
|
- name: save the built
|
|
47
47
|
uses: actions/upload-artifact@v4
|
|
48
48
|
if: "!failure()"
|
|
@@ -64,7 +64,7 @@ jobs:
|
|
|
64
64
|
- uses: actions/checkout@v4
|
|
65
65
|
- uses: actions/setup-node@v4
|
|
66
66
|
with:
|
|
67
|
-
node-version: '
|
|
67
|
+
node-version: '22.x'
|
|
68
68
|
- name: Clean repo
|
|
69
69
|
run: |
|
|
70
70
|
git checkout --orphan gh-pages
|
|
@@ -95,7 +95,7 @@ jobs:
|
|
|
95
95
|
- uses: actions/setup-node@v4
|
|
96
96
|
with:
|
|
97
97
|
tag_name: 'v%s'
|
|
98
|
-
node-version: '
|
|
98
|
+
node-version: '22.x'
|
|
99
99
|
registry-url: 'https://registry.npmjs.org'
|
|
100
100
|
scope: '@geolonia'
|
|
101
101
|
- name: load the built
|
|
@@ -155,7 +155,7 @@ jobs:
|
|
|
155
155
|
uses: aws-actions/configure-aws-credentials@v1
|
|
156
156
|
with:
|
|
157
157
|
aws-region: ap-northeast-1
|
|
158
|
-
role-to-assume:
|
|
158
|
+
role-to-assume: ${{ secrets.AWS_DEPLOY_ROLE }}
|
|
159
159
|
|
|
160
160
|
- name: Deploy to S3
|
|
161
161
|
run: |
|
|
@@ -167,15 +167,17 @@ jobs:
|
|
|
167
167
|
# For resources that will be manually invalidated, an addition s-maxage so CloudFront keeps the file in its cache as long as possible.
|
|
168
168
|
|
|
169
169
|
# Deploy embed chunks -- because they have fingerprints in the filename, they're immutable
|
|
170
|
-
aws s3 sync ./dist/embed-chunks s3://${{ secrets.CDN_BUCKET }}/v${{ steps.version.outputs.major_version }}/embed-chunks --cache-control "public,max-age=31536000,immutable"
|
|
171
|
-
aws s3 sync ./dist/embed-chunks s3://${{ secrets.CDN_BUCKET }}/v${{ steps.version.outputs.version }}/embed-chunks --cache-control "public,max-age=31536000,immutable"
|
|
170
|
+
aws s3 sync ./dist/embed-chunks s3://${{ secrets.CDN_BUCKET }}/embed/v${{ steps.version.outputs.major_version }}/embed-chunks --cache-control "public,max-age=31536000,immutable"
|
|
171
|
+
aws s3 sync ./dist/embed-chunks s3://${{ secrets.CDN_BUCKET }}/embed/v${{ steps.version.outputs.version }}/embed-chunks --cache-control "public,max-age=31536000,immutable"
|
|
172
172
|
|
|
173
173
|
# Deploy main embed entrypoint
|
|
174
174
|
# I used to use s-maxage here, but after testing decided to revert back to only using max-age.
|
|
175
175
|
# If you use s-maxage that is much longer than max-age, the age header will be longer than
|
|
176
176
|
# max-age, and the browser will think that the file is expired. Using max-age will make
|
|
177
177
|
# CloudFront fetch a new file every 3600 seconds, resetting the Age header
|
|
178
|
-
aws s3 cp ./dist/embed s3://${{ secrets.CDN_BUCKET }}/v${{ steps.version.outputs.major_version }}/embed --cache-control "public,max-age=3600" --content-type "application/javascript; charset=UTF-8"
|
|
179
|
-
aws s3 cp ./dist/embed s3://${{ secrets.CDN_BUCKET }}/v${{ steps.version.outputs.
|
|
178
|
+
aws s3 cp ./dist/embed s3://${{ secrets.CDN_BUCKET }}/embed/v${{ steps.version.outputs.major_version }}/embed --cache-control "public,max-age=3600" --content-type "application/javascript; charset=UTF-8"
|
|
179
|
+
aws s3 cp ./dist/embed.js.LICENSE.txt s3://${{ secrets.CDN_BUCKET }}/embed/v${{ steps.version.outputs.major_version }}/embed.js.LICENSE.txt --cache-control "public,max-age=3600" --content-type "text/plain; charset=UTF-8"
|
|
180
|
+
aws s3 cp ./dist/embed s3://${{ secrets.CDN_BUCKET }}/embed/v${{ steps.version.outputs.version }}/embed --cache-control "public,max-age=3600" --content-type "application/javascript; charset=UTF-8"
|
|
181
|
+
aws s3 cp ./dist/embed.js.LICENSE.txt s3://${{ secrets.CDN_BUCKET }}/embed/v${{ steps.version.outputs.version }}/embed.js.LICENSE.txt --cache-control "public,max-age=3600" --content-type "text/plain; charset=UTF-8"
|
|
180
182
|
|
|
181
|
-
aws cloudfront create-invalidation --distribution-id "
|
|
183
|
+
aws cloudfront create-invalidation --distribution-id "${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}" --paths "/embed/v${{ steps.version.outputs.major_version }}/embed" "/embed/v${{ steps.version.outputs.version }}/embed"
|
package/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
v22
|
package/.prettierrc.json
ADDED
package/.tool-versions
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
nodejs
|
|
1
|
+
nodejs 22.21.0
|
package/README.md
CHANGED
|
@@ -46,10 +46,16 @@ You can see more examples at [https://geolonia.github.io/embed/](https://geoloni
|
|
|
46
46
|
|
|
47
47
|
## Development
|
|
48
48
|
|
|
49
|
+
### Requirements
|
|
50
|
+
|
|
51
|
+
- node.js >= 22.18
|
|
52
|
+
|
|
53
|
+
### How to build
|
|
54
|
+
|
|
49
55
|
```shell
|
|
50
56
|
$ git clone git@github.com:geolonia/embed.git
|
|
51
57
|
$ cd embed
|
|
52
|
-
$
|
|
58
|
+
$ npm install
|
|
53
59
|
$ npm start # run dev server
|
|
54
60
|
$ npm test # run tests
|
|
55
61
|
$ npm run build # build production bundle
|