Skip to content

Commit

Permalink
Mono repo restructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
scopsy committed Sep 23, 2021
1 parent ac4efec commit 5a552a0
Show file tree
Hide file tree
Showing 35 changed files with 4,795 additions and 1,390 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: Test Library
on: [push]
name: Test @notifire/core
on:
push:
paths:
- "packages/core"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: "14"
- run: rm -rf build
- run: yarn install
- run: yarn test
7 changes: 3 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
preset: "ts-jest",
testEnvironment: "node",
};
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"version": "0.0.0"
}
95 changes: 12 additions & 83 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,99 +1,28 @@
{
"name": "@notifire/core",
"version": "0.1.1",
"description": "Notification Management Framework",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
"module": "build/module/index.js",
"repository": "https://github.com/notifirehq/lib",
"license": "MIT",
"keywords": [],
"private": false,
"name": "notifirehq",
"private": true,
"scripts": {
"build": "run-p build:*",
"build:main": "tsc -p tsconfig.json",
"build:module": "tsc -p tsconfig.module.json",
"fix": "run-s fix:*",
"fix:prettier": "prettier \"src/**/*.ts\" --write",
"fix:lint": "eslint src --ext .ts --fix",
"test": "run-s build test:*",
"test:lint": "eslint src --ext .ts",
"test:prettier": "prettier \"src/**/*.ts\"",
"test:spelling": "cspell \"{README.md,.github/*.md,src/**/*.ts}\"",
"test:unit": "jest src",
"check-cli": "run-s test diff-integration-tests check-integration-tests",
"check-integration-tests": "run-s check-integration-test:*",
"diff-integration-tests": "mkdir -p diff && rm -rf diff/test && cp -r test diff/test && rm -rf diff/test/test-*/.git && cd diff && git init --quiet && git add -A && git commit --quiet --no-verify --allow-empty -m 'WIP' && echo '\\n\\nCommitted most recent integration test output in the \"diff\" directory. Review the changes with \"cd diff && git diff HEAD\" or your preferred git diff viewer.'",
"watch:build": "tsc -p tsconfig.json -w",
"watch:test": "jest src --watch",
"cov": "run-s build test:unit cov:html cov:lcov && open-cli coverage/index.html",
"cov:html": "nyc report --reporter=html",
"cov:lcov": "nyc report --reporter=lcov",
"cov:send": "run-s cov:lcov && codecov",
"cov:check": "nyc report && nyc check-coverage --lines 100 --functions 100 --branches 100",
"doc": "run-s doc:html && open-cli build/docs/index.html",
"doc:html": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --out build/docs",
"doc:json": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --json build/docs/typedoc.json",
"doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs",
"version": "standard-version",
"reset-hard": "git clean -dfx && git reset --hard && yarn",
"prepare-release": "run-s reset-hard test version"
},
"engines": {
"node": ">=10"
},
"dependencies": {
"lodash.get": "^4.4.2",
"lodash.merge": "^4.6.2"
"bootstrap": "lerna bootstrap"
},
"devDependencies": {
"ts-jest": "^27.0.5",
"@types/jest": "^27.0.1",
"jest": "^27.1.0",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@sendgrid/mail": "^7.4.6",
"@types/node": "^16.7.2",
"@types/jest": "^27.0.2",
"@types/node": "16.7.2",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"codecov": "^3.5.0",
"cspell": "^4.1.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^7.8.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^3.0.2",
"eslint-plugin-import": "^2.22.0",
"gh-pages": "^3.1.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"open-cli": "^6.0.1",
"jest": "^27.1.0",
"lerna": "^3.22.1",
"prettier": "^2.1.1",
"standard-version": "^9.0.0",
"ts-jest": "^27.0.5",
"ts-node": "^9.0.0",
"typedoc": "^0.19.0",
"typescript": "^4.0.2"
},
"files": [
"build/main",
"build/module",
"!**/*.spec.*",
"!**/*.json",
"CHANGELOG.md",
"LICENSE",
"README.md"
],
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"prettier": {
"singleQuote": true
"typescript": "^4.4.3"
},
"nyc": {
"extends": "@istanbuljs/nyc-config-typescript",
"exclude": [
"**/*.spec.js"
]
}
"workspaces": [
"packages/*"
]
}
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/core/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../../.eslintrc.json"
}
9 changes: 9 additions & 0 deletions packages/core/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.idea/*
.nyc_output
build
node_modules
test
src/**.js
coverage
*.log
package-lock.json
2 changes: 2 additions & 0 deletions packages/core/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# package.json is formatted by package managers, so we ignore it here
package.json
File renamed without changes.
5 changes: 5 additions & 0 deletions packages/core/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
70 changes: 70 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"name": "@notifire/core",
"version": "0.1.1",
"description": "Notification Management Framework",
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
"module": "build/module/index.js",
"repository": "https://github.com/notifirehq/lib",
"license": "MIT",
"keywords": [],
"private": false,
"scripts": {
"build": "run-p build:*",
"build:main": "tsc -p tsconfig.json",
"build:module": "tsc -p tsconfig.module.json",
"fix": "run-s fix:*",
"fix:prettier": "prettier \"src/**/*.ts\" --write",
"fix:lint": "eslint src --ext .ts --fix",
"test": "run-s build test:*",
"test:lint": "eslint src --ext .ts",
"test:prettier": "prettier \"src/**/*.ts\"",
"test:unit": "jest src",
"check-cli": "run-s test diff-integration-tests check-integration-tests",
"check-integration-tests": "run-s check-integration-test:*",
"diff-integration-tests": "mkdir -p diff && rm -rf diff/test && cp -r test diff/test && rm -rf diff/test/test-*/.git && cd diff && git init --quiet && git add -A && git commit --quiet --no-verify --allow-empty -m 'WIP' && echo '\\n\\nCommitted most recent integration test output in the \"diff\" directory. Review the changes with \"cd diff && git diff HEAD\" or your preferred git diff viewer.'",
"watch:build": "tsc -p tsconfig.json -w",
"watch:test": "jest src --watch",
"doc": "run-s doc:html && open-cli build/docs/index.html",
"doc:html": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --out build/docs",
"doc:json": "typedoc src/ --exclude **/*.spec.ts --target ES6 --mode file --json build/docs/typedoc.json",
"doc:publish": "gh-pages -m \"[ci skip] Updates\" -d build/docs",
"version": "standard-version",
"reset-hard": "git clean -dfx && git reset --hard && yarn",
"prepare-release": "run-s reset-hard test version"
},
"engines": {
"node": ">=10"
},
"dependencies": {
"lodash.get": "^4.4.2",
"lodash.merge": "^4.6.2"
},
"devDependencies": {
"@types/jest": "27.0.2",
"@sendgrid/mail": "^7.4.6",
"codecov": "^3.5.0",
"cz-conventional-changelog": "^3.3.0",
"npm-run-all": "^4.1.5",
"open-cli": "^6.0.1",
"standard-version": "^9.0.0",
"typedoc": "^0.19.0"
},
"files": [
"build/main",
"build/module",
"!**/*.spec.*",
"!**/*.json",
"CHANGELOG.md",
"LICENSE",
"README.md"
],
"config": {
"commitizen": {
"path": "cz-conventional-changelog"
}
},
"prettier": {
"singleQuote": true
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ export interface ISmsOptions {
export interface IEmailProvider extends IProvider {
channelType: ChannelTypeEnum.EMAIL;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
sendMessage(options: IEmailOptions): Promise<any>;
}

export interface ISmsProvider extends IProvider {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
sendMessage(options: ISmsOptions): Promise<any>;

channelType: ChannelTypeEnum.SMS;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "build/main",
"rootDir": "src",
"types": ["node", "jest"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"]
}
4 changes: 1 addition & 3 deletions tsconfig.module.json → packages/core/tsconfig.module.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
"outDir": "build/module",
"module": "esnext"
},
"exclude": [
"node_modules/**"
]
"exclude": ["node_modules/**"]
}
12 changes: 4 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"compilerOptions": {
"incremental": true,
"target": "es2017",
"outDir": "build/main",
"rootDir": "src",
"moduleResolution": "node",
"module": "commonjs",
"declaration": true,
Expand Down Expand Up @@ -37,11 +35,9 @@
// "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
// "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */,

"lib": ["es2017"],
"types": ["node", "jest"],
"typeRoots": ["node_modules/@types", "src/types"]
"lib": ["es2017"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules/**"],
"compileOnSave": false
"types": ["node", "jest"],
"compileOnSave": false,
"exclude": ["node_modules/**"]
}
Loading

0 comments on commit 5a552a0

Please sign in to comment.