Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update dev dependencies and workflow #166

Merged
merged 1 commit into from Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 1 addition & 11 deletions .dockerignore
@@ -1,12 +1,2 @@
/coverage

# Dependency directories
node_modules/
jspm_packages/

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
/node_modules
20 changes: 20 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,20 @@
{
"env": {
"node": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"prettier"
]
}
2 changes: 0 additions & 2 deletions .gitattributes
@@ -1,4 +1,2 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
/dist/** linguist-generated=true
/lib/** linguist-generated=true
40 changes: 6 additions & 34 deletions .gitignore
@@ -1,5 +1,6 @@
/.dev
/lib
node_modules
lib

# Jetbrains
/.idea
Expand Down Expand Up @@ -46,11 +47,10 @@ bower_components
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo
Expand All @@ -61,12 +61,6 @@ web_modules/
# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

Expand All @@ -82,21 +76,12 @@ web_modules/

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
# next.js build output
.next
out

# Nuxt.js build / generate output
# nuxt.js build output
.nuxt
#dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist
Expand All @@ -109,16 +94,3 @@ out

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

77 changes: 0 additions & 77 deletions .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

This file was deleted.

609 changes: 0 additions & 609 deletions .yarn/releases/yarn-sources.cjs

This file was deleted.

7 changes: 0 additions & 7 deletions .yarnrc.yml

This file was deleted.

3 changes: 3 additions & 0 deletions codecov.yml
@@ -0,0 +1,3 @@
comment: false
github_checks:
annotations: false
61 changes: 61 additions & 0 deletions dev.Dockerfile
@@ -0,0 +1,61 @@
# syntax=docker/dockerfile:1

ARG NODE_VERSION=12

FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git
WORKDIR /src

FROM base AS deps
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn install && mkdir /vendor && cp yarn.lock /vendor

FROM scratch AS vendor-update
COPY --from=deps /vendor /

FROM deps AS vendor-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /vendor/* .
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
git status --porcelain -- yarn.lock
exit 1
fi
EOT

FROM deps AS build
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run build && mkdir /out && cp -Rf dist /out/

FROM scratch AS build-update
COPY --from=build /out /

FROM build AS build-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /out/* .
if [ -n "$(git status --porcelain -- dist)" ]; then
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
git status --porcelain -- dist
exit 1
fi
EOT

FROM deps AS format
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run format \
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out

FROM scratch AS format-update
COPY --from=format /out /

FROM deps AS lint
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run lint