@decohere/forge 0.0.1-dev.9 → 0.0.1-dev.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/commonjs/src/actions/build.action.js +9 -1
  2. package/commonjs/src/actions/clean.action.js +3 -3
  3. package/commonjs/src/actions/copy.action.js +38 -6
  4. package/commonjs/src/actions/docker.action.js +198 -0
  5. package/commonjs/src/actions/index.js +5 -1
  6. package/commonjs/src/actions/link.action.js +156 -0
  7. package/commonjs/src/actions/tag.action.js +3 -4
  8. package/commonjs/src/actions/typecheck.action.js +69 -0
  9. package/commonjs/src/actions/unlink.action.js +76 -0
  10. package/commonjs/src/actions/watch.action.js +2 -1
  11. package/commonjs/src/commands/docker.command.js +28 -0
  12. package/commonjs/src/commands/index.js +4 -1
  13. package/commonjs/src/commands/link.command.js +89 -0
  14. package/commonjs/src/commands/typecheck.command.js +26 -0
  15. package/commonjs/src/factories/swc-config.factory.js +14 -4
  16. package/commonjs/src/forge.module.js +12 -3
  17. package/commonjs/src/index.js +4 -1
  18. package/commonjs/src/mixins/caches-outputs.mixin.js +8 -6
  19. package/commonjs/src/services/swc-transpiler.js +27 -7
  20. package/commonjs/src/services/ts-program-host.js +3 -3
  21. package/commonjs/src/services/type-emission-program.js +24 -7
  22. package/commonjs/src/services/type-emitter.js +34 -4
  23. package/commonjs/src/types/swc-config.type.js +1 -1
  24. package/commonjs/src/types/transform-response.model.js +2 -1
  25. package/commonjs/src/vitest/forge-build.plugin.js +3 -2
  26. package/commonjs/src/workspace.config.js +29 -2
  27. package/es6/src/actions/build.action.js +9 -1
  28. package/es6/src/actions/clean.action.js +3 -3
  29. package/es6/src/actions/copy.action.js +38 -6
  30. package/es6/src/actions/docker.action.js +184 -0
  31. package/es6/src/actions/index.js +5 -1
  32. package/es6/src/actions/link.action.js +131 -0
  33. package/es6/src/actions/tag.action.js +3 -4
  34. package/es6/src/actions/typecheck.action.js +56 -0
  35. package/es6/src/actions/unlink.action.js +61 -0
  36. package/es6/src/actions/watch.action.js +2 -1
  37. package/es6/src/commands/docker.command.js +18 -0
  38. package/es6/src/commands/index.js +4 -1
  39. package/es6/src/commands/link.command.js +66 -0
  40. package/es6/src/commands/typecheck.command.js +16 -0
  41. package/es6/src/factories/swc-config.factory.js +14 -4
  42. package/es6/src/forge.module.js +12 -3
  43. package/es6/src/index.js +2 -2
  44. package/es6/src/mixins/caches-outputs.mixin.js +8 -6
  45. package/es6/src/services/swc-transpiler.js +27 -7
  46. package/es6/src/services/ts-program-host.js +3 -3
  47. package/es6/src/services/type-emission-program.js +24 -7
  48. package/es6/src/services/type-emitter.js +31 -4
  49. package/es6/src/types/swc-config.type.js +1 -1
  50. package/es6/src/types/transform-response.model.js +2 -1
  51. package/es6/src/vitest/forge-build.plugin.js +3 -2
  52. package/es6/src/workspace.config.js +30 -2
  53. package/package.json +5 -5
  54. package/types/src/actions/build.action.d.ts +1 -0
  55. package/types/src/actions/copy.action.d.ts +10 -0
  56. package/types/src/actions/docker.action.d.ts +33 -0
  57. package/types/src/actions/index.d.ts +4 -0
  58. package/types/src/actions/link.action.d.ts +25 -0
  59. package/types/src/actions/typecheck.action.d.ts +14 -0
  60. package/types/src/actions/unlink.action.d.ts +9 -0
  61. package/types/src/commands/docker.command.d.ts +6 -0
  62. package/types/src/commands/index.d.ts +3 -0
  63. package/types/src/commands/link.command.d.ts +28 -0
  64. package/types/src/commands/typecheck.command.d.ts +6 -0
  65. package/types/src/factories/swc-config.factory.d.ts +1 -0
  66. package/types/src/forge.module.d.ts +8 -0
  67. package/types/src/index.d.ts +1 -1
  68. package/types/src/services/swc-transpiler.d.ts +5 -2
  69. package/types/src/services/ts-program-host.d.ts +1 -1
  70. package/types/src/services/type-emission-program.d.ts +6 -1
  71. package/types/src/services/type-emitter.d.ts +14 -0
  72. package/types/src/types/swc-config.type.d.ts +5 -1
  73. package/types/src/types/transform-response.model.d.ts +2 -0
  74. package/types/src/workspace.config.d.ts +6 -0
@@ -25,6 +25,12 @@ export declare const DEFAULT_TYPE_EMITTER_OPTIONS: Readonly<ts.CompilerOptions>;
25
25
  * tsconfig specifies. Applied after the user spread so they cannot be overridden.
26
26
  */
27
27
  export declare const REQUIRED_TYPE_EMITTER_OPTIONS: Readonly<ts.CompilerOptions>;
28
+ /** Compiler options enforced for `forge typecheck` — never emit JS or declarations. */
29
+ export declare const REQUIRED_TYPE_CHECK_OPTIONS: Readonly<ts.CompilerOptions>;
30
+ export type PrepareProgramsOptions = {
31
+ includeAllProjects?: boolean;
32
+ requiredCompilerOptions?: ts.CompilerOptions;
33
+ };
28
34
  declare const TypeEmitter_base: abstract new (...args: unknown[]) => CachesOutputs & IncrementalTransform;
29
35
  export declare class TypeEmitter extends TypeEmitter_base implements Transformer {
30
36
  #private;
@@ -36,6 +42,14 @@ export declare class TypeEmitter extends TypeEmitter_base implements Transformer
36
42
  */
37
43
  init(projectArrayLike: Project[] | Project, _filter?: (project: Project) => Promise<FileEx[]>): Promise<void>;
38
44
  transformProject(projectArrayLike: Project[] | Project, filter?: (project: Project) => Promise<FileEx[]>, onOutput?: (response: TransformResponse) => void): Promise<TransformResponse[]>;
45
+ /**
46
+ * Type-check projects without emitting files. Includes every Mesh project, not
47
+ * only those with a `types` build target (debug is es6-only).
48
+ */
49
+ checkProject(projectArrayLike: Project[] | Project): Promise<{
50
+ diagnostics: ts.Diagnostic[];
51
+ formatted: string;
52
+ }>;
39
53
  private preparePrograms;
40
54
  protected onIncrementalFileEvent(evt: ProjectFileEvent): Promise<TransformResponse[]>;
41
55
  private invalidateReadFileCache;
@@ -1,8 +1,12 @@
1
- import type { Tsconfig } from "@decohere/mesh";
1
+ import type { Project, Tsconfig, Workspace } from "@decohere/mesh";
2
2
  export type SwcConfigOptions = {
3
3
  aliasPaths?: boolean;
4
4
  tsConfig?: Tsconfig;
5
5
  userConfig?: SwcConfig;
6
+ /** When set, convention aliases come from the full workspace package list. */
7
+ workspace?: Workspace;
8
+ /** Fallback package list when `workspace` is not set (e.g. a transform batch). */
9
+ projects?: readonly Project[];
6
10
  };
7
11
  export declare class SwcConfig {
8
12
  constructor(data?: Partial<SwcConfig>);
@@ -19,6 +19,7 @@ type TransformResponseBase = {
19
19
  type TransformSuccess = TransformResponseBase & {
20
20
  outcome: "success";
21
21
  code: string;
22
+ sourceContent?: string;
22
23
  messages?: string[];
23
24
  target: BuildTarget;
24
25
  fileName: string;
@@ -44,6 +45,7 @@ export declare class TransformResponse {
44
45
  readonly outcome: TransformOutcome;
45
46
  readonly target?: BuildTarget;
46
47
  readonly code: string;
48
+ readonly sourceContent?: string;
47
49
  readonly fileName?: string;
48
50
  readonly messages?: string[];
49
51
  readonly config: unknown;
@@ -2,5 +2,11 @@ import type { ForgeConfiguration } from "./types/configuration.type.js";
2
2
  import type { WorkspaceOptions } from "./types/workspace-config.type.js";
3
3
  export declare const Debug: ForgeConfiguration;
4
4
  export declare const Release: ForgeConfiguration;
5
+ /**
6
+ * Link configuration: unpacked JS + co-located type declarations.
7
+ * Intended for `forge link` — symlinked into a consumer's node_modules so that
8
+ * both runtime resolution and TypeScript find the same output directory.
9
+ */
10
+ export declare const Link: ForgeConfiguration;
5
11
  export declare const DefaultConfigurations: ForgeConfiguration[];
6
12
  export declare const WorkspaceDefaults: WorkspaceOptions;