Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.6.0 #57

Merged
merged 28 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e6c2c5d
Add prettier, transform types
GoogleFeud Apr 28, 2024
7a0250a
Work on transform
GoogleFeud Apr 28, 2024
fe0298f
Functional transform
GoogleFeud Apr 28, 2024
4caa4cc
Allow unions of transformations and checks
GoogleFeud Apr 28, 2024
39e32cd
Update playground
GoogleFeud Apr 29, 2024
d45334b
Update workflows
GoogleFeud Apr 29, 2024
8d4d3cd
Update layouts
GoogleFeud Apr 29, 2024
2fc5a98
Replace next with astro
GoogleFeud May 25, 2024
fbf6024
Some updates
GoogleFeud May 25, 2024
0fa7ce0
Clean up code, fix some bugs
GoogleFeud May 25, 2024
40ff739
Update reamde
GoogleFeud May 25, 2024
cb10bfa
Merge branch 'main' of https://github.com/GoogleFeud/ts-runtime-check…
GoogleFeud May 25, 2024
85655e2
Add a validating step
GoogleFeud May 26, 2024
8adbf9a
Change how generating errors work
GoogleFeud May 26, 2024
b29e0bc
Tons of improvements
GoogleFeud May 28, 2024
dda9a53
Bug fixes and transform tests
GoogleFeud May 28, 2024
931a9c4
Update readme, some nice qol features
GoogleFeud May 28, 2024
9f98998
Update reamde
GoogleFeud May 28, 2024
e69e87d
Update readme and pray link works
GoogleFeud May 28, 2024
5c1c0eb
So many edge cases
GoogleFeud May 28, 2024
ff0e010
Post checks
GoogleFeud May 29, 2024
6c861a7
Update workflow
GoogleFeud May 29, 2024
6b5c82a
Skip checking
GoogleFeud May 29, 2024
1282c81
Modify workflow
GoogleFeud May 29, 2024
66555ad
Add relative links
GoogleFeud May 29, 2024
fd89dd8
Update redirect
GoogleFeud May 29, 2024
c63cf13
gitignore
GoogleFeud Jun 1, 2024
203f274
0.6.0
GoogleFeud Jun 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 6 additions & 23 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,17 @@
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"plugins": ["@typescript-eslint"],
"rules": {
"indent": [
"error",
4
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"double"
],
"semi": [
"error",
"always"
]
"linebreak-style": ["error", "windows"],
"quotes": ["error", "double"],
"semi": ["error", "always"],
"@typescript-eslint/no-non-null-assertion": "off"
}
}
34 changes: 17 additions & 17 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ diverse, inclusive, and healthy community.
Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Expand Down Expand Up @@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
Expand All @@ -125,4 +125,4 @@ enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
https://www.contributor-covenant.org/translations.
39 changes: 19 additions & 20 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@

# Contributing

Thank you for contributing to ts-runtime-checks! Your help is appreciated by the author of this library and everyone using it!

## Table of Contents

- [How can I contribute?](#how-can-i-contribute)
- [Bug Reports](#bug-reports)
- [Feature Requests](#feature-requests)
- [Pull Requests](#pull-requests)
- [Setup](#setup)
- [Testing](#testing)
- [Finishing up](#finishing-up)
- [How can I contribute?](#how-can-i-contribute)
- [Bug Reports](#bug-reports)
- [Feature Requests](#feature-requests)
- [Pull Requests](#pull-requests)
- [Setup](#setup)
- [Testing](#testing)
- [Finishing up](#finishing-up)

## How can I contribute?

Expand All @@ -21,18 +20,18 @@ Before reporting a bug, plese [search for issues with similar keywords to yours]

When writing a bug report:

- Use a clear and descriptive title for the issue.
- Post a link to the [playground](https://googlefeud.github.io/ts-runtime-checks/) with code that replicates the bug. (Paste the code inside of the playground and click on the "Copy Link" button)
- Explain what you expected to see instead and why.
- Use a clear and descriptive title for the issue.
- Post a link to the [playground](https://googlefeud.github.io/ts-runtime-checks/) with code that replicates the bug. (Paste the code inside of the playground and click on the "Copy Link" button)
- Explain what you expected to see instead and why.

### Feature Requests

Suggestions are always welcome! Before writing a feature request, please [search for issues with similar keywords to yours](https://github.com/GoogleFeud/ts-runtime-checks/issues?q=is%3Aissue+is%3Aopen). If an issue already exists for the request then you can "bump" it by commenting on it. If it doesn't, then you can create one.

When writing a feature request:

- Use a clear and descriptive title for the issue.
- Provide examples of how the feature will be useful.
- Use a clear and descriptive title for the issue.
- Provide examples of how the feature will be useful.

### Pull Requests

Expand All @@ -42,18 +41,18 @@ All future changes are made in the `dev` branch, so make sure to work in that br

#### Setup

- Fork this repository
- Clone your fork
- Install all dependencies: `npm i`
- Build the project: `npm run build`
- Run the tests to see if everything is running smoothly: `npm test`
- Fork this repository
- Clone your fork
- Install all dependencies: `npm i`
- Build the project: `npm run build`
- Run the tests to see if everything is running smoothly: `npm test`

#### Testing

ts-runtime-checks has integrated and snapshot testing implemented. To make sure any changes you've made have not changed the transformer for worse, run `npm test`. This will first run all integrated tests, which test the **transpiled code**, and then ask you to continue with the snapshot testing.
ts-runtime-checks has integrated and snapshot testing implemented. To make sure any changes you've made have not changed the transformer for worse, run `npm test`. This will first run all integrated tests, which test the **transpiled code**, and then ask you to continue with the snapshot testing.

During snapshot testing, ts-runtime-checks compares the **trusted** transpiled integrated tests with the ones on your machine that have just been transpiled in the previous step. If any changes have been detected, it will ask you if you approve of these changes. If you notice some of the generated code is wrong or not up to standards, disprove the changes, make your fixes and run `npm test` again until the latest transpiled code matches the trusted version, or until you're satisfied with the generated code.

#### Finishing up

Once you're done working on an issue, you can submit a pull request to have your changes merged! Before submitting the request, make sure there are no linting errors (`npm lint`), all tests pass (`npm test`), and your branch is up to date (`git pull`).
Once you're done working on an issue, you can submit a pull request to have your changes merged! Before submitting the request, make sure there are no linting errors (`npm lint`), all tests pass (`npm test`), and your branch is up to date (`git pull`).
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''

labels: ""
assignees: ""
---

**Describe the bug**
Expand All @@ -17,4 +16,4 @@ Please paste the code needed to replicate the bug in the [playground](https://go
A clear and concise description of what you expected to happen.

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: ''
assignees: ''

labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand All @@ -17,4 +16,4 @@ A clear and concise description of what you want to happen.
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature request here.
47 changes: 22 additions & 25 deletions .github/workflows/playground.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
name: Deploy playground to github pages
on:
workflow_dispatch:
push:
paths:
- "playground/**"
release:
branches:
- dev
workflow_dispatch:
release:
types: [released]
branches:
- dev
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm i --force
- run: tsc
- run: |
cd ./playground
npm i --force
npx next build
npx next export
touch ./out/.nojekyll
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ./playground/out
deploy-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm i
- run: tsc
- run: |
cd ./docs
npm i
npm run build
# touch ./out/.nojekyll
- name: Deploy to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ./docs/dist
41 changes: 21 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
name: Publish package to npm
on:
workflow_dispatch:
release:
branches:
- dev
workflow_dispatch:
release:
types: [released]
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
registry-url: 'https://registry.npmjs.org'
- run: npm i
- run: tsc
- run: npm run ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
registry-url: "https://registry.npmjs.org"
- run: npm i
- run: tsc
- run: npm run ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25 changes: 12 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
name: Run tests
on:
workflow_dispatch:
push:
pull_request:
branches:
- main
workflow_dispatch:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm i
- run: tsc
- run: npm run ci
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm i
- run: tsc
- run: npm run ci
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,5 @@ dist
.tern-port

manualTests/
perf/dist/
perf/dist/
bench/
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tests
perf
dist
node_modules
manualTests
package-lock.json
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"trailingComma": "none",
"tabWidth": 4,
"semi": true,
"singleQuote": false,
"bracketSameLine": true,
"bracketSpacing": false,
"arrowParens": "avoid",
"printWidth": 200,
"endOfLine": "crlf"
}
Loading
Loading