Skip to content

Commit

Permalink
Updating the repository based on a modern look at libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
krainboltgreene committed Dec 30, 2020
1 parent 5d2fc91 commit 2443bd4
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 41 deletions.
44 changes: 21 additions & 23 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,33 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
- uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- run: npm install
- uses: actions/cache@v2
with:
path: "*.js"
key: ${{ runner.OS }}-build-${{ hashFiles('*.js') }}
restore-keys: |
${{ runner.OS }}-build-
- run: npm run build
test:
needs: build
runs-on: ubuntu-latest
steps:
- run: npm run test
lint:
needs: build
runs-on: ubuntu-latest
steps:
- run: npm run lint
typecheck:
needs: build
runs-on: ubuntu-latest
steps:
- run: npm run typecheck
publish-npm:
needs: [test, lint, typecheck]
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
registry-url: https://registry.npmjs.org/
- run: npm publish
env:
Expand All @@ -43,12 +41,12 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
registry-url: https://npm.pkg.github.com/
scope: '@unctionjs'
scope: "@unction"
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
32 changes: 30 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,52 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
node-version: 14
- uses: actions/cache@v2
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
- run: npm install
- uses: actions/cache@v2
with:
path: "*.js"
key: ${{ runner.OS }}-build-${{ hashFiles('*.js') }}
restore-keys: |
${{ runner.OS }}-build-
- run: npm run build
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm install
- run: npm run test
lint:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm install
- run: npm run lint
typecheck:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14
- run: npm install
- run: npm run typecheck
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
/.nyc_output/
browser.js
main.js
module.js

# Log files
*.log
Expand Down
16 changes: 11 additions & 5 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
module.exports = {
"sourceMaps": "inline",
presets: [
"@babel/preset-typescript"
],
plugins: [
"@babel/plugin-proposal-object-rest-spread",
["@babel/plugin-proposal-pipeline-operator", {"proposal": "fsharp"}]
],
env: {
main: {
presets: [
["@babel/preset-env", {useBuiltIns: "usage", corejs: "3.6", targets: {"node": 10}}],
["@babel/preset-env", {"modules": "cjs", useBuiltIns: "usage", corejs: 3, targets: {"node": 14}}],
"minify"
]
},
module: {
presets: [
["@babel/preset-env", {"modules": false, useBuiltIns: "usage", corejs: 3, targets: {"node": 14}}],
"minify"
]
},
browser: {
sourceMaps: "inline",
presets: [
["@babel/preset-env", {useBuiltIns: "usage", corejs: "3.6"}],
["@babel/preset-env", {useBuiltIns: "usage", corejs: 3}],
"minify"
]
},
test:{
presets: [
["@babel/preset-env", {useBuiltIns: "usage", corejs: "3.6", targets: {"node": "current"}}],
"minify"
["@babel/preset-env", {useBuiltIns: "usage", corejs: 3, targets: {"node": "current"}}]
],
"plugins": [
"annotate-console-log"
Expand Down
1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ module.exports = {
"./index.ts",
],
};

31 changes: 25 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
}
],
"main": "main.js",
"module": "main.js",
"module": "module.js",
"browser": "browser.js",
"types": "index.ts",
"files": [
Expand All @@ -45,7 +45,7 @@
"@babel/plugin-proposal-object-rest-spread": "^7.12.1",
"@babel/preset-env": "^7.12.7",
"@babel/preset-typescript": "^7.12.7",
"@types/jest": "^26.0.15",
"@types/jest": "^26.0.19",
"@types/node": "^14.14.10",
"@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.8.2",
Expand All @@ -63,7 +63,8 @@
"eslint-plugin-unicorn": "^23.0.0",
"jest": "^26.6.3",
"jest-extended": "^0.11.5",
"typescript": "^4.1.2"
"typescript": "^4.1.2",
"@babel/plugin-proposal-pipeline-operator": "^7.12.1"
},
"dependencies": {}
}
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
"strict": true
}
}

0 comments on commit 2443bd4

Please sign in to comment.