@postxl/generator 1.1.1 → 1.2.0

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.
@@ -31,18 +31,18 @@
31
31
  * - `ImportPaths`: FilePath | PackageName
32
32
  */
33
33
  import z from 'zod';
34
- declare const zGeneratorInterfaceId: z.ZodBranded<z.ZodString, "PXL.GeneratorInterfaceId">;
34
+ declare const zGeneratorInterfaceId: z.core.$ZodBranded<z.ZodString, "PXL.GeneratorInterfaceId", "out">;
35
35
  /**
36
36
  * A generator interface id that is used identify what interface a generator implements.
37
37
  */
38
38
  export type GeneratorInterfaceId = z.infer<typeof zGeneratorInterfaceId>;
39
- export declare const toGeneratorInterfaceId: (input: string) => string & z.BRAND<"PXL.GeneratorInterfaceId">;
40
- declare const zTypeName: z.ZodBranded<z.ZodBranded<z.ZodString, "PXL.TypeName">, "PXL.Importable">;
39
+ export declare const toGeneratorInterfaceId: (input: string) => string & z.core.$brand<"PXL.GeneratorInterfaceId">;
40
+ declare const zTypeName: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "PXL.TypeName", "out">, "PXL.Importable", "out">;
41
41
  /**
42
42
  * A type name that is used to refer to a type in the generated code.
43
43
  */
44
44
  export type TypeName = z.infer<typeof zTypeName>;
45
- export declare const toTypeName: (input: string) => string & z.BRAND<"PXL.TypeName"> & z.BRAND<"PXL.Importable">;
45
+ export declare const toTypeName: (input: string) => string & z.core.$brand<"PXL.TypeName"> & z.core.$brand<"PXL.Importable">;
46
46
  /**
47
47
  * A TypeName that is annotated with the kind of the type.
48
48
  * Note: This is used when distinguishing between kinds is required at runtime.
@@ -59,80 +59,80 @@ export declare const toAnnotatedTypeName: (name: TypeName) => AnnotatedTypeName;
59
59
  * Type guard to check if a given type is an AnnotatedTypeName.
60
60
  */
61
61
  export declare const isAnnotatedTypeName: (t: string | AnnotatedTypeName) => t is AnnotatedTypeName;
62
- declare const zFunctionName: z.ZodBranded<z.ZodBranded<z.ZodString, "PXL.FunctionName">, "PXL.Importable">;
62
+ declare const zFunctionName: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "PXL.FunctionName", "out">, "PXL.Importable", "out">;
63
63
  /**
64
64
  * A function name that is used to refer to a function in the generated code.
65
65
  */
66
66
  export type FunctionName = z.infer<typeof zFunctionName>;
67
- export declare const toFunctionName: (input: string) => string & z.BRAND<"PXL.FunctionName"> & z.BRAND<"PXL.Importable">;
68
- declare const zVariableName: z.ZodBranded<z.ZodBranded<z.ZodString, "PXL.VariableName">, "PXL.Importable">;
67
+ export declare const toFunctionName: (input: string) => string & z.core.$brand<"PXL.FunctionName"> & z.core.$brand<"PXL.Importable">;
68
+ declare const zVariableName: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "PXL.VariableName", "out">, "PXL.Importable", "out">;
69
69
  /**
70
70
  * A variable name that is used to refer to a variable in the generated code.
71
71
  */
72
72
  export type VariableName = z.infer<typeof zVariableName>;
73
- export declare const toVariableName: (input: string) => string & z.BRAND<"PXL.VariableName"> & z.BRAND<"PXL.Importable">;
74
- declare const zPostXlPackageName: z.ZodBranded<z.ZodEffects<z.ZodString, string, string>, "PXL.PackageName">;
73
+ export declare const toVariableName: (input: string) => string & z.core.$brand<"PXL.VariableName"> & z.core.$brand<"PXL.Importable">;
74
+ declare const zPostXlPackageName: z.core.$ZodBranded<z.ZodString, "PXL.PackageName", "out">;
75
75
  /**
76
76
  * A package name that is used to refer to a package in the generated code.
77
77
  */
78
- export declare const toPostXlPackageName: (input: string) => string & z.BRAND<"PXL.PackageName">;
79
- export declare const toPackageName: (input: string) => string & z.BRAND<"PXL.PackageName">;
78
+ export declare const toPostXlPackageName: (input: string) => string & z.core.$brand<"PXL.PackageName">;
79
+ export declare const toPackageName: (input: string) => string & z.core.$brand<"PXL.PackageName">;
80
80
  /**
81
81
  * A package name that is used to refer to a package name that is provided via
82
82
  * in package.json or is a NodeJS module.
83
83
  * E.g. "fs", "random", "@nestjs/common".
84
84
  */
85
85
  export type PackageName = z.infer<typeof zPostXlPackageName>;
86
- declare const zClassName: z.ZodBranded<z.ZodBranded<z.ZodString, "PXL.ClassName">, "PXL.Importable">;
86
+ declare const zClassName: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "PXL.ClassName", "out">, "PXL.Importable", "out">;
87
87
  /**
88
88
  * A class name that is used to refer to a class in the generated code.
89
89
  */
90
90
  export type ClassName = z.infer<typeof zClassName>;
91
- export declare const toClassName: (input: string) => string & z.BRAND<"PXL.ClassName"> & z.BRAND<"PXL.Importable">;
92
- declare const zConstantName: z.ZodBranded<z.ZodBranded<z.ZodString, "PXL.ConstantName">, "PXL.Importable">;
91
+ export declare const toClassName: (input: string) => string & z.core.$brand<"PXL.ClassName"> & z.core.$brand<"PXL.Importable">;
92
+ declare const zConstantName: z.core.$ZodBranded<z.core.$ZodBranded<z.ZodString, "PXL.ConstantName", "out">, "PXL.Importable", "out">;
93
93
  /**
94
94
  * A constant name that is used to refer to a constant in the generated code.
95
95
  */
96
96
  export type ConstantName = z.infer<typeof zConstantName>;
97
- export declare const toConstantName: (input: string) => string & z.BRAND<"PXL.ConstantName"> & z.BRAND<"PXL.Importable">;
98
- declare const zConstantValue: z.ZodBranded<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "PXL.ConstantValue">;
97
+ export declare const toConstantName: (input: string) => string & z.core.$brand<"PXL.ConstantName"> & z.core.$brand<"PXL.Importable">;
98
+ declare const zConstantValue: z.core.$ZodBranded<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "PXL.ConstantValue", "out">;
99
99
  /**
100
100
  * A constant value that is used in the generated code.
101
101
  */
102
102
  export type ConstantValue = z.infer<typeof zConstantValue>;
103
- export declare const toConstantValue: (input: string | number | boolean | null) => (string | number | boolean | null) & z.BRAND<"PXL.ConstantValue">;
104
- declare const zDiscriminantValue: z.ZodBranded<z.ZodString, "PXL.DiscriminantValue">;
103
+ export declare const toConstantValue: (input: string | number | boolean | null) => (string & z.core.$brand<"PXL.ConstantValue">) | (number & z.core.$brand<"PXL.ConstantValue">) | (false & z.core.$brand<"PXL.ConstantValue">) | (true & z.core.$brand<"PXL.ConstantValue">);
104
+ declare const zDiscriminantValue: z.core.$ZodBranded<z.ZodString, "PXL.DiscriminantValue", "out">;
105
105
  /**
106
106
  * A discriminant value, used to discriminate union types.
107
107
  */
108
108
  export type DiscriminantValue = z.infer<typeof zDiscriminantValue>;
109
- export declare const toDiscriminantValue: (input: string) => string & z.BRAND<"PXL.DiscriminantValue">;
110
- declare const zFileName: z.ZodBranded<z.ZodString, "PXL.FileName">;
109
+ export declare const toDiscriminantValue: (input: string) => string & z.core.$brand<"PXL.DiscriminantValue">;
110
+ declare const zFileName: z.core.$ZodBranded<z.ZodString, "PXL.FileName", "out">;
111
111
  /**
112
112
  * A file name that is used to refer to a file in the generated code.
113
113
  */
114
114
  export type FileName = z.infer<typeof zFileName>;
115
- export declare const toFileName: (input: string) => string & z.BRAND<"PXL.FileName">;
116
- declare const zFolderName: z.ZodBranded<z.ZodString, "PXL.FolderName">;
115
+ export declare const toFileName: (input: string) => string & z.core.$brand<"PXL.FileName">;
116
+ declare const zFolderName: z.core.$ZodBranded<z.ZodString, "PXL.FolderName", "out">;
117
117
  /**
118
118
  * A folder name that is used to refer to a folder in the generated code.
119
119
  */
120
120
  export type FolderName = z.infer<typeof zFolderName>;
121
- export declare const toFolderName: (input: string) => string & z.BRAND<"PXL.FolderName">;
122
- declare const zFilePath: z.ZodBranded<z.ZodString, "PXL.FilePath">;
121
+ export declare const toFolderName: (input: string) => string & z.core.$brand<"PXL.FolderName">;
122
+ declare const zFilePath: z.core.$ZodBranded<z.ZodString, "PXL.FilePath", "out">;
123
123
  /**
124
124
  * A file path that is used to refer to a file in the generated code.
125
125
  */
126
126
  export type FilePath = z.infer<typeof zFilePath>;
127
- export declare const toFilePath: (input: string) => string & z.BRAND<"PXL.FilePath">;
128
- declare const zBackendModuleName: z.ZodBranded<z.ZodString, "PXL.BackendModuleName">;
127
+ export declare const toFilePath: (input: string) => string & z.core.$brand<"PXL.FilePath">;
128
+ declare const zBackendModuleName: z.core.$ZodBranded<z.ZodString, "PXL.BackendModuleName", "out">;
129
129
  /**
130
130
  * A backend module name that is used to refer to a module in the backend.
131
131
  * E.g. `@actions`.
132
132
  */
133
133
  export type BackendModuleName = z.infer<typeof zBackendModuleName>;
134
- export declare const toBackendModuleName: (input: string) => string & z.BRAND<"PXL.BackendModuleName">;
135
- declare const zBackendModuleLocation: z.ZodBranded<z.ZodString, "PXL.BackendModuleLocation">;
134
+ export declare const toBackendModuleName: (input: string) => string & z.core.$brand<"PXL.BackendModuleName">;
135
+ declare const zBackendModuleLocation: z.core.$ZodBranded<z.ZodString, "PXL.BackendModuleLocation", "out">;
136
136
  /**
137
137
  * A module location is a reference to a file in a locale backend module.
138
138
  * E.g. `@actions/actions.types`.
@@ -143,7 +143,7 @@ declare const zBackendModuleLocation: z.ZodBranded<z.ZodString, "PXL.BackendModu
143
143
  * Therefore, we need to reference the actual file together with the package name.
144
144
  */
145
145
  export type BackendModuleLocation = z.infer<typeof zBackendModuleLocation>;
146
- export declare const toBackendModuleLocation: (input: `@${string}`) => string & z.BRAND<"PXL.BackendModuleLocation">;
146
+ export declare const toBackendModuleLocation: (input: `@${string}`) => string & z.core.$brand<"PXL.BackendModuleLocation">;
147
147
  export type ImportableTypes = TypeName | FunctionName | ClassName | ConstantName | AnnotatedTypeName;
148
148
  export type ImportPaths = FilePath | PackageName | BackendModuleLocation;
149
149
  export {};
@@ -64,7 +64,9 @@ const toVariableName = (input) => zVariableName.parse(input);
64
64
  exports.toVariableName = toVariableName;
65
65
  const zPostXlPackageName = zod_1.default
66
66
  .string()
67
- .refine((name) => name.startsWith('@postxl/'), (name) => ({ message: `Package name must start with "@postxl/", got "${name}"!` }))
67
+ .refine((name) => name.startsWith('@postxl/'), {
68
+ error: (issue) => `Package name must start with "@postxl/", got "${issue.input}"!`,
69
+ })
68
70
  .brand('PXL.PackageName');
69
71
  /**
70
72
  * A package name that is used to refer to a package in the generated code.
@@ -1,5 +1,5 @@
1
1
  import z from 'zod';
2
- export declare const zChecksum: z.ZodBranded<z.ZodString, "PXL.Checksum">;
2
+ export declare const zChecksum: z.core.$ZodBranded<z.ZodString, "PXL.Checksum", "out">;
3
3
  /**
4
4
  * Branded Id type that should be used to identify checksum strings.
5
5
  */
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { VirtualFileSystem } from './vfs.class';
3
- declare const zLockFile: z.ZodEffects<z.ZodRecord<z.ZodBranded<z.ZodString, "PXL.PosixPath">, z.ZodBranded<z.ZodString, "PXL.Checksum">>, Map<string & z.BRAND<"PXL.PosixPath">, string & z.BRAND<"PXL.Checksum">>, Record<string, string>>;
3
+ declare const zLockFile: z.ZodPipe<z.ZodRecord<z.core.$ZodBranded<z.ZodString, "PXL.PosixPath", "out">, z.core.$ZodBranded<z.ZodString, "PXL.Checksum", "out">>, z.ZodTransform<Map<string & z.core.$brand<"PXL.PosixPath">, string & z.core.$brand<"PXL.Checksum">>, Record<string & z.core.$brand<"PXL.PosixPath">, string & z.core.$brand<"PXL.Checksum">>>>;
4
4
  type LockFile = z.infer<typeof zLockFile>;
5
5
  export declare function writeLockFile(lockFilePath: string, vfs: VirtualFileSystem): Promise<void>;
6
6
  export declare function readLockFile(lockFilePath: string): Promise<LockFile | undefined>;
@@ -1,10 +1,10 @@
1
1
  import { z } from 'zod';
2
- export declare const zPosixPath: z.ZodBranded<z.ZodString, "PXL.PosixPath">;
2
+ export declare const zPosixPath: z.core.$ZodBranded<z.ZodString, "PXL.PosixPath", "out">;
3
3
  /**
4
4
  * A path string that has been normalized to use the unix path separator.
5
5
  */
6
6
  export type PosixPath = z.infer<typeof zPosixPath>;
7
- export declare const POSIX_ROOT: string & z.BRAND<"PXL.PosixPath">;
7
+ export declare const POSIX_ROOT: string & z.core.$brand<"PXL.PosixPath">;
8
8
  /**
9
9
  * Normalizes a unix or Windows path to use the unix path separator. Additionally,
10
10
  * it normalizes the path so that every path is considered absolute.
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- export declare const zTypescript: z.ZodBranded<z.ZodString, "PXL.Typescript">;
2
+ export declare const zTypescript: z.core.$ZodBranded<z.ZodString, "PXL.Typescript", "out">;
3
3
  export type Typescript = z.infer<typeof zTypescript>;
4
- export declare function ts(input: string): string & z.BRAND<"PXL.Typescript">;
4
+ export declare function ts(input: string): string & z.core.$brand<"PXL.Typescript">;
5
5
  export declare function trimLines(input: string): string;
6
6
  /**
7
7
  * Removes leading and trailing newlines from the input string.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postxl/generator",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Core package that orchestrates the code generation of a PXL project",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -46,8 +46,8 @@
46
46
  "jszip": "3.10.1",
47
47
  "minimatch": "^10.1.1",
48
48
  "p-limit": "3.1.0",
49
- "@postxl/schema": "^1.1.1",
50
- "@postxl/utils": "^1.1.0"
49
+ "@postxl/schema": "^1.2.0",
50
+ "@postxl/utils": "^1.2.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/diff": "8.0.0"