Skip to content

Commit f778ace

Browse files
authored
update dev dependencies and workflow (#166)
Co-authored-by: CrazyMax <[email protected]>
1 parent 11b007c commit f778ace

21 files changed

+1170
-8707
lines changed

.dockerignore

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,2 @@
11
/coverage
2-
3-
# Dependency directories
4-
node_modules/
5-
jspm_packages/
6-
7-
# yarn v2
8-
.yarn/cache
9-
.yarn/unplugged
10-
.yarn/build-state.yml
11-
.yarn/install-state.gz
12-
.pnp.*
2+
/node_modules

.eslintrc.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"env": {
3+
"node": true,
4+
"es2021": true
5+
},
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/recommended",
9+
"plugin:prettier/recommended"
10+
],
11+
"parser": "@typescript-eslint/parser",
12+
"parserOptions": {
13+
"ecmaVersion": "latest",
14+
"sourceType": "module"
15+
},
16+
"plugins": [
17+
"@typescript-eslint",
18+
"prettier"
19+
]
20+
}

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
/.yarn/releases/** binary
2-
/.yarn/plugins/** binary
31
/dist/** linguist-generated=true
42
/lib/** linguist-generated=true

.gitignore

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/.dev
2-
/lib
2+
node_modules
3+
lib
34

45
# Jetbrains
56
/.idea
@@ -46,11 +47,10 @@ bower_components
4647
build/Release
4748

4849
# Dependency directories
49-
node_modules/
5050
jspm_packages/
5151

52-
# Snowpack dependency directory (https://snowpack.dev/)
53-
web_modules/
52+
# TypeScript v1 declaration files
53+
typings/
5454

5555
# TypeScript cache
5656
*.tsbuildinfo
@@ -61,12 +61,6 @@ web_modules/
6161
# Optional eslint cache
6262
.eslintcache
6363

64-
# Microbundle cache
65-
.rpt2_cache/
66-
.rts2_cache_cjs/
67-
.rts2_cache_es/
68-
.rts2_cache_umd/
69-
7064
# Optional REPL history
7165
.node_repl_history
7266

@@ -82,21 +76,12 @@ web_modules/
8276

8377
# parcel-bundler cache (https://parceljs.org/)
8478
.cache
85-
.parcel-cache
8679

87-
# Next.js build output
80+
# next.js build output
8881
.next
89-
out
9082

91-
# Nuxt.js build / generate output
83+
# nuxt.js build output
9284
.nuxt
93-
#dist
94-
95-
# Gatsby files
96-
.cache/
97-
# Comment in the public line in if your project uses Gatsby and not Next.js
98-
# https://nextjs.org/blog/next-9-1#public-directory-support
99-
# public
10085

10186
# vuepress build output
10287
.vuepress/dist
@@ -109,16 +94,3 @@ out
10994

11095
# DynamoDB Local files
11196
.dynamodb/
112-
113-
# TernJS port file
114-
.tern-port
115-
116-
# Stores VSCode versions used for testing VSCode extensions
117-
.vscode-test
118-
119-
# yarn v2
120-
.yarn/cache
121-
.yarn/unplugged
122-
.yarn/build-state.yml
123-
.yarn/install-state.gz
124-
.pnp.*

.prettierignore

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

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

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

.yarn/releases/yarn-sources.cjs

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

.yarnrc.yml

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

codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
comment: false
2+
github_checks:
3+
annotations: false

dev.Dockerfile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# syntax=docker/dockerfile:1
2+
3+
ARG NODE_VERSION=12
4+
5+
FROM node:${NODE_VERSION}-alpine AS base
6+
RUN apk add --no-cache cpio findutils git
7+
WORKDIR /src
8+
9+
FROM base AS deps
10+
RUN --mount=type=bind,target=.,rw \
11+
--mount=type=cache,target=/src/node_modules \
12+
yarn install && mkdir /vendor && cp yarn.lock /vendor
13+
14+
FROM scratch AS vendor-update
15+
COPY --from=deps /vendor /
16+
17+
FROM deps AS vendor-validate
18+
RUN --mount=type=bind,target=.,rw <<EOT
19+
set -e
20+
git add -A
21+
cp -rf /vendor/* .
22+
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
23+
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
24+
git status --porcelain -- yarn.lock
25+
exit 1
26+
fi
27+
EOT
28+
29+
FROM deps AS build
30+
RUN --mount=type=bind,target=.,rw \
31+
--mount=type=cache,target=/src/node_modules \
32+
yarn run build && mkdir /out && cp -Rf dist /out/
33+
34+
FROM scratch AS build-update
35+
COPY --from=build /out /
36+
37+
FROM build AS build-validate
38+
RUN --mount=type=bind,target=.,rw <<EOT
39+
set -e
40+
git add -A
41+
cp -rf /out/* .
42+
if [ -n "$(git status --porcelain -- dist)" ]; then
43+
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
44+
git status --porcelain -- dist
45+
exit 1
46+
fi
47+
EOT
48+
49+
FROM deps AS format
50+
RUN --mount=type=bind,target=.,rw \
51+
--mount=type=cache,target=/src/node_modules \
52+
yarn run format \
53+
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
54+
55+
FROM scratch AS format-update
56+
COPY --from=format /out /
57+
58+
FROM deps AS lint
59+
RUN --mount=type=bind,target=.,rw \
60+
--mount=type=cache,target=/src/node_modules \
61+
yarn run lint

0 commit comments

Comments
 (0)