Skip to content

Commit

Permalink
feat: refactor project to utilize Bitbucket Pipelines
Browse files Browse the repository at this point in the history
BREAKING CHANGE: This requires Git hosting on Bitbucket Cloud.
  • Loading branch information
DASPRiD committed Jan 19, 2024
1 parent 146114e commit bbe845b
Show file tree
Hide file tree
Showing 84 changed files with 7,551 additions and 948 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20

- name: Cache node modules
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
run: npm ci

- name: Biome CI
run: npx biome ci .

- name: Build
run: npm run build

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
HUSKY: 0
id: semantic
with:
semantic_version: 19.0.5
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/template/**/package-lock.json
node_modules
/cdk.out
/node_modules
/dist
4 changes: 0 additions & 4 deletions .husky/commit-msg

This file was deleted.

1 change: 1 addition & 0 deletions .lefthook/commit-msg/commitlint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo $(head -n1 $1) | npx commitlint --color
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

29 changes: 15 additions & 14 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
The MIT License (MIT)
MIT License

Copyright (c) 2023 Soliant Consulting, Inc.
Copyright (c) 2023 Soliant Consulting

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
# Create Koa API

This is an init project for creating Koa API projects with an optional CDK deployment pipeline.
Init project for creating Koa API projects with Bitbucket Pipelines and CDK integration.

To create a new project, run the following command:

```npm init @soliantconsulting/koa-api```

The init script will ask a few questions:

- `API name`: will be used as the package name as well as name of the deployment pipeline. Should be something like
`my-foo-api`.
- `Description`: will be used as the package description as well as the title for the `README.md`.
- `Use CDK`: toggles whether the project should be initialized with a CDK pipeline.
- `Use SSM`: toggles whether the project uses SSM for configuration.
```npm init @soliantconsulting/koa-api [<api-name>]```

The script will place the project in a directory with the given API name under the current working directory.

After initialization, check the output and the generated `README.md` for further instructions.
30 changes: 30 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.2/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"include": [
"biome.json",
"cdk.json",
"release.config.cjs",
"commitlint.config.cjs",
"src/**/*"
]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"nursery": {
"useImportType": "error",
"noUnusedImports": "error"
}
}
},
"formatter": {
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 100
}
}
1 change: 1 addition & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
1 change: 0 additions & 1 deletion commitlint.config.js

This file was deleted.

222 changes: 0 additions & 222 deletions index.mjs

This file was deleted.

10 changes: 10 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: npx biome check --apply --no-errors-on-unmatched --files-ignore-unknown=true {staged_files} && git update-index --again

commit-msg:
scripts:
"commitlint.sh":
runner: bash
Loading

0 comments on commit bbe845b

Please sign in to comment.