-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this PR is missing the implementation of the flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would consider starting from main and only doing the needed changes
@@ -13,6 +12,7 @@ export const getProgram = (ctx: AppContext) => { | |||
.description("Run development server in current directory") | |||
.option("--cwd <cwd>", "Current working directory") | |||
.option("--port <port>", "Port to run dev server on") | |||
.option("--no-cleanup", "Don't delete the temporary directory", true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not default to true
@@ -24,6 +18,7 @@ export const exportPnpCsvToBuffer = async ( | |||
{ | |||
filePath: params.example_file_path, | |||
exportName: params.export_name, | |||
no_cleanup: params.no_cleanup, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesnt match naming convention
) => { | ||
const params = z.object({}).parse(args) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should revert, no reason to change this file afaik
|
||
export const devServerUpload = async (ctx: AppContext, args: any) => { | ||
const params = z | ||
.object({ | ||
dir: z.string().optional().default(ctx.cwd), | ||
port: z.coerce.number().optional().nullable().default(null), | ||
watch: z.boolean().optional().default(false), | ||
no_cleanup: z.boolean().optional().default(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not default to true
ctx: { runtime: "node" | "bun" } | ||
ctx: { | ||
runtime: "node" | "bun", | ||
args: { no_cleanup: boolean } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
args is too generic. Rename to cliArgs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also use camelCase since thats the convention from other
parts of the code (it seems)
// Mark all examples as being "reloaded" in the database | ||
await markAllExamplesLoading({ devServerAxios }) | ||
|
||
for (const exampleFileName of exampleFileNames) { | ||
if (exampleFileName.endsWith(".__tmp_entrypoint.tsx")) continue | ||
if (exampleFileName.endsWith(".__tmp_entrypoint.tsx") && !no_cleanup) continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should revert, doesnt make sense, the idea with this loop is to ignore entrypoint files, doesnt make sense to have the cleanup flag change that behavior
|
||
export const publish = async (ctx: AppContext, args: any) => { | ||
const params = z | ||
.object({ | ||
increment: z.boolean().optional(), | ||
patch: z.boolean().optional(), | ||
lock: z.boolean().optional(), | ||
no_cleanup: z.boolean().optional().default(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not be on this command. Only put on "tsci dev" command
stale |
No description provided.