Skip to content

Commit

Permalink
refactor: Rewrite in TypeScript (#69)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The package source is now written in TypeScript. It ships with native TypeScript types in both CommonJS and ESM syntax.
  • Loading branch information
avaly committed Mar 25, 2023
1 parent 7eb345c commit bac3c5e
Show file tree
Hide file tree
Showing 44 changed files with 2,931 additions and 3,495 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Expand Up @@ -8,6 +8,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{json,yml,md,babelrc,eslintrc,remarkrc}]
[*.{json,yaml,yml,md,babelrc,eslintrc,remarkrc}]
indent_style = space
indent_size = 2
2 changes: 2 additions & 0 deletions .eslintignore
@@ -1,3 +1,5 @@
cjs/
coverage/*
esm/
node_modules/
tmp/
12 changes: 11 additions & 1 deletion .eslintrc.js → .eslintrc.cjs
Expand Up @@ -4,7 +4,17 @@ module.exports = {
node: true,
jest: true,
},
extends: 'eslint:recommended',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
// 'plugin:@typescript-eslint/recommended-requiring-type-checking'
],
parser: '@typescript-eslint/parser',
// parserOptions: {
// project: true,
// tsconfigRootDir: __dirname,
// },
plugins: ['@typescript-eslint'],
rules: {
indent: ['error', 'tab'],
'linebreak-style': ['error', 'unix'],
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/docs.yaml
@@ -0,0 +1,44 @@
name: Docs

on:
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.3.0
- uses: actions/setup-node@v3.6.0
with:
node-version: ${{ matrix.node }}
cache: 'yarn'
- uses: actions/cache@v3.2.4
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile
- run: yarn docs
- uses: actions/upload-pages-artifact@v1.0.8
with:
path: './docs'
- uses: actions/deploy-pages@v2.0.0
id: deployment
11 changes: 5 additions & 6 deletions .github/workflows/ci.yaml → .github/workflows/tests.yaml
@@ -1,19 +1,17 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: CI
name: Tests

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
node: [14, 16, 18]
Expand All @@ -36,3 +34,4 @@ jobs:
- run: yarn lint
- run: yarn test:pretty
- run: yarn test
- run: yarn test:types
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -7,5 +7,8 @@ Thumbs.db
*.sublime-workspace
*.log
.eslintcache
cjs/
coverage/
docs/
esm/
tmp/
4 changes: 3 additions & 1 deletion .prettierignore
@@ -1,2 +1,4 @@
cjs/
esm/
src/serialize.ts
package.json
lib/serialize.js

0 comments on commit bac3c5e

Please sign in to comment.