Skip to content

Commit

Permalink
Update API URL and improve types in publish cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
alec-chernicki committed Jul 14, 2024
1 parent ec3e4d6 commit 8af8566
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/commonality/src/cli/commands/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
import { getRootDirectory } from '@commonalityco/data-project';
import { getCodeownersData } from '@commonalityco/data-codeowners';
import { Command } from 'commander';
import { createSnapshotSchema } from '@commonalityco/utils-core';
import {
createSnapshotSchema,
CreateSnapshotSchema as CreateSnapshotSchemaType,
} from '@commonalityco/utils-core';
import { getDependencies, getPackages } from '@commonalityco/data-packages';
import ky, { HTTPError } from 'ky';
import * as prompts from '@clack/prompts';
Expand All @@ -18,7 +21,8 @@ export const publish = command
.option(
'--api <apiUrl>',
'The API URL to publish to',
process.env.COMMONALITY_API_URL ?? 'http://app.commonality.co/api/publish',
process.env.COMMONALITY_API_URL ??
'http://app.commonality.co/api/v1/publish',
)
.requiredOption(
'--project <projectId>',
Expand Down Expand Up @@ -50,7 +54,7 @@ export const publish = command
codeowners,
blocks,
dependencies,
};
} satisfies CreateSnapshotSchemaType;

const result = createSnapshotSchema.safeParse(data);

Expand Down
2 changes: 2 additions & 0 deletions packages/utils-core/src/schemas/create-snapshot-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ export const createSnapshotSchema = z.object({
}),
),
});

export type CreateSnapshotSchema = z.infer<typeof createSnapshotSchema>;

0 comments on commit 8af8566

Please sign in to comment.