Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Oct 25, 2023
0 parents commit 4fee616
Show file tree
Hide file tree
Showing 23 changed files with 5,523 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"env": {
"browser": true,
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest"
},
"rules": {
"no-useless-escape": "warn",
"no-unused-vars": "off",
"no-mixed-spaces-and-tabs": "warn",
"no-unreachable": "warn",
"no-extra-semi": "warn",
"no-fallthrough": "off",
"no-empty": "warn",
"no-case-declarations": "off",
"prefer-const": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/triple-slash-reference": "warn",
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/no-namespace": "off"
},
"ignorePatterns": ["scripts/*.js", "src/*.config.js", "test/fixtures"],
"plugins": ["@typescript-eslint"]
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
75 changes: 75 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Continuous Integration

on:
push:
branches:
- main
- master
workflow_dispatch:
workflow_call:

jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: ${{ matrix.os }}
permissions:
contents: read
id-token: write
defaults:
run:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Formatting
run: npm run format:check

- name: Linting
run: npm run lint

# Once unit tests are working
#- name: Unit tests
# run: npm run test

- name: Build
run: npm run build
docs:
needs: ci
runs-on: ubuntu-latest
name: Docs build and deploy
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install dependencies
run: npm install

- name: Build docs
run: npm run build:docs

- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
publish_branch: docs
34 changes: 34 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
release:
types: [created]

jobs:
ci:
uses: ./.github/workflows/ci.yaml
permissions:
contents: write
id-token: write
release:
runs-on: ubuntu-latest
needs: ci
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup npm authenication
uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- name: Publish
run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
node_modules
.vscode
dist
docs
*.log
tmp
build
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!dist/**/*
!license.md

8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"singleQuote": true,
"useTabs": true,
"trailingComma": "es5",
"tabWidth": 4,
"printWidth": 180,
"arrowParens": "avoid"
}
23 changes: 23 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"preset": "ts-jest/presets/default-esm",
"testEnvironment": "node",
"extensionsToTreatAsEsm": [
".ts"
],
"testMatch": [
"./**/*.test.ts"
],
"moduleNameMapper": {
"^(\\.{1,2}/.*)\\.js$": "$1"
},
"transform": {
"^.+\\.ts$": [
"ts-jest",
{
"tsconfig": "test/tsconfig.json",
"useESM": true
}
]
},
"verbose": true
}
19 changes: 19 additions & 0 deletions license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2013-2023 John Vilk and other BrowserFS contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 4fee616

Please sign in to comment.