Skip to content

Commit

Permalink
Goodbye Deno, Hi Node
Browse files Browse the repository at this point in the history
Deno does not have armv7 binaries, so let's get back to Node instead.
  • Loading branch information
swissmanu committed Oct 23, 2023
1 parent 4496f7e commit fd9fdae
Show file tree
Hide file tree
Showing 74 changed files with 7,593 additions and 1,425 deletions.
15 changes: 0 additions & 15 deletions .devcontainer/Dockerfile

This file was deleted.

50 changes: 24 additions & 26 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Deno",
"build": {
"dockerfile": "Dockerfile"
},
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-18-bullseye",
"customizations": {
"vscode": {
"extensions": ["esbenp.prettier-vscode", "EditorConfig.EditorConfig", "Orta.vscode-jest"]
}
}

// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
// Enables the project as a Deno project
"deno.enable": true,
// Enables Deno linting for the project
"deno.lint": true,
// Sets Deno as the default formatter for the project
"editor.defaultFormatter": "denoland.vscode-deno"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"denoland.vscode-deno"
]
}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

"remoteUser": "vscode"
}
// 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": "yarn install",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# editorconfig.org

root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespaces = true
7 changes: 7 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* eslint-env node */
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
};
18 changes: 9 additions & 9 deletions .github/workflows/quality-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ on:
workflow_call:

env:
DENO_VERSION: 1.37.2
NODE_VERSION: 18.18.0

jobs:
quality-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Deno Version ${{ env.DENO_VERSION }}
uses: denolib/setup-deno@v2
- name: Use NodeJS Version ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
deno-version: ${{ env.DENO_VERSION }}
node-version: ${{ env.NODE_VERSION }}
- name: Install Dependencies
run: yarn install
- name: Typecheck
run: deno check src/main.ts
- name: Format Check
run: deno fmt --check
run: yarn typecheck
- name: Lint
run: deno lint
run: yarn lint
- name: Test
run: deno test
run: yarn test
36 changes: 18 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: Quality Checks
on:
push:
tags:
- "v*"
- 'v*'

env:
DENO_VERSION: 1.37.2
NODE_VERSION: 18.18.0

jobs:
release-quality-checks:
Expand All @@ -18,15 +18,15 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Use Deno Version ${{ env.DENO_VERSION }}
uses: denolib/setup-deno@v2
- name: Use Node Version ${{ env.NODE_VERSION }}
uses: actions/setup-deno@v4
with:
deno-version: ${{ env.DENO_VERSION }}
node-version: ${{ env.NODE_VERSION }}

- name: Install Dependencies
run: yarn install
- name: Build
run: |
deno cache src/deps.ts
deno cache src/main.ts
run: yarn build
- name: Get Version from Git Tag
id: get_version
uses: battila7/get-version-action@v2
Expand All @@ -40,18 +40,18 @@ jobs:
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}

- name: Build and Push Docker Images
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/arm/arm64,linux/arm/v7,linux/amd64
push: true
# :latest can be dangerous when republishing old version... But it's okay for now.
tags: |
ghcr.io/${{ github.repository }}/litecom2mqtt:latest
ghcr.io/${{ github.repository }}/litecom2mqtt:${{ steps.get_version.outputs.version }}
context: .
platforms: linux/arm/arm64,linux/arm/v7,linux/amd64
push: true
# :latest can be dangerous when republishing old version... But it's okay for now.
tags: |
ghcr.io/${{ github.repository }}/litecom2mqtt:latest
ghcr.io/${{ github.repository }}/litecom2mqtt:${{ steps.get_version.outputs.version }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.env
*-openapi.yaml
dist/
node_modules/
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
3 changes: 3 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"*.{json,md,js,jsx,ts,tsx,gql,prisma}": ["prettier --write"]
}
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18.18.0
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"printWidth": 120,
"semi": true,
"singleQuote": true,
"trailingComma": "all",
"tabWidth": 4
}
18 changes: 5 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,13 @@
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"type": "node",
"program": "${workspaceFolder}/src/main.ts",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "/deno/bin/deno",
"envFile": "${workspaceFolder}/.env",
"runtimeArgs": [
"run",
"--inspect-wait",
"--allow-all",
"--unsafely-ignore-certificate-errors",
"--allow-net"
],
"attachSimplePort": 9229
"runtimeArgs": ["--loader", "ts-node/esm"],
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/src/main.ts"
}
]
}
}
Binary file added .yarn/install-state.gz
Binary file not shown.
Loading

0 comments on commit fd9fdae

Please sign in to comment.