Skip to content
This repository has been archived by the owner on Jan 2, 2025. It is now read-only.

Add flag #93

Closed
wants to merge 2 commits into from
Closed

Add flag #93

wants to merge 2 commits into from

Conversation

Slaviiiii
Copy link
Contributor

No description provided.

Copy link

codesandbox bot commented Jul 13, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link
Contributor

@seveibar seveibar left a 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

Copy link
Contributor

@seveibar seveibar left a 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)
Copy link
Contributor

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,
Copy link
Contributor

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)

Copy link
Contributor

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),
Copy link
Contributor

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 }
Copy link
Contributor

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

Copy link
Contributor

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
Copy link
Contributor

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),
Copy link
Contributor

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

@seveibar
Copy link
Contributor

stale

@seveibar seveibar closed this Jul 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants