Skip to content

Commit bd00a90

Browse files
committed
refactor: use sub-packages
1 parent eeb57bb commit bd00a90

File tree

92 files changed

+1919
-3907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+1919
-3907
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ jspm_packages/
6868
dist
6969
dist-test
7070
out
71+
tsconfig.tsbuildinfo
7172

7273
# Azure Functions artifacts
7374
bin

.vscode/launch.json

+25-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,36 @@
99
"preLaunchTask": "func: host start"
1010
},
1111
{
12-
"name": "Unit test current file",
12+
"name": "[ajv-openapi-request-response-validator] Unit test current file",
1313
"type": "node",
1414
"request": "launch",
15+
"cwd": "${workspaceFolder}/packages/ajv-openapi-request-response-validator",
1516
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
16-
"args": ["${relativeFile}", "--config", "${workspaceFolder}/jest.config.js", "--testTimeout", "300000", "--no-cache", "--runInBand", "--detectOpenHandles"],
17+
"args": ["${relativeFile}", "--config", "./jest.debug.config.js", "--testTimeout", "300000", "--no-cache", "--runInBand", "--detectOpenHandles"],
1718
"internalConsoleOptions": "openOnSessionStart",
1819
"sourceMaps": true,
19-
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
20+
"outFiles": ["./dist/**/*.js"],
21+
"outputCapture": "std",
22+
"smartStep": true,
23+
"skipFiles": [
24+
"<node_internals>/**",
25+
"node_modules/**"
26+
],
27+
"resolveSourceMapLocations": [
28+
"${workspaceFolder}/**",
29+
"!**/node_modules/**"
30+
]
31+
},
32+
{
33+
"name": "[azure-functions-openapi-validator] Unit test current file",
34+
"type": "node",
35+
"request": "launch",
36+
"cwd": "${workspaceFolder}/packages/azure-functions-openapi-validator",
37+
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
38+
"args": ["${relativeFile}", "--config", "./jest.debug.config.js", "--testTimeout", "300000", "--no-cache", "--runInBand", "--detectOpenHandles"],
39+
"internalConsoleOptions": "openOnSessionStart",
40+
"sourceMaps": true,
41+
"outFiles": ["./dist/**/*.js"],
2042
"outputCapture": "std",
2143
"smartStep": true,
2244
"skipFiles": [

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"[json]": {
2828
"editor.formatOnSave": true
2929
},
30-
"eslint.workingDirectories": ["example", "src", "test"],
30+
"eslint.workingDirectories": ["packages/*/"],
3131
"eslint.options": {
3232
"resolvePluginsRelativeTo": "."
3333
},

.vscode/tasks.json

+3-38
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"isBackground": true,
1010
"dependsOn": "npm build (functions)",
1111
"options": {
12-
"cwd": "${workspaceFolder}/example"
12+
"cwd": "${workspaceFolder}/packages/azure-functions-openapi-validator-example"
1313
},
1414
"presentation": {
1515
"reveal": "always",
@@ -20,40 +20,9 @@
2020
{
2121
"type": "shell",
2222
"label": "npm build (functions)",
23-
"command": "npm run build",
23+
"command": "npm run build -ws",
2424
"dependsOn": "npm clean (functions)",
2525
"problemMatcher": "$tsc",
26-
"options": {
27-
"cwd": "${workspaceFolder}/example"
28-
},
29-
"presentation": {
30-
"reveal": "silent",
31-
"revealProblems": "onProblem",
32-
"close": true
33-
}
34-
},
35-
{
36-
"type": "shell",
37-
"label": "npm install (functions)",
38-
"command": "npm install",
39-
"options": {
40-
"cwd": "${workspaceFolder}/example"
41-
},
42-
"presentation": {
43-
"reveal": "silent",
44-
"revealProblems": "onProblem",
45-
"close": true
46-
}
47-
},
48-
{
49-
"type": "shell",
50-
"label": "npm prune (functions)",
51-
"command": "npm prune --production",
52-
"dependsOn": "npm build (functions)",
53-
"problemMatcher": [],
54-
"options": {
55-
"cwd": "${workspaceFolder}/example"
56-
},
5726
"presentation": {
5827
"reveal": "silent",
5928
"revealProblems": "onProblem",
@@ -63,11 +32,7 @@
6332
{
6433
"type": "shell",
6534
"label": "npm clean (functions)",
66-
"command": "npm run clean",
67-
"dependsOn": "npm install (functions)",
68-
"options": {
69-
"cwd": "${workspaceFolder}/example"
70-
},
35+
"command": "npm run clean -ws",
7136
"presentation": {
7237
"reveal": "silent",
7338
"revealProblems": "onProblem",
File renamed without changes.

jest.config.js renamed to config/jest.config.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ const jestConfig = {
99
},
1010
collectCoverage: true,
1111
coverageReporters: ['lcov', 'text-summary'],
12-
coveragePathIgnorePatterns: [
13-
'<rootDir>/node_modules/',
14-
'<rootDir>/test',
15-
'<rootDir>/dist',
16-
'<rootDir>/dist-test',
17-
],
12+
coveragePathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/test', '<rootDir>/dist', '<rootDir>/deploy'],
1813
collectCoverageFrom: ['<rootDir>/src/**/*.{ts,tsx}'],
19-
testMatch: ['**/test/**/*.spec.ts']
14+
testMatch: ['**/test/**/*.spec.ts'],
15+
moduleNameMapper: {
16+
'@restfulhead/ajv-openapi-request-response-validator/(.*)': '<rootDir>/../ajv-openapi-request-response-validator/dist/$1',
17+
},
18+
silent: true,
19+
testTimeout: 10000,
2020
}
2121
module.exports = {
2222
...tsPreset,

config/jest.debug.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const sharedConfig = require('./jest.config')
2+
module.exports = {
3+
...sharedConfig,
4+
collectCoverage: false,
5+
silent: false,
6+
}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
{
22
"compilerOptions": {
3+
"composite": true,
34
"module": "commonjs",
45
"target": "es6",
56
"strict": true,
67
"noUnusedLocals": true,
78
"noImplicitReturns": true,
89
"noImplicitAny": true,
910
"forceConsistentCasingInFileNames": true,
10-
"outDir": "out",
1111
"sourceMap": true,
12-
"baseUrl": "./",
1312
},
14-
"include": [
15-
"src/**/*.ts"
13+
"exclude": [
14+
"node_modules"
1615
],
1716
}

0 commit comments

Comments
 (0)