Skip to content

Commit 79ad353

Browse files
authored
Update scrubber config for auth option (#12)
1 parent c1f59cf commit 79ad353

File tree

5 files changed

+36
-9
lines changed

5 files changed

+36
-9
lines changed

cli/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ const promptOptions = async (
227227
backend,
228228
api: options.api || answers.api,
229229
database: options.database || answers.database,
230-
auth: (options.auth || answers.auth ? "auth" : null) as AuthType,
230+
auth: (options.auth || answers.auth ? "auth" : "no-auth") as AuthType,
231231
},
232232
outputDir: options.outputDir || answers.outputDir,
233233
};

cli/optionTypes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ export type APIType = "rest" | "graphql";
44

55
export type DatabaseType = "postgresql" | "mongodb";
66

7-
export type AuthType = "auth";
7+
export type AuthType = "auth" | "no-auth";
88

99
export type Options = {
1010
backend: BackendType;
1111
api: APIType;
1212
database: DatabaseType;
13-
auth?: AuthType;
13+
auth: AuthType;
1414
};
1515

1616
export type CommandLineOptions = {

scrubber/scrubUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export function scrubFile(
4747
const line = lines[i];
4848
let tryProcessTag = true;
4949

50-
if (line.length === 0) {
50+
if (!skip && line.length === 0) {
5151
scrubbedLines.push(line);
5252
continue;
5353
}

scrubber/scrubberConfig.json

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@
99
"filesToDelete": ["backend/typescript/"]
1010
},
1111
"rest": {
12-
"tagsToKeep": ["rest"]
12+
"tagsToKeep": ["rest"],
13+
"filesToDelete": ["backend/typescript/graphql"]
1314
},
1415
"graphql": {
15-
"tagsToKeep": ["graphql"]
16+
"tagsToKeep": ["graphql"],
17+
"filesToDelete": ["backend/typescript/rest"]
1618
},
1719
"postgresql": {
1820
"tagsToKeep": ["postgresql"]
@@ -22,8 +24,28 @@
2224
},
2325
"auth": {
2426
"tagsToKeep": ["auth"]
27+
},
28+
"no-auth": {
29+
"tagsToKeep": [],
30+
"filesToDelete": [
31+
"backend/typescript/services/implementations/userService.ts",
32+
"backend/typescript/services/interfaces/userService.ts",
33+
"backend/typescript/services/implementations/authService.ts",
34+
"backend/typescript/services/interfaces/authService.ts",
35+
"backend/typescript/rest/userRoutes.ts",
36+
"backend/typescript/rest/authRoutes.ts",
37+
"backend/typescript/middlewares/auth.ts",
38+
"backend/typescript/middlewares/auth.graphql.ts",
39+
"backend/python/app/services/implementations/user_service.py",
40+
"backend/python/app/services/interfaces/user_service.py",
41+
"backend/python/app/services/implementations/auth_service.py",
42+
"backend/python/app/services/interfaces/auth_service.py",
43+
"backend/python/app/rest/user_routes.py",
44+
"backend/python/app/rest/auth_routes.py",
45+
"backend/python/app/middlewares/auth.py"
46+
]
2547
}
2648
},
2749
"dir": "starter-code-v2",
28-
"ignore": ["node_modules", ".git", "yarn.lock"]
50+
"ignore": ["node_modules", ".git", "yarn.lock", "public"]
2951
}

scrubber/scrubberTypes.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
Types required by the scrubber tool.
33
*/
44

5-
import { BackendType, APIType, DatabaseType } from "../cli/optionTypes";
5+
import {
6+
BackendType,
7+
APIType,
8+
DatabaseType,
9+
AuthType,
10+
} from "../cli/optionTypes";
611

712
export type ScrubberActionType = "remove" | "keep";
813

@@ -11,7 +16,7 @@ export type ScrubberAction = {
1116
tags: string[];
1217
};
1318

14-
export type CLIOption = BackendType | APIType | DatabaseType | "auth";
19+
export type CLIOption = BackendType | APIType | DatabaseType | AuthType;
1520

1621
export type CLIOptionActions = {
1722
[key in CLIOption]: {

0 commit comments

Comments
 (0)