Skip to content

Commit

Permalink
Configured typescript and lint to allow build without running it on e…
Browse files Browse the repository at this point in the history
…ach package
  • Loading branch information
oskardudycz committed Feb 19, 2024
1 parent f244571 commit e47faae
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"parserOptions": {
"ecmaVersion": 2023,
"sourceType": "module",
"project": "tsconfig.json"
"project": "./tsconfig.json"
},
"rules": {
"no-unused-vars": "off",
Expand Down
1 change: 1 addition & 0 deletions docs/snippets/gettingStarted/businessLogic.unit.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
import { describe, it } from 'node:test';
import { v4 as uuid } from 'uuid';
import { decide } from './businessLogic';
Expand Down
1 change: 1 addition & 0 deletions docs/snippets/gettingStarted/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type EmptyShoppingCart = {

export type OpenedShoppingCart = {
status: 'Opened';

productItems: ProductItems;
};

Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"scripts": {
"setup": "cat .nvmrc | nvm install; nvm use",
"build": "npm run build --ws",
"build:ts": "npm run build:ts --ws",
"build:ts:watch": "npm run build:ts:watch --ws",
"build:ts": "tsc -b",
"build:ts:watch": "tsc -b --watch",
"lint": "npm run lint --ws",
"fix": "npm run fix --ws",
"test": "run-s test:unit test:int test:e2e",
Expand Down
3 changes: 2 additions & 1 deletion packages/emmett-esdb/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"composite": false
"composite": false,
"paths": {}
}
}
16 changes: 13 additions & 3 deletions packages/emmett-esdb/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"extends": "../../tsconfig.shared.json",
"include": ["./src/**/*", "./tsup.config.ts"],
"include": ["./src/**/*"],
"compilerOptions": {
"composite": true
}
"composite": true,
"outDir": "./dist" /* Redirect output structure to the directory. */,
"rootDir": "./src",
"paths": {
"@event-driven-io/emmett": ["../emmett"]
}
},
"references": [
{
"path": "../emmett/"
}
]
}
6 changes: 3 additions & 3 deletions packages/emmett-expressjs/src/etag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export const enum ETagErrors {
}

export const isWeakETag = (etag: ETag): etag is WeakETag => {
return WeakETagRegex.test(etag);
return WeakETagRegex.test(etag as string);
};

export const getWeakETagValue = (etag: ETag): string => {
const result = WeakETagRegex.exec(etag);
const result = WeakETagRegex.exec(etag as string);
if (result === null || result.length === 0) {
throw new Error(ETagErrors.WRONG_WEAK_ETAG_FORMAT);
}
Expand Down Expand Up @@ -59,5 +59,5 @@ export const getETagFromIfNotMatch = (request: Request): ETag => {
};

export const setETag = (response: Response, etag: ETag): void => {
response.setHeader(HeaderNames.ETag, etag);
response.setHeader(HeaderNames.ETag, etag as string);
};
13 changes: 10 additions & 3 deletions packages/emmett-expressjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
{
"extends": "../../tsconfig.shared.json",
"include": ["./src/**/*", "./tsup.config.ts"],
"include": ["./src/**/*"],
"compilerOptions": {
"composite": true,
"outDir": "./dist" /* Redirect output structure to the directory. */,
"rootDir": "./src",
"paths": {
"@event-driven-io/emmett": ["./packages/emmett/src"]
"@event-driven-io/emmett": ["./packages/emmett"]
}
}
},
"references": [
{
"path": "../emmett/"
}
]
}
6 changes: 4 additions & 2 deletions packages/emmett/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"extends": "../../tsconfig.shared.json",
"include": ["./src/**/*", "./tsup.config.ts"],
"include": ["./src/**/*"],
"compilerOptions": {
"composite": true
"composite": true,
"outDir": "./dist" /* Redirect output structure to the directory. */,
"rootDir": "./src"
}
}
13 changes: 11 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"extends": "./tsconfig.shared.json",
"include": ["./packages/**/*", "./packages/**/**/*", "./tsup.config.ts"],
"include": ["docs/**/*.ts", "./tsup.config.ts"],
"exclude": ["node_modules", "tmp"],
"files": [],
"compilerOptions": {
"noEmit": true /* Do not emit outputs. */
"disableSourceOfProjectReferenceRedirect": true,
"noEmit": true /* Do not emit outputs. */,
"paths": {
"@event-driven-io/emmett": ["./packages/emmett/src"],
"@event-driven-io/emmett-expressjs": ["./packages/emmett-expressjs/src"],
"@event-driven-io/emmett-eventstoredb": [
"./packages/emmett-eventstoredb/src"
]
}
},
"references": [
{
Expand Down
9 changes: 1 addition & 8 deletions tsconfig.shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"sourceMap": true /* Generates corresponding '.map' file. */,
// "outFile": "./", /* Concatenate and emit output to single file. */
"outDir": "./dist" /* Redirect output structure to the directory. */,
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
"rootDir": "./" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */,
// "composite": true, /* Enable project compilation */
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
// "removeComments": true, /* Do not emit comments to output. */
Expand Down Expand Up @@ -48,13 +48,6 @@
/* Module Resolution Options */
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
"baseUrl": "./" /* Base directory to resolve non-absolute module names. */,
"paths": {
"@event-driven-io/emmett": ["./packages/emmett/src"],
"@event-driven-io/emmett-expressjs": ["./packages/emmett-expressjs/src"],
"@event-driven-io/emmett-eventstoredb": [
"./packages/emmett-eventstoredb/src"
]
} /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
Expand Down

0 comments on commit e47faae

Please sign in to comment.