Skip to content

Commit 37c7e36

Browse files
committed
feat: initial commit
0 parents  commit 37c7e36

24 files changed

+14476
-0
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
coverage/

.eslintrc.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* eslint-env node */
2+
3+
require('@geprog/eslint-config/patch/modern-module-resolution');
4+
5+
module.exports = {
6+
extends: ['@geprog', '@geprog/eslint-config/jest'],
7+
8+
env: {
9+
'shared-node-browser': true,
10+
},
11+
12+
parserOptions: {
13+
project: ['./tsconfig.eslint.json'],
14+
tsconfigRootDir: __dirname,
15+
extraFileExtensions: ['.cjs'],
16+
},
17+
};

.github/workflows/lint-pr.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Lint PR'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
runs-on: ubuntu-latest
13+
steps:
14+
# https://github.com/amannn/action-semantic-pull-request/releases
15+
- uses: amannn/[email protected]
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
YARN_CACHE_FOLDER: ~/.yarn
10+
11+
jobs:
12+
release:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v1
23+
with:
24+
node-version: 12
25+
26+
- name: Caching
27+
uses: actions/cache@v2
28+
with:
29+
path: ${{ env.YARN_CACHE_FOLDER }}
30+
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
31+
restore-keys: |
32+
${{ runner.OS }}-yarn-${{ env.cache-name }}
33+
${{ runner.OS }}-yarn-
34+
35+
- name: Installing dependencies
36+
run: yarn install --frozen-lockfile
37+
38+
- name: Build
39+
run: yarn build
40+
41+
- name: Release
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
run: yarn release

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
dist
3+
coverage/
4+
junit.xml
5+
*.tgz

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
coverage/

.prettierrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
tabWidth: 2,
7+
endOfLine: 'lf',
8+
};

.releaserc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
["@semantic-release/npm", { "npmPublish": true }],
6+
"@semantic-release/github"
7+
],
8+
"branches": ["main"]
9+
}

jest.config.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { Config } from '@jest/types';
2+
import { pathsToModuleNameMapper } from 'ts-jest/utils';
3+
4+
import { compilerOptions } from './tsconfig.json';
5+
6+
const moduleNameMapper = {
7+
...pathsToModuleNameMapper(compilerOptions.paths, {
8+
prefix: '<rootDir>/' + compilerOptions.baseUrl + '/',
9+
}),
10+
} as Config.InitialOptions['moduleNameMapper'];
11+
12+
const config: Config.InitialOptions = {
13+
preset: 'ts-jest',
14+
roots: ['<rootDir>/test'],
15+
moduleNameMapper,
16+
testEnvironment: 'jest-environment-jsdom',
17+
reporters: ['default', 'jest-junit'],
18+
collectCoverage: true,
19+
coverageReporters: ['json', 'text', 'cobertura'],
20+
};
21+
22+
export default config;

package.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "@geprog/node-migrate-ts",
3+
"version": "0.0.0-semantic-release",
4+
"description": "Abstract migration framework using TypeScript",
5+
"homepage": "https://geprog.com",
6+
"repository": "github:geprog/node-migrate-ts",
7+
"license": "MIT",
8+
"exports": {
9+
".": {
10+
"import": "./dist/index.esm.js",
11+
"require": "./dist/index.cjs.js"
12+
}
13+
},
14+
"main": "./dist/index.cjs.js",
15+
"module": "./dist/index.esm.js",
16+
"types": "./dist/index.d.ts",
17+
"files": [
18+
"/dist"
19+
],
20+
"scripts": {
21+
"build": "rollup -c rollup.config.js",
22+
"clean": "rm -rf dist/ node_modules/",
23+
"lint": "prettier --check . && eslint --max-warnings 0 .",
24+
"start": "rollup -c rollup.config.js --watch",
25+
"test": "NODE_OPTIONS=--experimental-vm-modules jest --forceExit --detectOpenHandles",
26+
"test:watch": "yarn test --watch",
27+
"release": "semantic-release"
28+
},
29+
"dependencies": {
30+
"mongodb": "3.6.10"
31+
},
32+
"devDependencies": {
33+
"@geprog/eslint-config": "0.0.1",
34+
"@jest/types": "26.6.2",
35+
"@semantic-release/commit-analyzer": "8.0.1",
36+
"@semantic-release/github": "7.2.3",
37+
"@semantic-release/npm": "7.1.3",
38+
"@semantic-release/release-notes-generator": "9.0.3",
39+
"@types/jest": "26.0.23",
40+
"@types/mongodb": "^3.6.20",
41+
"@types/node": "15.12.4",
42+
"esbuild": "0.12.9",
43+
"esbuild-register": "2.6.0",
44+
"eslint": "7.29.0",
45+
"jest": "26.6.3",
46+
"jest-junit": "12.2.0",
47+
"prettier": "2.3.1",
48+
"rollup": "2.52.2",
49+
"rollup-plugin-dts": "3.0.2",
50+
"rollup-plugin-typescript2": "0.30.0",
51+
"semantic-release": "17.4.4",
52+
"ts-jest": "26.5.6",
53+
"ts-node": "10.0.0",
54+
"typescript": "4.2.4"
55+
}
56+
}

0 commit comments

Comments
 (0)