Skip to content

Commit

Permalink
add monorepo tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-Valen committed Jan 4, 2024
1 parent bcdf41a commit 50bc950
Show file tree
Hide file tree
Showing 20 changed files with 2,677 additions and 2,844 deletions.
77 changes: 28 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,78 +1,57 @@
name: Continuous Integration
name: CI

on:
push:
branches:
- master
branches: ["master"]
pull_request:
types: [opened, synchronize]

jobs:
Testing:
name: Unit Tests
build:
name: Build and Test
timeout-minutes: 15
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
ts-project: [src/tsconfig.json, src/tsconfig-es6.json]
env:
TS_NODE_PROJECT: ${{ matrix.ts-project }}

steps:
- name: Checkout Project
- name: Check out code
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
run: npm ci
- name: Run tests
run: npm test --coverage
- name: Store code coverage report
uses: actions/upload-artifact@v3
fetch-depth: 2

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
name: coverage
path: coverage/
node-version: 18
cache: "npm"

Build:
name: Compile source code
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
ts-project: [src/tsconfig.json, src/tsconfig-es6.json]
env:
TS_NODE_PROJECT: ${{ matrix.ts-project }}
- name: Install dependencies
run: npm install

steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm
registry-url: https://registry.npmjs.org/
- run: npm cache clean --force
- run: npm ci
- run: npm run build --if-present
- name: Lint
run: npm run lint

- name: Build
run: npm run build

Upload_Coverage_Report:
name: Upload coverage report to codecov
needs: [Testing]
- name: Test
run: npm run coverage

upload-coverage:
name: Upload Coverage
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Download Coverage report
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage/

- name: Codecov Upload
uses: codecov/codecov-action@v3
with:
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ type_definitions/**/*.js
.idea

.nyc_output
/.turbo/
28 changes: 0 additions & 28 deletions .npmignore

This file was deleted.

File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions apps/inversify/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extension": "ts",
"exit": true,
"require": ["ts-node/register", "reflect-metadata/Reflect.js"],
"retries": 3,
"spec": "test/**/*.test.ts"
}
3 changes: 0 additions & 3 deletions apps/inversify/mocha.opts

This file was deleted.

33 changes: 14 additions & 19 deletions apps/inversify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@
"istanbul": "0.4.5",
"mocha": "10.2.0",
"nyc": "15.1.0",
"publish-please": "5.5.2",
"reflect-metadata": "0.1.13",
"sinon": "16.0.0",
"ts-node": "10.9.1",
"tslint": "6.1.3",
"tsup": "^8.0.1",
"typescript": "4.4.4",
"updates": "15.0.2"
},
"engines": {},
"files": ["dist", "amd"],
"homepage": "http://inversify.io",
"jsnext:main": "es/inversify.js",
"keywords": [
"dependency injection",
"dependency inversion",
Expand All @@ -34,28 +33,24 @@
"typescript"
],
"license": "MIT",
"main": "lib/inversify.js",
"module": "es/inversify.js",
"main": "dist/inversify.js",
"module": "dist/inversify.mjs",
"name": "inversify",
"repository": {
"type": "git",
"url": "https://github.com/inversify/InversifyJS.git"
},
"scripts": {
"build": "npm run build:lib && npm run build:amd && npm run build:es && npm run build:es6",
"build:amd": "tsc -p src/tsconfig-amd.json",
"build:es": "tsc -p src/tsconfig-es.json",
"build:es6": "tsc -p src/tsconfig-es6.json",
"build:lib": "tsc -p src/tsconfig.json",
"clean": "rm -r amd es lib",
"postupdate": "git diff-files --quiet package-lock.json || npm test",
"prepublish": "npm run build && publish-please guard",
"pretest": "tslint --project .",
"publish-please": "publish-please",
"test": "nyc --reporter=lcov --require ts-node/register mocha test/**/*.test.ts --reporter spec --retries 3 --require 'node_modules/reflect-metadata/Reflect.js' --exit",
"update": "updates --update --minor && npm install"
"build": "tsup src/inversify.ts --format cjs,esm --dts && npm run build:amd",
"build:amd": "tsc -p tsconfig-amd.json",
"lint": "tslint --project .",
"test": "mocha",
"dev": "mocha --watch",
"coverage": "nyc --reporter=text npm run test",
"clean": "rm -r amd dist",
"update": "updates --update --minor && npm install",
"postupdate": "git diff-files --quiet package-lock.json || npm test"
},
"sideEffects": false,
"types": "lib/inversify.d.ts",
"types": "dist/inversify.d.ts",
"version": "6.0.2"
}
10 changes: 0 additions & 10 deletions apps/inversify/src/tsconfig-amd.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/inversify/src/tsconfig-es.json

This file was deleted.

10 changes: 0 additions & 10 deletions apps/inversify/src/tsconfig-es6.json

This file was deleted.

12 changes: 0 additions & 12 deletions apps/inversify/src/tsconfig.json

This file was deleted.

11 changes: 3 additions & 8 deletions apps/inversify/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"include": [
"./**/*.ts"
],
"references": [
{
"path": "../src"
}
],
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "."
},
}
"rootDir": ".",
"extends": "../tsconfig.json"
}
7 changes: 7 additions & 0 deletions apps/inversify/tsconfig-amd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"outDir": "amd",
"module": "amd"
},
"extends": "./tsconfig.json"
}
50 changes: 7 additions & 43 deletions apps/inversify/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,12 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"alwaysStrict": true,
"assumeChangesOnlyAffectDirectDependencies": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"exactOptionalPropertyTypes": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"importsNotUsedAsValues": "remove",
"isolatedModules": true,
"lib": [
"esnext",
"dom"
],
"lib": ["esnext", "dom"],
"module": "commonjs",
"moduleResolution": "node",
"noErrorTruncation": true,
"noFallthroughCasesInSwitch": true,
"noImplicitAny": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
"preserveConstEnums": true,
"pretty": true,
"removeComments": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": false,
"strict": true,
"target": "es5",
"types": [
"mocha",
"reflect-metadata",
"node"
]
"outDir": "dist",
"target": "es6",
"types": ["mocha", "reflect-metadata", "node"]
},
"exclude": [
"node_modules"
]
}
"extends": "../../tsconfig.json",
"include": ["src/**/*.ts"]
}
Loading

0 comments on commit 50bc950

Please sign in to comment.