-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from nodecfdi/dev
Version bump 1.2.0
- Loading branch information
Showing
70 changed files
with
9,931 additions
and
715 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const pkg = require('./package.json'); | ||
const { execSync } = require('child_process'); | ||
|
||
const pkgVersion = process.env.PKG_VERSION || pkg.version; | ||
const nodeEnv = process.env.NODE_ENV || 'production'; | ||
|
||
const buildDate = execSync('git show -s --format=%ci HEAD') | ||
.toString() | ||
.replace(/[\r\n]+$/, ''); | ||
|
||
const commitSha = execSync('git rev-parse --short HEAD') | ||
.toString() | ||
.replace(/[\r\n]+$/, ''); | ||
|
||
const replacements = { | ||
'__VERSION__': pkgVersion, | ||
'__BUILD_DATE__': buildDate, | ||
'__COMMIT_SHA__': commitSha, | ||
'process.env.NODE_ENV': nodeEnv, | ||
}; | ||
|
||
const plugins = ['dev-expression', ['transform-define', replacements]]; | ||
|
||
//default babel config | ||
const config = { plugins }; | ||
|
||
//babel config for Jest tests | ||
const jestConfig = { | ||
plugins, | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
node: 'current', | ||
}, | ||
}, | ||
], | ||
'@babel/preset-typescript', | ||
], | ||
ignore: ['node_modules'], | ||
sourceMaps: 'inline', | ||
}; | ||
|
||
module.exports = process.env.NODE_ENV === 'test' ? jestConfig : config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
node_modules | ||
dist | ||
build | ||
docs | ||
|
||
jest.config.js | ||
examples | ||
coverage | ||
web_modules | ||
tsconfig.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
// commonjs: true, | ||
es6: true, | ||
node: true, | ||
jest: true, | ||
}, | ||
globals: { | ||
__DEV__: true, | ||
__VERSION__: true, | ||
__COMMIT_SHA__: true, | ||
__BUILD_DATE__: true, | ||
}, | ||
plugins: ['@typescript-eslint/eslint-plugin', 'eslint-plugin-tsdoc', 'prettier'], | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:jest/recommended', 'prettier'], | ||
parser: '@typescript-eslint/parser', | ||
reportUnusedDisableDirectives: true, | ||
parserOptions: { | ||
/* enabling "project" field is a performance hit | ||
https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/TYPED_LINTING.md#performance | ||
*/ | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
'indent': 'off', | ||
'tsdoc/syntax': 'warn', | ||
'@typescript-eslint/no-unused-vars': [2, { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], | ||
'semi': 'error', | ||
'quote-props': ['error', 'consistent'], | ||
'generator-star-spacing': ['error', { before: false, after: true }], | ||
'space-before-function-paren': 'off', | ||
'no-dupe-class-members': 'off', | ||
'no-useless-constructor': 'off', | ||
'@typescript-eslint/no-useless-constructor': 'off', | ||
'prettier/prettier': ['error'], | ||
'lines-between-class-members': ['error', 'always'], | ||
'padding-line-between-statements': ['error', { blankLine: 'always', prev: '*', next: 'return' }], | ||
'@typescript-eslint/explicit-function-return-type': [ | ||
'error', | ||
{ | ||
allowExpressions: true, | ||
allowTypedFunctionExpressions: true, | ||
}, | ||
], | ||
'@typescript-eslint/explicit-member-accessibility': [ | ||
'error', | ||
{ | ||
accessibility: 'explicit', | ||
overrides: { | ||
constructors: 'no-public', | ||
}, | ||
}, | ||
], | ||
'@typescript-eslint/ban-ts-comment': [ | ||
'error', | ||
{ | ||
'ts-expect-error': 'allow-with-description', | ||
}, | ||
], | ||
'@typescript-eslint/no-non-null-assertion': [2], | ||
'@typescript-eslint/no-explicit-any': [2, { ignoreRestArgs: true }], | ||
'@typescript-eslint/member-delimiter-style': [ | ||
'error', | ||
{ | ||
multiline: { | ||
delimiter: 'semi', | ||
requireLast: true, | ||
}, | ||
singleline: { | ||
delimiter: 'semi', | ||
requireLast: false, | ||
}, | ||
multilineDetection: 'brackets', | ||
}, | ||
], | ||
'@typescript-eslint/indent': ['error', 4], | ||
'@typescript-eslint/no-empty-interface': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.js', '*.jsx'], | ||
rules: { | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/no-var-requires': 'off', | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Do not put this files on a distribution package | ||
/.changeset/ export-ignore | ||
/.github/ export-ignore | ||
/.husky/ export-ignore | ||
/.vscode/ export-ignore | ||
/tests/ export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore | ||
/sonar-project.properties export-ignore | ||
/assets/ export-ignore | ||
|
||
# Do not count these files on github code language | ||
/tests/_files/** linguist-detectable=false | ||
/docs/** linguist-detectable=false | ||
/.husky/** linguist-detectable=false | ||
*.cjs linguist-detectable=false | ||
/examples/** linguist-detectable=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: build | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
schedule: | ||
- cron: '0 16 * * 0' # sunday 16:00 | ||
|
||
jobs: | ||
build: | ||
name: Node unit tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: ['14', '16', '17', '18'] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Cache .pnpm-store | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install dependencies | ||
uses: pnpm/[email protected] | ||
with: | ||
version: 6.23.6 | ||
run_install: true | ||
|
||
- name: Lint source | ||
run: | | ||
pnpm lint:ci | ||
- name: Build package | ||
run: | | ||
pnpm build | ||
- name: Run tests | ||
run: | | ||
pnpm test:ci | ||
env: | ||
CI: true | ||
|
||
- name: 'Consume changesets' | ||
if: github.event_name == 'push' && matrix.node == 16 && github.ref == 'refs/heads/main' | ||
uses: changesets/action@v1 | ||
id: 'changesets' | ||
with: | ||
# This expects you to have a script called release which does a build for your packages and calls changeset publish | ||
publish: pnpm release | ||
commit: 'chore: version bump' | ||
title: Next release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: 'Generate docs' | ||
if: steps.changesets.outputs.published == 'true' | ||
run: pnpm gen:docs | ||
|
||
- name: Commit docs | ||
if: steps.changesets.outputs.published == 'true' | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: 'docs: generate docs' |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.