Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
boneskull committed Apr 21, 2024
1 parent 9e178b9 commit 7daef13
Show file tree
Hide file tree
Showing 23 changed files with 570 additions and 403 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class PkgManager extends ReifiedComponent<PkgManagerDef> {

public async pack(
signal: AbortSignal,
opts: PackOptions = {},
opts: PackOptions,
): Promise<InstallManifest[]> {
const ctx: PkgManagerPackContext = {...this.ctx, ...opts, signal};
this._installManifests = await this.def.pack(ctx);
Expand Down
4 changes: 4 additions & 0 deletions packages/midnight-smoker/src/component/reporter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
export * from '#error/reporter-error';

export * from '#schema/reporter-def';

export * from './reporter';

export * from './reporter-def';
2 changes: 0 additions & 2 deletions packages/midnight-smoker/src/component/rule/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ export * from '#schema/rule';

export * from '#schema/rule-def';

export * from '#schema/rule-issue';

export * from '#schema/rule-options';

export * from '#schema/rule-result';
Expand Down
4 changes: 2 additions & 2 deletions packages/midnight-smoker/src/component/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export * from './rule';

export * from './rule-def';

export * from './rule-issue';

export * from './rule-options';

export * from './rule-result';
Expand All @@ -59,3 +57,5 @@ export * from './smoker-event';
export * from './static-pkg-manager-spec';

export * from './static-plugin-metadata';

export * from './workspaces';
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ import {z} from 'zod';

export const InstallManifestSchema = z
.object({
localPath: NonEmptyStringSchema.optional().describe(
'Path to local package workspace; not applicable if this is an extra dep',
),
cwd: NonEmptyStringSchema.describe('The working directory for the install'),
installPath: NonEmptyStringSchema.optional().describe(
'The path to install the package to; only applicable if spec is a tarball',
),
pkgName: NonEmptyStringSchema.describe(
'The name of the package to install',
),
pkgSpec: NonEmptyStringSchema.describe('The package spec to install'),
pkgSpec: NonEmptyStringSchema.describe(
'The package spec to install; either a tarball or a name[@version] for additional deps',
),
isAdditional: z
.boolean()
.optional()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ export type PackOptions = z.infer<typeof PackOptionsSchema>;

export const PackOptionsSchema = z
.object({
cwd: NonEmptyStringSchema.optional().describe(
'The current working directory',
),
cwd: NonEmptyStringSchema.describe('The current working directory'),
allWorkspaces: z
.boolean()
.optional()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export const PkgManagerContextSchema = z
executor: ExecutorSchema,
loose: z.boolean().optional(),
verbose: z.boolean().optional(),
workspaceInfo: z.record(NonEmptyStringSchema),
})
.passthrough();

Expand Down
8 changes: 0 additions & 8 deletions packages/midnight-smoker/src/component/schema/rule-issue.ts

This file was deleted.

13 changes: 13 additions & 0 deletions packages/midnight-smoker/src/component/schema/workspaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import {z} from 'zod';
import {NonEmptyStringArraySchema} from '../../util';

export const WorkspacesSchema = NonEmptyStringArraySchema;

export const WorkspacesConfigSchema = WorkspacesSchema.or(
z
.object({
packages: NonEmptyStringArraySchema,
})
.transform(({packages}) => packages)
.pipe(WorkspacesSchema),
);
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {type Simplify, type ValueOf} from 'type-fest';
import {type InstallerMachineOutput} from '../installer/installer-machine';
import {type LinterMachineOutput} from '../linter/linter-machine';
import {type PackerMachineOutput} from '../packer/packer-machine';
import {type ComponentReifierOutput} from '../reifier/component-reifier-machine';
import {type ReifierOutput} from '../reifier/reifier-machine';
import {type ReporterMachineOutput} from '../reporter/reporter-machine';
import {type RunnerMachineOutput} from '../runner/runner-machine';

Expand All @@ -41,7 +41,7 @@ export type CtrlEvents =
| CtrlPkgManagerPackOkEvent
| CtrlPkgManagerInstallBeginEvent
| CtrlPkgManagerPackBeginEvent
| CtrlComponentReifierDoneEvent
| CtrlReifierDoneEvent
| CtrlRunScriptsEvent
| CtrlRunScriptBeginEvent
| CtrlReporterDoneEvent
Expand Down Expand Up @@ -217,9 +217,9 @@ export interface CtrlPkgManagerPackBeginEvent extends PackOptions {
type: 'PKG_MANAGER_PACK_BEGIN';
}

export interface CtrlComponentReifierDoneEvent {
output: ComponentReifierOutput;
type: 'xstate.done.actor.ComponentReifier.*';
export interface CtrlReifierDoneEvent {
output: ReifierOutput;
type: 'xstate.done.actor.Reifier.*';
}

export interface CtrlInstallerMachineDoneEvent {
Expand Down
Loading

0 comments on commit 7daef13

Please sign in to comment.