Skip to content

Commit 7dbdcd2

Browse files
committed
Initial commit
0 parents  commit 7dbdcd2

37 files changed

+7065
-0
lines changed

.changeset/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"access": "public",
4+
"baseBranch": "main",
5+
"changelog": [
6+
"@changesets/changelog-github",
7+
{
8+
"repo": "swordev/sql-controller"
9+
}
10+
],
11+
"commit": false,
12+
"fixed": [],
13+
"ignore": [],
14+
"linked": [],
15+
"updateInternalDependencies": "patch"
16+
}

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# gitignore
2+
**/.history
3+
**/.pnpm-store
4+
**/lib
5+
**/node_modules
6+
**/tsconfig.tsbuildinfo
7+
**/sql-controller.config.json

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf

.eslintignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.eslintrc.js
2+
# .gitignore
3+
.history
4+
.pnpm-store
5+
node_modules
6+
lib
7+
sql-controller.config.json
8+
tsconfig.tsbuildinfo

.eslintrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
3+
parser: "@typescript-eslint/parser",
4+
parserOptions: {
5+
project: "./tsconfig.json",
6+
},
7+
plugins: ["@typescript-eslint"],
8+
rules: {
9+
"@typescript-eslint/no-floating-promises": ["error"],
10+
},
11+
};

.github/workflows/ci.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- main
6+
env:
7+
PNPM_CACHE_FOLDER: .pnpm-store
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Use Node.js 16.x
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: 16
19+
- uses: actions/cache@v2
20+
with:
21+
path: ${{ env.PNPM_CACHE_FOLDER }}
22+
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
23+
restore-keys: |
24+
${{ runner.os }}-pnpm-
25+
- name: Use pnpm
26+
uses: pnpm/action-setup@v2
27+
with:
28+
version: 6
29+
- name: Setup pnpm config
30+
run: pnpm config set store-dir $PNPM_CACHE_FOLDER
31+
- name: Install dependencies
32+
run: pnpm install
33+
env:
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
35+
- name: Check
36+
run: pnpm check
37+
- name: Test
38+
run: pnpm test
39+
- name: Build
40+
run: pnpm build
41+
- name: Patch
42+
run: pnpm patch
43+
- name: Create release pull request or publish to npm
44+
id: changesets
45+
uses: changesets/action@v1
46+
with:
47+
commit: "chore: update versions"
48+
title: Update versions
49+
publish: pnpm exec changeset publish
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
- id: changesets_meta
54+
name: Build changesets meta
55+
uses: actions/github-script@v5
56+
env:
57+
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
58+
with:
59+
script: |-
60+
const output = {};
61+
const published = JSON.parse(process.env.PUBLISHED_PACKAGES);
62+
output['@sql-controller/cli:published'] = false;
63+
published.forEach(({ name, version }) => {
64+
const vars = { version, published: true };
65+
Object.keys(vars).forEach(n => output[`${name}:${n}`] = vars[n]);
66+
});
67+
console.log(output);
68+
Object.keys(output).forEach(k => core.setOutput(k, output[k]));
69+
- id: image_meta
70+
name: Build image metadata
71+
uses: docker/metadata-action@v3
72+
if: steps.changesets_meta.outputs['@sql-controller/cli:version'] != ''
73+
with:
74+
images: ghcr.io/${{ github.repository }}
75+
tags: |-
76+
type=schedule
77+
type=ref,event=branch
78+
type=ref,event=pr
79+
type=semver,pattern={{version}},value=v${{ steps.changesets_meta.outputs['@sql-controller/cli:version'] }}
80+
type=semver,pattern={{major}}.{{minor}},value=v${{ steps.changesets_meta.outputs['@sql-controller/cli:version'] }}
81+
type=semver,pattern={{major}},value=v${{ steps.changesets_meta.outputs['@sql-controller/cli:version'] }}
82+
type=sha
83+
- name: Setup Docker Buildx
84+
uses: docker/setup-buildx-action@v1
85+
- name: Login Docker
86+
uses: docker/login-action@v1
87+
with:
88+
registry: ghcr.io
89+
username: ${{ github.actor }}
90+
password: ${{ secrets.GITHUB_TOKEN }}
91+
- name: Build and publish image
92+
uses: docker/build-push-action@v2
93+
with:
94+
tags: ${{ steps.image_meta.outputs.tags }}
95+
labels: ${{ steps.image_meta.outputs.labels }}
96+
push: ${{ steps.changesets_meta.outputs['@sql-controller/cli:published'] }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.history
2+
.pnpm-store
3+
node_modules
4+
lib
5+
sql-controller.config.json
6+
tsconfig.tsbuildinfo

.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pnpm-lock.yaml
2+
tsconfig.tsbuildinfo
3+
# .gitignore
4+
.history
5+
.pnpm-store
6+
node_modules
7+
lib

.prettierrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
plugins: [
3+
require("@trivago/prettier-plugin-sort-imports"),
4+
require("prettier-plugin-sort-json"),
5+
require("prettier-plugin-packagejson"),
6+
],
7+
importOrderParserPlugins: [
8+
"typescript",
9+
"classProperties",
10+
"decorators-legacy",
11+
],
12+
};

.vscode/settings.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"[javascript]": {
3+
"editor.defaultFormatter": "esbenp.prettier-vscode"
4+
},
5+
"[json]": {
6+
"editor.defaultFormatter": "esbenp.prettier-vscode"
7+
},
8+
"[jsonc]": {
9+
"editor.defaultFormatter": "esbenp.prettier-vscode"
10+
},
11+
"[typescript]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode"
13+
},
14+
"editor.formatOnSave": true,
15+
"jest.autoRun": "off"
16+
}

0 commit comments

Comments
 (0)