Skip to content

Commit

Permalink
chore: inital template for node sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Aug 17, 2023
0 parents commit 6955b70
Show file tree
Hide file tree
Showing 26 changed files with 8,167 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .c8rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extension": [".ts"],
"include": ["src/**/*.ts"],
"exclude": ["**/*.d.ts", "**/*.test.ts"],
"all": true,
"coverage": true,
"reporter": ["text", "html"]
}
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tests
src/**/*.test.ts
lib
**/*.cjs
**/*.mjs
28 changes: 28 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"root": true,
"plugins": ["@typescript-eslint", "mocha", "prettier", "header"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:mocha/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"mocha/no-mocha-arrows": "off",
"header/header": ["error", "resources/license.header.js"],
"@typescript-eslint/consistent-type-imports": "off",
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
"allowNullableObject": true,
"allowNullableBoolean": true,
"allowAny": true
}
]
}
}
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build and Test

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [18.x, 20.x]
command: ['lint', 'format', 'test', 'build']
steps:
- uses: actions/checkout@v3

- name: Set Up node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: 'yarn'

- name: Install dependencies
run: yarn --immutable --immutable-cache

- run: yarn ${{ matrix.command }}
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release

on:
push:
branches:
- main
- alpha

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.CI_GITHUB_TOKEN }}
- name: Set Up node
uses: actions/setup-node@v3
with:
cache: 'yarn'
node-version-file: .nvmrc

- name: Install dependencies
run: yarn --immutable --immutable-cache

- name: Build
run: yarn build

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.npm_token }}
run: yarn semantic-release
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules
lib
bundles
coverage
.nyc_output
dist
.husky/_

# IDEs and editors
.vscode
.DS_Store
yarn-error.log

# Build files
**/*.min.js
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint --edit $1
9 changes: 9 additions & 0 deletions .mocharc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extension": ["ts"],
"spec": ["tests/**/*.test.ts", "src/**/*.test.ts"],
"require": ["ts-node/register/transpile-only"],
"timeout": "10000",
"parallel": false,
"recursive": true,
"loader": "ts-node/esm"
}
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.17.0
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"semi": true,
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all",
"importOrder": ["<THIRD_PARTY_MODULES>", "^[.{1,2}/]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
}
40 changes: 40 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"branches": [
"main",
{
"name": "alpha",
"prerelease": true
},
{
"name": "beta",
"prerelease": true
}
],
"repositoryUrl": "https://github.com/ardriveapp/node-sdk-template",
"debug": "false",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/github",
{
"assets": [
"dist/**"
]
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"yarn.lock",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
Empty file added CHANGELOG.md
Empty file.
1 change: 1 addition & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @ardriveapp/services
Loading

0 comments on commit 6955b70

Please sign in to comment.