Skip to content

Commit b16b10f

Browse files
authored
Merge pull request #246 from crazy-max/esm
switch to ESM and update config/test wiring
2 parents 4936a4a + a786cba commit b16b10f

28 files changed

Lines changed: 1532 additions & 3850 deletions

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ jobs:
3131
uses: ./
3232
with:
3333
github-token: ${{ secrets.GITHUB_TOKEN }}
34-
yaml-file: ./__tests__/fixtures/labels.update.yml
34+
yaml-file: ./tests/fixtures/labels.update.yml
3535
skip-delete: true
3636
dry-run: true
3737
-
3838
name: Labeler (exclude part 1)
3939
uses: ./
4040
with:
4141
github-token: ${{ secrets.GITHUB_TOKEN }}
42-
yaml-file: ./__tests__/fixtures/labels.exclude1.yml
42+
yaml-file: ./tests/fixtures/labels.exclude1.yml
4343
dry-run: true
4444
exclude: |
4545
* d*
@@ -50,7 +50,7 @@ jobs:
5050
uses: ./
5151
with:
5252
github-token: ${{ secrets.GITHUB_TOKEN }}
53-
yaml-file: ./__tests__/fixtures/labels.exclude2.yml
53+
yaml-file: ./tests/fixtures/labels.exclude2.yml
5454
dry-run: true
5555
exclude: |
5656
*fix

.prettierrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
"singleQuote": true,
77
"trailingComma": "none",
88
"bracketSpacing": false,
9-
"arrowParens": "avoid",
10-
"parser": "typescript"
9+
"arrowParens": "avoid"
1110
}

codecov.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@ comment: false
22

33
coverage:
44
status:
5-
project: # settings affecting project coverage
6-
default:
7-
target: auto # auto % coverage target
8-
threshold: 5% # allow for 5% reduction of coverage without failing
9-
patch: off
5+
patch: false
6+
project: false
107

118
github_checks:
129
annotations: false

dev.Dockerfile

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
ARG NODE_VERSION=20
44

55
FROM node:${NODE_VERSION}-alpine AS base
6-
RUN apk add --no-cache cpio findutils git
6+
RUN apk add --no-cache cpio findutils git rsync
77
WORKDIR /src
88
RUN --mount=type=bind,target=.,rw \
99
--mount=type=cache,target=/src/.yarn/cache <<EOT
10+
set -e
1011
corepack enable
1112
yarn --version
1213
yarn config set --home enableTelemetry 0
@@ -34,32 +35,40 @@ RUN --mount=type=bind,target=.,rw <<EOT
3435
EOT
3536

3637
FROM deps AS build
37-
RUN --mount=type=bind,target=.,rw \
38+
RUN --mount=target=/context \
3839
--mount=type=cache,target=/src/.yarn/cache \
39-
--mount=type=cache,target=/src/node_modules \
40-
yarn run build && mkdir /out && cp -Rf dist /out/
40+
--mount=type=cache,target=/src/node_modules <<EOT
41+
set -e
42+
rsync -a /context/. .
43+
rm -rf dist
44+
yarn run build
45+
mkdir /out
46+
cp -r dist /out
47+
EOT
4148

4249
FROM scratch AS build-update
4350
COPY --from=build /out /
4451

4552
FROM build AS build-validate
46-
RUN --mount=type=bind,target=.,rw <<EOT
47-
set -e
48-
git add -A
49-
cp -rf /out/* .
50-
if [ -n "$(git status --porcelain -- dist)" ]; then
51-
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
52-
git status --porcelain -- dist
53-
exit 1
54-
fi
53+
RUN --mount=target=/context \
54+
--mount=target=.,type=tmpfs <<EOT
55+
set -e
56+
rsync -a /context/. .
57+
git add -A
58+
rm -rf dist
59+
cp -rf /out/* .
60+
if [ -n "$(git status --porcelain -- dist)" ]; then
61+
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
62+
git status --porcelain -- dist
63+
exit 1
64+
fi
5565
EOT
5666

5767
FROM deps AS format
5868
RUN --mount=type=bind,target=.,rw \
5969
--mount=type=cache,target=/src/.yarn/cache \
6070
--mount=type=cache,target=/src/node_modules \
61-
yarn run format \
62-
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
71+
yarn run format && mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
6372

6473
FROM scratch AS format-update
6574
COPY --from=format /out /
@@ -77,7 +86,7 @@ ARG GITHUB_REPOSITORY
7786
RUN --mount=type=bind,target=.,rw \
7887
--mount=type=cache,target=/src/.yarn/cache \
7988
--mount=type=cache,target=/src/node_modules \
80-
yarn run test --coverage --coverageDirectory=/tmp/coverage
89+
yarn run test --coverage --coverage.reportsDirectory=/tmp/coverage
8190

8291
FROM scratch AS test-coverage
8392
COPY --from=test /tmp/coverage /

dist/index.js

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/package.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sourcemap-register.cjs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)