Skip to content

Commit

Permalink
maybe ready?
Browse files Browse the repository at this point in the history
  • Loading branch information
barbados-clemens committed Feb 9, 2023
1 parent c24ef56 commit 6489a65
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 35 deletions.
32 changes: 19 additions & 13 deletions packages/deno/src/executors/serve/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,29 @@ function createArgs(options: ServeExecutorSchema) {
if (options.cert) {
args.push(`--cert=${options.cert}`);
}
if (options.check) {
args.push(
`--check${typeof options.check === 'string' ? `=${options.check}` : ''}`
);
if (options.check !== undefined) {
// TODO(caleb): why are boolean args being parsed as strings?
if (
options.check === 'none' ||
options.check === false ||
options.check === 'false'
) {
args.push('--no-check');
} else if (
options.check === 'local' ||
options.check === true ||
options.check === 'true'
) {
args.push('--check');
} else if (options.check === 'all') {
args.push('--check=all');
}
}
if (options.inspect) {
args.push(
`--inspect-brk${
`--inspect-brk=${
typeof options.inspect === 'string'
? `=${options.inspect}`
? `${options.inspect}`
: '127.0.0.1:9229'
}`
);
Expand All @@ -74,13 +87,6 @@ function createArgs(options: ServeExecutorSchema) {
if (options.lockWrite) {
args.push(`--lock-write`);
}
if (options.noCheck) {
args.push(
`--no-check${
typeof options.noCheck === 'string' ? `=${options.noCheck}` : ''
}`
);
}
if (options.noLock) {
args.push(`--no-lock`);
}
Expand Down
5 changes: 3 additions & 2 deletions packages/deno/src/executors/serve/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { DenoTypeCheck } from '../../utils/schema-types';

export interface ServeExecutorSchema {
buildTarget: string;
main?: string;
denoConfig?: string;
cert?: string;
check?: boolean | string;
check?: DenoTypeCheck;
inspect?: boolean | string;
location?: string;
lockWrite?: boolean;
noCheck?: string;
noLock?: boolean;
noNpm?: boolean;
noRemote?: boolean;
Expand Down
23 changes: 4 additions & 19 deletions packages/deno/src/executors/serve/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@
"description": "Load certificate authority from PEM encoded file."
},
"check": {
"anyOf": [{ "type": "boolean" }, { "type": "string" }],
"description": "Type-check modules. Deno does not type-check modules automatically from v1.23 onwards. Set this option to enable type-checking or use the 'deno check' subcommand. If the value of '--check=all' is supplied, diagonstic errors from remote modules will be included.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
]
"enum": ["none", "local", "all"],
"default": "local"
},

"inspect": {
"description": "Activate inspector on host:port, wait for debugger to connect before running user code. Defaults to 127.0.0.1:9229 if no host:port is provided",
"anyOf": [
Expand All @@ -52,17 +48,6 @@
"type": "boolean",
"description": "Force overwriting the lock file. You can configure which lock file to use in the deno.json in the project root."
},
"noCheck": {
"description": "Skip type-checking. If the value of '--no-check=remote' is supplied, diagonstic errors from remote modules will be ignored.",
"anyOf": [
{
"type": "boolean"
},
{
"type": "string"
}
]
},
"noLock": {
"type": "boolean",
"description": "Disable auto discovery of the lock file."
Expand Down
8 changes: 7 additions & 1 deletion packages/deno/src/utils/schema-types.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
export type DenoTypeCheck = boolean | 'none' | 'local' | 'all';
export type DenoTypeCheck =
| boolean
| 'none'
| 'local'
| 'all'
| 'true'
| 'false';

0 comments on commit 6489a65

Please sign in to comment.