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
Split into Action, App, CLI, Core and Switch to TypeScript #1204
base: master
Are you sure you want to change the base?
Changes from all commits
4de0255
6513dff
97e2846
0303270
904240b
729da8e
c96521b
d24b192
6443ce3
f891e3d
decb93a
9553aea
3d5ed07
bc6c66b
42eb2d7
12ea511
b2a437a
f7503be
0e076d6
9adc4c1
6e3c56f
7cde87c
fda80d1
5feda54
989a35e
ecd6ff0
757b80d
e0a1296
f525012
86e32bd
a4e0c27
ab0dbe3
7572ba5
f6411f9
ae86ff2
e516e48
903bdef
54758a9
a32dec8
7966225
22ffc42
5a44e2a
234eef7
bac8b93
58a83d7
87015ff
a6bb74b
ab70f9a
be139a8
acf3a56
c9e68cf
a4e6ee5
1610834
978cc71
606ca50
8a448c0
2d11459
3d4a713
83a9edf
fcf6a20
29940a1
e022599
07fae30
fea753d
dcd1b0c
eff61ed
9046d74
06a4a0a
1dbdc73
ee6d5b8
7eb8c64
a01b62a
ce45cc4
a40973b
75da31f
3b0f0b7
8eaee78
cf4e1f4
bf1f94d
4c98a9a
f318514
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,27 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | ||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/javascript-node | ||
{ | ||
"name": "Node.js", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
// Update 'VARIANT' to pick a Node version: 16, 14, 12. | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use -bullseye variants on local arm64/Apple Silicon. | ||
"args": { "VARIANT": "16" } | ||
}, | ||
"name": "Node.js", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
// Update 'VARIANT' to pick a Node version: 16, 14, 12. | ||
// Append -bullseye or -buster to pin to an OS version. | ||
// Use -bullseye variants on local arm64/Apple Silicon. | ||
"args": { "VARIANT": "16" } | ||
}, | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": {}, | ||
// Set *default* container specific settings.json values on container create. | ||
"settings": {}, | ||
|
||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": ["dbaeumer.vscode-eslint"], | ||
// Add the IDs of extensions you want installed when the container is created. | ||
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"], | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "yarn install", | ||
// Use 'postCreateCommand' to run commands after the container is created. | ||
"postCreateCommand": "pnpm install", | ||
|
||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "node" | ||
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. | ||
"remoteUser": "node" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ coverage | |
*.pem | ||
.git | ||
dist/ | ||
.pnpm-store |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.{ts,tsx,js,jsx,json}] | ||
indent_style = tab |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
coverage | ||
coverage/ | ||
dist/ | ||
node_modules/ | ||
lib/ | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
{ | ||
"extends": ["eslint:recommended", "prettier", "plugin:unicorn/recommended"], | ||
"plugins": ["prettier"], | ||
"parserOptions": { | ||
"ecmaVersion": 12 | ||
}, | ||
"env": { "node": true, "es6": true }, | ||
"rules": { | ||
"prettier/prettier": "warn", | ||
"no-console": "off", | ||
"no-unused-vars": "warn", | ||
"unicorn/no-null": "off", | ||
"unicorn/prefer-module": "off", | ||
"unicorn/prevent-abbreviations": "off", | ||
"unicorn/prefer-top-level-await": "off" | ||
} | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:unicorn/recommended", | ||
"plugin:prettier/recommended", | ||
"plugin:jest/recommended", | ||
"plugin:jest/style" | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 2022 | ||
}, | ||
"env": { "node": true } | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
* text=auto eol=lf | ||
*.png binary | ||
*.sketch binary | ||
|
||
# GitHub linguist should ignore these file | ||
/packages/action/dist/** linguist-generated=true |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
$schema: 'https://docs.renovatebot.com/renovate-schema.json', | ||
labels: ['type: dependencies'], | ||
extends: [ | ||
'config:base', | ||
':maintainLockFilesWeekly', | ||
':rebaseStalePrs', | ||
':disableDependencyDashboard', | ||
'docker:disableMajor', | ||
'docker:pinDigests', | ||
'group:linters', | ||
'helpers:pinGitHubActionDigests', | ||
'schedule:earlyMondays', | ||
], | ||
timezone: 'Europe/Copenhagen', | ||
prConcurrentLimit: 10, | ||
rebaseWhen: 'behind-base-branch', | ||
configMigration: true, | ||
assignees: ['jetersen'], | ||
packageRules: [ | ||
{ | ||
description: 'v prefix workaround for action updates', | ||
matchDepTypes: ['action'], | ||
extractVersion: '^(?<version>v\\d+\\.\\d+\\.\\d+)$', | ||
versioning: 'regex:^v(?<major>\\d+)(\\.(?<minor>\\d+)\\.(?<patch>\\d+))?$', | ||
}, | ||
{ | ||
description: 'Group prettier packages', | ||
matchPackageNames: ['prettier'], | ||
matchPackagePatterns: ['^@prettier\\/', '^prettier-plugin-'], | ||
groupName: 'prettier packages', | ||
}, | ||
], | ||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,7 +3,7 @@ on: | |||||
pull_request_target: | ||||||
types: [opened, synchronize, reopened] | ||||||
branches: | ||||||
- 'master' | ||||||
- 'main' | ||||||
|
||||||
env: | ||||||
HUSKY: '0' | ||||||
|
@@ -26,22 +26,26 @@ jobs: | |||||
run: | | ||||||
gh pr checkout ${{ github.event.pull_request.number }} | ||||||
|
||||||
- uses: pnpm/action-setup@v2 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity, what are you reason(s) to switch to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pnpm solves a problem with monorepo shared dependencies are hard links or symlinks vs yarn and npm duplicating the storage. |
||||||
with: | ||||||
version: 7 | ||||||
|
||||||
- uses: actions/setup-node@v3 | ||||||
with: | ||||||
node-version: '16' | ||||||
cache: 'yarn' | ||||||
cache: 'pnpm' | ||||||
|
||||||
- run: yarn install --frozen-lockfile | ||||||
- run: pnpm install --frozen-lockfile | ||||||
|
||||||
- run: yarn build | ||||||
- run: pnpm build | ||||||
|
||||||
- name: Commit and push if needed | ||||||
run: | | ||||||
git add . | ||||||
if [ -z "$(git status --porcelain)" ]; then | ||||||
echo "💾 no changes to dist/index.js" | ||||||
if [ "$(git diff --ignore-space-at-eol | wc -l)" -eq "0" ]; then | ||||||
echo "❎ no changes" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would use ℹ️ instead of a (green) cross which would make me think twice before deciding if it's all good. |
||||||
exit 0 | ||||||
fi | ||||||
git add . | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
or change the commit and echo lines to say it might have added more than just this file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I do not want to try and figure out which dist it is. Cause this will host multiple actions. So it would be reason for |
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||||||
git config --local user.name "github-actions[bot]" | ||||||
git commit -m "Apply dist/index.js changes" | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,31 +16,35 @@ jobs: | |||||
with: | ||||||
fetch-depth: 0 | ||||||
|
||||||
- uses: pnpm/action-setup@v2 | ||||||
with: | ||||||
version: 7 | ||||||
|
||||||
- name: Setup Node | ||||||
uses: actions/setup-node@v3 | ||||||
with: | ||||||
node-version: '16' | ||||||
cache: yarn | ||||||
cache: 'pnpm' | ||||||
registry-url: https://registry.npmjs.org | ||||||
|
||||||
- name: yarn install | ||||||
run: yarn install --frozen-lockfile | ||||||
- name: pnpm install | ||||||
run: pnpm install --frozen-lockfile | ||||||
|
||||||
- name: yarn test | ||||||
run: yarn test | ||||||
- name: pnpm test | ||||||
run: pnpm test | ||||||
|
||||||
- name: Deploy to Heroku | ||||||
env: | ||||||
HEROKU_API_TOKEN: ${{ secrets.HEROKU_API_TOKEN }} | ||||||
HEROKU_APP_NAME: release-drafter | ||||||
run: | | ||||||
git fetch origin master | ||||||
git push https://heroku:$HEROKU_API_TOKEN@git.heroku.com/$HEROKU_APP_NAME.git origin/master:master --force | ||||||
git fetch origin main | ||||||
git push https://heroku:$HEROKU_API_TOKEN@git.heroku.com/$HEROKU_APP_NAME.git origin/main:master --force | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
(not sure about this one) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't want to change it on heroku just yet, sounds scary to run |
||||||
|
||||||
- name: yarn publish | ||||||
- name: pnpm publish | ||||||
env: | ||||||
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_TOKEN }} | ||||||
run: yarn publish --access public | ||||||
run: pnpm publish --access public --no-git-checks | ||||||
|
||||||
- name: version | ||||||
id: version | ||||||
|
@@ -51,10 +55,16 @@ jobs: | |||||
echo "::set-output name=tag::${tag}" | ||||||
echo "::set-output name=version::${version}" | ||||||
echo "::set-output name=major::${major}" | ||||||
if [[ "${version}" == *"-"* ]]; then | ||||||
echo "::set-output name=prerelease::true" | ||||||
else | ||||||
echo "::set-output name=prerelease::false" | ||||||
fi | ||||||
|
||||||
- uses: release-drafter/release-drafter@master | ||||||
- uses: release-drafter/release-drafter@main | ||||||
with: | ||||||
version: ${{ steps.version.outputs.version }} | ||||||
prerelease: ${{ steps.version.outputs.prerelease }} | ||||||
publish: true | ||||||
env: | ||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Tests | |
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: | ||
|
||
env: | ||
|
@@ -14,17 +14,22 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 7 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
cache: 'yarn' | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn test | ||
- run: yarn lint --fix | ||
- run: yarn prettier | ||
- run: yarn build | ||
- name: correct vercel/ncc crlf output | ||
run: sed -i 's/\x0D$//' ./dist/index.js | ||
cache: 'pnpm' | ||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm test | ||
- run: pnpm lint:fix | ||
- run: pnpm prettier:fix | ||
- run: pnpm build | ||
- name: check for unstaged files | ||
if: ${{ github.actor != 'dependabot[bot]' }} | ||
run: .github/no-unstaged-files.sh | ||
run: | | ||
if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then | ||
echo "::error::💥 Unstaged changes detected. Locally try running: pnpm prettier:fix && pnpm lint:fix && pnpm build" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't the instructions order here be the same as the instructions above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Order doesn't matter between prettier and lint, prettier corrects other files such as yaml and markdown as well :) ESlint is configured for prettier so order does not matter. |
||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing EOL