Skip to content

Commit

Permalink
Merge pull request #1 from dynamodb-toolbox/init-repository
Browse files Browse the repository at this point in the history
init repository
  • Loading branch information
ThomasAribart authored Dec 23, 2024
2 parents 5986c4a + 2e1eecd commit 0044743
Show file tree
Hide file tree
Showing 18 changed files with 12,721 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
coverage
node_modules
**tests**
\*.test.js
dist
docs
44 changes: 44 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"env": {
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier"
],
"plugins": ["@typescript-eslint", "prefer-arrow", "unused-imports", "prettier", "import"],
"parser": "@typescript-eslint/parser",
"root": true,
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
"import/extensions": ["error", "always"],
"prettier/prettier": "error",
"linebreak-style": ["error", "unix"],
"quotes": [
"error",
"single",
{
"allowTemplateLiterals": true,
"avoidEscape": true
}
],
"semi": ["error", "never"],
// TODO: remove this rule when all the code is fully migrated to TS, atm it just produces a lot of noise
"@typescript-eslint/ban-ts-comment": "off",
// TODO: remove this rule when all the code is fully migrated to TS, atm it just produces a lot of noise
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/consistent-type-imports": "error"
},
"globals": {
"expect": true,
"it": true
}
}
19 changes: 19 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
version-resolver:
major:
labels:
- major
minor:
labels:
- minor
patch:
labels:
- patch
default: patch
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'
template: |
## Changes
$CHANGES
26 changes: 26 additions & 0 deletions .github/workflows/draft-or-update-next-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 📝 Draft or update next release
concurrency: draft_or_update_next_release

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
pull-requests: read

jobs:
prepare-deployment:
name: 📝 Draft or update next release
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: ♻️ Checkout
uses: actions/checkout@v4

- name: 📝 Release/Draft next release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
# This job runs when a new release is published
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: ♻️ Checkout
uses: actions/checkout@v4

- name: 🏗️ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: https://registry.npmjs.org

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}

# Store the name of the release
# See https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- run: echo "RELEASE_NPM_TAG=${{ github.event.release.prerelease && 'alpha' || 'latest' }}" >> $GITHUB_ENV
- run: npm ci
- run: npm version $RELEASE_VERSION --no-git-tag-version
- run: npm run build
- run: npm publish --access public --tag $RELEASE_NPM_TAG
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Pull Request'
on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [16, 18, 20]
typescript: ['~4.9.5', '~5.0.4', '~5.1.6', '~5.2.2', '~5.3.3', '~5.4.2', 'latest']
name: Node ${{ matrix.node }} / TS ${{ matrix.typescript }}
steps:
- name: ♻️ Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: 🏗️ Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: 🚚 Install dependencies
run: npm ci --legacy-peer-deps

- name: 📌 Install TS at correct version
run: npm i typescript@${{ matrix.typescript }}

- name: 🎯 Run tests
run: npm test
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# package directories
node_modules
jspm_packages

# local os
dump.rdb

# coverage
coverage

# dist
dist

# dev env settings
.vscode

# for test-exports script
dynamodb-toolshack-*.tgz
14 changes: 14 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"printWidth": 100,
"semi": false,
"arrowParens": "avoid",
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": ["^~/(.*)$", "^[./]"],
"importOrderSortSpecifiers": true,
"importOrderGroupNamespaceSpecifiers": true,
"importOrderSeparation": true,
"importOrderParserPlugins": ["typescript", "decorators"]
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 DynamoDB Toolbox
Copyright (c) 2024 DynamoDB Toolshack

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# dynamodb-toolshack
# DynamoDB-Toolshack
Binary file added assets/plus-sign.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0044743

Please sign in to comment.