Skip to content

Commit 2021214

Browse files
author
uid10804
committed
refactor: add npm workspaces and update typescript settings
1 parent f2e6b80 commit 2021214

File tree

9 files changed

+26825
-3749
lines changed

9 files changed

+26825
-3749
lines changed

package-lock.json

Lines changed: 26804 additions & 806 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"devDependencies": {
2020
"cz-conventional-changelog": "3.3.0"
2121
},
22+
"workspaces": [
23+
"packages/*"
24+
],
2225
"config": {
2326
"commitizen": {
2427
"path": "./node_modules/cz-conventional-changelog"

packages/server/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,8 @@
8080
"commitizen": {
8181
"path": "./node_modules/cz-conventional-changelog"
8282
}
83-
}
83+
},
84+
"files": [
85+
"lib/**/*"
86+
]
8487
}

packages/server/tsconfig.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
22
"compilerOptions": {
3-
"incremental": false,
3+
"composite": true,
44
"moduleResolution": "node",
55
"module": "commonjs",
66
"target": "ES2019",
7-
"declaration": true,
87
"esModuleInterop": true,
8+
"declaration": true,
99
"declarationMap": true,
1010
"outDir": "lib",
1111
"rootDir": "./src",
12-
"composite": false,
1312
"strictPropertyInitialization": false,
1413
"noImplicitAny": false,
1514
"lib": ["es2015"],
1615
"sourceMap": false,
17-
"resolveJsonModule": true
16+
"resolveJsonModule": true,
17+
"typeRoots": ["./node_modules/@types"]
1818
},
19-
"include": ["src/**/*.ts"],
19+
"include": ["src/**/*.ts", "src/validations/requestschema.json"],
2020
"exclude": ["tests"]
2121
}

packages/server/tsconfig.tsbuildinfo

Lines changed: 1 addition & 2930 deletions
Large diffs are not rendered by default.

packages/template/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"dependencies": {
1313
"express": "4.17",
14-
"json-serverless-lib": "^1.6.16",
14+
"json-serverless-lib": "file:../server",
1515
"serverless-http": "^2.6.0"
1616
},
1717
"devDependencies": {
@@ -37,4 +37,4 @@
3737
"package.json",
3838
"package-lock.json"
3939
]
40-
}
40+
}

packages/template/serverless.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ custom:
2121
provider:
2222
stage: ${self:custom.file.stage, 'dev'}
2323
name: aws
24-
runtime: nodejs18.x
24+
runtime: nodejs16.x
2525
region: ${self:custom.region}
2626
stackName: ${self:custom.appconfig.stackName}
2727
stackTags: # Tags that will be added to each of the deployment resources
2828
jsonsls: ${self:custom.appconfig.stackName}
2929
environment:
3030
s3Bucket: ${self:custom.file.s3Bucket}
3131
s3File: ${self:custom.file.s3File}
32-
basePath: /${self:custom.file.stage}
32+
basePath: ${self:custom.file.stage}
3333
authPath: /jsonsls/${self:service}-${self:provider.stage}
3434
region: ${self:custom.region}
3535
AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1

packages/template/src/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const environment = new CloudEnvironment();
2626
const swagger = new Swagger(
2727
server,
2828
new SwaggerConfig(appConfig.readOnly, appConfig.enableApiKeyAuth),
29-
`/${config.stage}`,
29+
`/${environment.basePath}`,
3030
appConfig.routes.apiRoutePath,
3131
'./package.json',
3232
appConfig.routes.swaggerSpecRoutePath

packages/template/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
"strictPropertyInitialization": false,
1313
"noImplicitAny": false,
1414
"lib": ["es2015"],
15-
"sourceMap": false,
16-
"resolveJsonModule": true
15+
"sourceMap": true,
16+
"resolveJsonModule": true,
17+
"typeRoots": ["./node_modules/@types"]
1718
},
1819
"include": ["src/**/*"]
1920
}

0 commit comments

Comments
 (0)