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

feat(golang): Support Multi-version and root level modules #34

Merged
merged 38 commits into from
Feb 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8a72a54
consider top level module
iliapolo Feb 4, 2021
e843e80
comments and refactoring
iliapolo Feb 4, 2021
fff94aa
remove forgotten variable
iliapolo Feb 4, 2021
d04cb0f
js rewrite
iliapolo Feb 8, 2021
8a3f144
Initial commit
iliapolo Feb 8, 2021
dcd3fc6
Initial commit
iliapolo Feb 8, 2021
b0f6934
mid work
iliapolo Feb 8, 2021
565e43b
mid work
iliapolo Feb 8, 2021
0774ed3
mid work
iliapolo Feb 8, 2021
6e98541
mid work
iliapolo Feb 8, 2021
afe2c84
mid work
iliapolo Feb 8, 2021
1c7f986
mid work
iliapolo Feb 8, 2021
85af9d3
mid work
iliapolo Feb 8, 2021
f233785
mid work
iliapolo Feb 8, 2021
ee0e661
more tests
iliapolo Feb 8, 2021
245732e
remove hack
iliapolo Feb 9, 2021
2e0977a
more stuff
iliapolo Feb 9, 2021
3c000ef
remove unnecessary instruction from README
iliapolo Feb 9, 2021
f2d6efc
more refactor
iliapolo Feb 9, 2021
a82e01f
some fixes in error handling
iliapolo Feb 9, 2021
d846cd1
test for no-op when no modules are detected
iliapolo Feb 9, 2021
f8cf568
debugging permissions problem
iliapolo Feb 9, 2021
f683903
fix temp dir creation
iliapolo Feb 9, 2021
83a111a
unused import
iliapolo Feb 9, 2021
576b057
cleanup
iliapolo Feb 9, 2021
0832e8a
refactor + code review
iliapolo Feb 9, 2021
8512727
code review + refactor
iliapolo Feb 10, 2021
bd1b691
more cleanup and refactoring
iliapolo Feb 10, 2021
8ab5ff3
more tests
iliapolo Feb 10, 2021
9569ed5
use current dir for git config instead of global
iliapolo Feb 10, 2021
3e97051
fix README
iliapolo Feb 10, 2021
84bce30
apparently --author still requires a config - so drop it
iliapolo Feb 10, 2021
ca3426a
more fixes and tests
iliapolo Feb 10, 2021
68061cc
more tests
iliapolo Feb 10, 2021
95f9651
cleanup
iliapolo Feb 10, 2021
6b027b9
code review feedback
iliapolo Feb 11, 2021
75c92b1
resolve to absoulte before changing dirs
iliapolo Feb 11, 2021
54b3ef7
test directory follows src directory
iliapolo Feb 11, 2021
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
230 changes: 230 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
{
"env": {
"jest": true,
"node": true
},
"root": true,
"plugins": [
"@typescript-eslint",
"import"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.eslint.json"
},
"extends": [
"plugin:import/typescript"
],
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [
".ts",
".tsx"
]
},
"import/resolver": {
"node": {},
"typescript": {
"project": "./tsconfig.eslint.json"
}
}
},
"ignorePatterns": [
"*.js",
"!.projenrc.js",
"*.d.ts",
"node_modules/",
"*.generated.ts",
"coverage"
],
"rules": {
"@typescript-eslint/no-require-imports": [
"error"
],
"indent": [
"off"
],
"@typescript-eslint/indent": [
"error",
2
],
"quotes": [
"error",
"single",
{
"avoidEscape": true
}
],
"comma-dangle": [
"error",
"always-multiline"
],
"comma-spacing": [
"error",
{
"before": false,
"after": true
}
],
"no-multi-spaces": [
"error",
{
"ignoreEOLComments": false
}
],
"array-bracket-spacing": [
"error",
"never"
],
"array-bracket-newline": [
"error",
"consistent"
],
"object-curly-spacing": [
"error",
"always"
],
"object-curly-newline": [
"error",
{
"multiline": true,
"consistent": true
}
],
"object-property-newline": [
"error",
{
"allowAllPropertiesOnSameLine": true
}
],
"keyword-spacing": [
"error"
],
"brace-style": [
"error",
"1tbs",
{
"allowSingleLine": true
}
],
"space-before-blocks": [
"error"
],
"curly": [
"error",
"multi-line",
"consistent"
],
"@typescript-eslint/member-delimiter-style": [
"error"
],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": [
"**/test/**",
"**/build-tools/**"
],
"optionalDependencies": false,
"peerDependencies": true
}
],
"import/no-unresolved": [
"error"
],
"import/order": [
"warn",
{
"groups": [
"builtin",
"external"
],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"no-duplicate-imports": [
"error"
],
"no-shadow": [
"off"
],
"@typescript-eslint/no-shadow": [
"error"
],
"key-spacing": [
"error"
],
"semi": [
"error",
"always"
],
"quote-props": [
"error",
"consistent-as-needed"
],
"no-multiple-empty-lines": [
"error"
],
"max-len": [
"error",
{
"code": 150,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreComments": true,
"ignoreRegExpLiterals": true
}
],
"@typescript-eslint/no-floating-promises": [
"error"
],
"no-return-await": [
"off"
],
"@typescript-eslint/return-await": [
"error"
],
"no-trailing-spaces": [
"error"
],
"dot-notation": [
"error"
],
"no-bitwise": [
"error"
],
"@typescript-eslint/member-ordering": [
"error",
{
"default": [
"public-static-field",
"public-static-method",
"protected-static-field",
"protected-static-method",
"private-static-field",
"private-static-method",
"field",
"constructor",
"method"
]
}
]
},
"overrides": [
{
"files": [
".projenrc.js"
],
"rules": {
"@typescript-eslint/no-require-imports": "off",
"import/no-extraneous-dependencies": "off"
}
}
]
}
17 changes: 11 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".

name: Build
on:
pull_request: {}
Expand All @@ -9,15 +10,19 @@ jobs:
env:
CI: "true"
steps:
- uses: actions/checkout@v2
- run: yarn install --check-files --frozen-lockfile
- run: npx projen
- run: git diff --exit-code
name: Anti-tamper check
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Synthesize project files
run: npx projen
- name: Anti-tamper check
run: git diff --exit-code
- name: Set git identity
run: |-
git config user.name "Auto-bump"
git config user.email "[email protected]"
- run: npx projen build
- name: Build
run: npx projen build
- name: Anti-tamper check
run: git diff --exit-code
58 changes: 58 additions & 0 deletions .github/workflows/rebuild-bot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".

name: rebuild-bot
on:
issue_comment:
types:
- created
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
env:
CI: "true"
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body,
'@projen rebuild') }}
steps:
- name: Post comment to issue
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: "_projen_: Rebuild started"
- name: Get pull request branch
id: query_pull_request
env:
PULL_REQUEST_URL: ${{ github.event.issue.pull_request.url }}
run: |-
rm -f /tmp/pr.json
curl --silent $PULL_REQUEST_URL > /tmp/pr.json
BRANCH_STR=$(cat /tmp/pr.json | jq ".head.ref")
REPO_NAME=$(cat /tmp/pr.json | jq ".head.repo.full_name")
echo "::set-output name=branch::$(node -p $BRANCH_STR)"
echo "::set-output name=repo::$(node -p $REPO_NAME)"
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ steps.query_pull_request.outputs.branch }}
repository: ${{ steps.query_pull_request.outputs.repo }}
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Synthesize project files
run: npx projen
- name: Set git identity
run: |-
git config user.name "Auto-bump"
git config user.email "[email protected]"
- name: Build
run: npx projen build
- name: Commit changes
run: 'git commit -am "chore: update generated files"'
- name: Push changes
run: git push --follow-tags origin $BRANCH
env:
BRANCH: ${{ steps.query_pull_request.outputs.branch }}
- name: Post comment to issue
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: "_projen_: Rebuild complete. Updates pushed to pull request branch."
34 changes: 24 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".

name: Release
on:
push:
Expand All @@ -11,20 +12,30 @@ jobs:
env:
CI: "true"
steps:
- uses: actions/checkout@v2
- run: yarn install --check-files --frozen-lockfile
- run: npx projen
- run: git diff --exit-code
name: Anti-tamper check
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install dependencies
run: yarn install --check-files --frozen-lockfile
- name: Synthesize project files
run: npx projen
- name: Anti-tamper check
run: git diff --exit-code
- name: Set git identity
run: |-
git config user.name "Auto-bump"
git config user.email "[email protected]"
- run: npx projen bump
- run: npx projen build
- name: Bump to next version
run: npx projen bump
- name: Build
run: npx projen build
- name: Anti-tamper check
run: git diff --exit-code
- run: git push --follow-tags origin $GITHUB_REF
- name: Push changes
run: git push --follow-tags origin $BRANCH
env:
BRANCH: ${{ github.ref }}
- name: Upload artifact
uses: actions/[email protected]
with:
Expand All @@ -34,13 +45,16 @@ jobs:
name: Release to NPM
needs: build
runs-on: ubuntu-latest
container:
image: jsii/superchain
steps:
- name: Download build artifacts
uses: actions/download-artifact@v1
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Release
run: npx -p jsii-release jsii-release-npm
run: npx -p jsii-release@latest jsii-release-npm
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_DIST_TAG: latest
Expand Down
Loading