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

Change to node 20 #12

Merged
merged 3 commits into from
Nov 15, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
{
"name": "Node.js & TypeScript",
"image": "mcr.microsoft.com/devcontainers/typescript-node:16-bullseye",
// Features to add to the dev container. More info: https://containers.dev/implementors/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install"
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
"name": "Node.js & TypeScript",
"image": "mcr.microsoft.com/devcontainers/typescript-node:20-bookworm",
"onCreateCommand": ".devcontainer/setup.sh",
"postCreateCommand": "npm install",
"postStartCommand": ".devcontainer/startup.sh",
"overrideCommand": true,
"features": {
"ghcr.io/devcontainers-contrib/features/starship:1": {}
},
"customizations": {
"vscode": {
"settings": {
"security.workspace.trust.untrustedFiles": "open"
},
"extensions": [
"bierner.markdown-preview-github-styles",
"catppuccin.catppuccin-vsc",
"catppuccin.catppuccin-vsc-icons",
"dbaeumer.vscode-eslint",
"DavidAnson.vscode-markdownlint",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github",
"streetsidesoftware.code-spell-checker",
"yzhang.markdown-all-in-one"
]
}
}
}
36 changes: 36 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env sh
if [ -d "/var/run/docker.sock" ]; then
# Grant access to the docker socket
sudo chmod 666 /var/run/docker.sock
fi

if ! [ -d ~/.ssh ]; then
if [ -d /tmp/.ssh-localhost ]; then
command mkdir -p -- ~/.ssh
sudo cp -R /tmp/.ssh-localhost/* ~/.ssh
sudo chown -R $(whoami):$(whoami) ~ || true ?>/dev/null
sudo chmod 400 ~/.ssh/*
fi
fi

sudo apt-get update
sudo apt-get install --no-install-recommends -y pre-commit fonts-firacode shellcheck
sudo npm install -g npm prettier

if [ -f ~/.gitconfig ]; then
rm ~/.gitconfig
fi

if ! [ -d ~/.config ]; then
command mkdir -p -- ~/.config
fi
/bin/cp -f .devcontainer/starship.toml ~/.config/starship.toml
chown -R $USER_UID:$USER_GID ~/.config
chmod -R 700 ~/.config
chown $USER_UID:$USER_GID ~/.config/starship.toml
if ! [ -f ~/.zshrc ]; then
touch ~/.zshrc
fi
if ! grep -q 'eval "$(starship init zsh)"' ~/.zshrc; then
echo 'eval "$(starship init zsh)"' >>~/.zshrc
fi
35 changes: 35 additions & 0 deletions .devcontainer/starship.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
command_timeout = 500
format = "$directory$git_branch$time$cmd_duration$character"

[character]
success_symbol = "[➜](bold green)"
error_symbol = "[✖](bold red)"

[cmd_duration]
min_time = 500
format = "took [$duration](bold yellow)"

[directory]
read_only = " "
truncation_length = 3
truncation_symbol = "~/"

[git_branch]
symbol = "  "
style = "bold #e8ec00 inverted"
format = "on [$symbol$branch ]($style) "

[git_commit]
disabled = true

[git_state]
disabled = true

[git_status]
disabled = true

[line_break]
disabled = true

[package]
disabled = true
24 changes: 24 additions & 0 deletions .devcontainer/startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env sh
if [ "${CODESPACES}" = "true" ]; then
# Remove the default credential helper
sudo sed -i -E 's/helper =.*//' /etc/gitconfig

# Add one that just uses secrets available in the Codespace
git config --global credential.helper '!f() { sleep 1; echo "username=${GITHUB_USER}"; echo "password=${GH_TOKEN}"; }; f'
fi

if [ "$(git config --get safe.directory)" != "*" ]; then
git config --global --add safe.directory "*"
fi
if [ "$(git config pull.rebase)" != "false" ]; then
git config --global pull.rebase false
fi
if [ "$(git config user.name)" = "" ]; then
echo "Warning: git user.name is not configured"
fi
if [ "$(git config user.email)" = "" ]; then
echo "Warning: git user.email is not configured"
fi

pre-commit install
pre-commit autoupdate
20 changes: 19 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
{
"plugins": [
"import",
"jest",
"@typescript-eslint"
],
"extends": [
"plugin:github/recommended"
"plugin:github/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"typescript": {
"alwaysTryTypes": true
}
}
},
"rules": {
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"import/named": "off",
"import/no-unresolved": "error",
"i18n-text/no-en": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pull-labels-changeset_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
labeler:
name: "Changeset size"
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: "Labeler"
uses: actions/labeler@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ jobs:
contents: write
steps:
- name: "Release"
uses: innofactororg/code-release@v1
uses: innofactororg/code-release@v2
with:
tag: ${{ github.event.inputs.tag }}
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
- name: "Setup node"
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 20

- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Install dependencies"
run: npm ci
Expand All @@ -39,6 +39,9 @@ jobs:
- name: "Format check"
run: npm run format-check

- name: Audit npm for vulnerabilities
run: npm shrinkwrap && npm audit

- name: "Lint check"
run: npm run lint

Expand Down
105 changes: 104 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,108 @@
__test__/_temp
_temp/
lib/
.vscode/
node_modules/

# https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

# https://github.com/github/gitignore/blob/main/Global/MicrosoftOffice.gitignore
*.tmp

# Word temporary
~$*.doc*

# Word Auto Backup File
Backup of *.doc*

# Excel temporary
~$*.xls*

# Excel Backup File
*.xlk

# PowerPoint temporary
~$*.ppt*

# Visio autosave temporary files
*.~vsd*

# https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# https://github.com/github/gitignore/blob/main/Global/macOS.gitignore
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# https://github.com/github/gitignore/blob/main/Global/Linux.gitignore
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# See http://pre-commit.com for more information
# See http://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-json
- id: check-yaml
- id: check-merge-conflict
args: ["--assume-in-merge"]
- id: detect-private-key
48 changes: 48 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"debug.internalConsoleOptions": "neverOpen",
"editor.accessibilitySupport": "off",
"editor.bracketPairColorization.enabled": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.detectIndentation": false,
"editor.fontFamily": "FiraCode Nerd Font Mono",
"editor.fontSize": 14,
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.guides.bracketPairs": "active",
"editor.tabCompletion": "on",
"editor.tabSize": 2,
"files.autoSave": "onFocusChange",
"files.encoding": "utf8",
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"git.pruneOnFetch": true,
"git.enableSmartCommit": true,
"githubPullRequests.pullBranch": "always",
"markdown.extension.orderedList.autoRenumber": false,
"markdown.extension.toc.updateOnSave": false,
"markdownlint.config": {
"MD025": {
"front_matter_title": ""
},
"MD028": false,
"MD041": false
},
"terminal.integrated.defaultProfile.linux": "zsh",
"workbench.colorTheme": "Catppuccin Mocha",
"workbench.editor.decorations.colors": true,
"workbench.editor.decorations.badges": true,
"workbench.editor.wrapTabs": true,
"workbench.iconTheme": "catppuccin-macchiato",
"workbench.startupEditor": "none",
"[json,jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.tabSize": 2,
"editor.wordWrap": "off",
"files.encoding": "utf8",
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true
}
}
Loading