@baeta/generator-sdk 0.0.4 → 0.0.5
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.
- package/CHANGELOG.md +8 -0
- package/dist/index.cjs +4 -2
- package/dist/index.d.ts +14 -3
- package/dist/index.js +4 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @baeta/generator-sdk
|
|
2
2
|
|
|
3
|
+
## 0.0.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#40](https://github.com/andreisergiu98/baeta/pull/40) [`9f937f4`](https://github.com/andreisergiu98/baeta/commit/9f937f47d3464a082680047414ee13a76cf6c056) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - avoid rewriting persisted files
|
|
8
|
+
|
|
9
|
+
- [#40](https://github.com/andreisergiu98/baeta/pull/40) [`9f937f4`](https://github.com/andreisergiu98/baeta/commit/9f937f47d3464a082680047414ee13a76cf6c056) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - normalize config
|
|
10
|
+
|
|
3
11
|
## 0.0.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -67,11 +67,13 @@ var FileManager = (_class2 = class {constructor() { _class2.prototype.__init4.ca
|
|
|
67
67
|
this.files = this.files.filter((file) => file.tag !== tag);
|
|
68
68
|
}
|
|
69
69
|
writeAll() {
|
|
70
|
-
|
|
70
|
+
const toWrite = this.files.filter((file) => !file.persisted);
|
|
71
|
+
return Promise.all(toWrite.map((file) => file.write()));
|
|
71
72
|
}
|
|
72
73
|
writeByTag(tag) {
|
|
73
74
|
const files = this.getByTag(tag);
|
|
74
|
-
|
|
75
|
+
const toWrite = files.filter((file) => !file.persisted);
|
|
76
|
+
return Promise.all(toWrite.map((file) => file.write()));
|
|
75
77
|
}
|
|
76
78
|
unlinkAll() {
|
|
77
79
|
return Promise.all(this.files.map((file) => file.unlink())).then(() => {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PluginType } from '@baeta/plugin';
|
|
2
2
|
|
|
3
3
|
interface GeneratorOptions {
|
|
4
|
+
cwd?: string;
|
|
4
5
|
schemas: string[];
|
|
5
6
|
modulesDir?: string;
|
|
6
7
|
moduleDefinitionName?: string;
|
|
@@ -9,6 +10,16 @@ interface GeneratorOptions {
|
|
|
9
10
|
extensions?: string;
|
|
10
11
|
scalars?: Record<string, string>;
|
|
11
12
|
}
|
|
13
|
+
interface NormalizedGeneratorOptions {
|
|
14
|
+
cwd: string;
|
|
15
|
+
schemas: string[];
|
|
16
|
+
modulesDir: string;
|
|
17
|
+
moduleDefinitionName: string;
|
|
18
|
+
baseTypesPath: string;
|
|
19
|
+
contextType?: string;
|
|
20
|
+
extensions?: string;
|
|
21
|
+
scalars?: Record<string, string>;
|
|
22
|
+
}
|
|
12
23
|
|
|
13
24
|
declare class File {
|
|
14
25
|
filename: string;
|
|
@@ -43,7 +54,7 @@ type Ctx<T = unknown> = {
|
|
|
43
54
|
didGenerate: string[];
|
|
44
55
|
didEnd: string[];
|
|
45
56
|
pluginNames: string[];
|
|
46
|
-
generatorOptions:
|
|
57
|
+
generatorOptions: NormalizedGeneratorOptions;
|
|
47
58
|
watching: boolean;
|
|
48
59
|
changedFile?: string;
|
|
49
60
|
} & T;
|
|
@@ -54,7 +65,7 @@ declare enum GeneratorPluginVersion {
|
|
|
54
65
|
V1 = 0
|
|
55
66
|
}
|
|
56
67
|
type GeneratorPluginV1Fn<Store = unknown> = (ctx: Ctx<Store>, next: () => Promise<void>) => Promise<void>;
|
|
57
|
-
type GeneratorPluginV1WatchOptions = (options:
|
|
68
|
+
type GeneratorPluginV1WatchOptions = (options: NormalizedGeneratorOptions) => {
|
|
58
69
|
include: string | string[];
|
|
59
70
|
ignore: Matcher;
|
|
60
71
|
};
|
|
@@ -84,4 +95,4 @@ declare function getGeneratorPlugins(plugins?: Array<{
|
|
|
84
95
|
type: PluginType;
|
|
85
96
|
}>): GeneratorPluginV1<unknown>[];
|
|
86
97
|
|
|
87
|
-
export { Ctx, File, FileManager, GeneratorOptions, GeneratorPluginV1, GeneratorPluginV1Factory, GeneratorPluginV1Fn, GeneratorPluginV1WatchOptions, GeneratorPluginVersion, createPluginV1, getGeneratorPlugins, isGeneratorPlugin };
|
|
98
|
+
export { Ctx, File, FileManager, GeneratorOptions, GeneratorPluginV1, GeneratorPluginV1Factory, GeneratorPluginV1Fn, GeneratorPluginV1WatchOptions, GeneratorPluginVersion, NormalizedGeneratorOptions, createPluginV1, getGeneratorPlugins, isGeneratorPlugin };
|
package/dist/index.js
CHANGED
|
@@ -67,11 +67,13 @@ var FileManager = class {
|
|
|
67
67
|
this.files = this.files.filter((file) => file.tag !== tag);
|
|
68
68
|
}
|
|
69
69
|
writeAll() {
|
|
70
|
-
|
|
70
|
+
const toWrite = this.files.filter((file) => !file.persisted);
|
|
71
|
+
return Promise.all(toWrite.map((file) => file.write()));
|
|
71
72
|
}
|
|
72
73
|
writeByTag(tag) {
|
|
73
74
|
const files = this.getByTag(tag);
|
|
74
|
-
|
|
75
|
+
const toWrite = files.filter((file) => !file.persisted);
|
|
76
|
+
return Promise.all(toWrite.map((file) => file.write()));
|
|
75
77
|
}
|
|
76
78
|
unlinkAll() {
|
|
77
79
|
return Promise.all(this.files.map((file) => file.unlink())).then(() => {
|