Skip to content

Commit

Permalink
chore: inital build
Browse files Browse the repository at this point in the history
  • Loading branch information
dtfiedler committed Aug 15, 2023
1 parent aa4f06f commit bf5f22d
Show file tree
Hide file tree
Showing 47 changed files with 20,843 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .c8rc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extension: [".ts"],
include: ["src/**/*.ts"],
exclude: ["**/*.d.ts", "**/*.test.ts"],
all: true,
coverage: true,
};
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tests
src/**/*.test.ts
lib
**/*.cjs
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"plugins": ["@typescript-eslint", "mocha", "prettier", "header"],
"extends": [
"standard-with-typescript",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:mocha/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json"
},
"rules": {
"@typescript-eslint/consistent-type-imports": "off",
"mocha/no-mocha-arrows": "off",
"header/header": ["error", "resources/license.header.js"],
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
"allowNullableObject": true,
"allowNullableBoolean": true,
"allowAny": true
}
]
}
}
43 changes: 43 additions & 0 deletions .github/workflows/test_and_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Node.js CI

on: [push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Read .nvmrc
id: node_version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)

- name: Set Up node
uses: actions/setup-node@v3
with:
node-version: ${{ steps.node_version.outputs.NODE_VERSION }}
cache: "yarn"

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

- name: Test
run: yarn test

- name: Build
run: yarn build

# TODO: create the package artifact here

release:
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.npm_token }}
run: yarn semantic-release
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ node_modules
lib*
coverage
.nyc_output
dist
.husky/_

# IDEs and editors
.vscode
.DS_Store
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
15 changes: 15 additions & 0 deletions .mocharc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use-strict";

process.env.NODE_ENV = "test";

// Mocha configuration file
// Reference for options: https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.js
module.exports = {
extension: ["ts"],
spec: ["tests/**/*.test.ts", "src/**/*.test.ts"], // Add this to target spec files: ,"tests/**/*.spec.ts"
require: ["ts-node/register/transpile-only"],
timeout: "10000", // 10 seconds
parallel: false,
recursive: true,
loader: "ts-node/esm",
};
23 changes: 23 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"branches": "main",
"repositoryUrl": "https://github.com/ardriveapp/ardrive-turbo-sdk/",
"debug": "false",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/github",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"package.json",
"package-lock.json",
"CHANGELOG.md"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cSpell.words": ["iife", "nvmrc", "outfile", "typecheck", "Winc"]
}
Loading

0 comments on commit bf5f22d

Please sign in to comment.