@baeta/generator-sdk 0.0.5 → 0.0.6

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @baeta/generator-sdk
2
2
 
3
+ ## 0.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#47](https://github.com/andreisergiu98/baeta/pull/47) [`eb7096d`](https://github.com/andreisergiu98/baeta/commit/eb7096d42a53b17bae0a8365eccb795e7ded02e9) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - update dependencies
8
+
9
+ - [#43](https://github.com/andreisergiu98/baeta/pull/43) [`670501b`](https://github.com/andreisergiu98/baeta/commit/670501b2b1cfb1126be3421293b8ccd597c6ffc2) Thanks [@andreisergiu98](https://github.com/andreisergiu98)! - bump dependencies
10
+
11
+ - Updated dependencies [[`eb7096d`](https://github.com/andreisergiu98/baeta/commit/eb7096d42a53b17bae0a8365eccb795e7ded02e9), [`670501b`](https://github.com/andreisergiu98/baeta/commit/670501b2b1cfb1126be3421293b8ccd597c6ffc2)]:
12
+ - @baeta/plugin@0.0.18
13
+
3
14
  ## 0.0.5
4
15
 
5
16
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -81,10 +81,22 @@ var FileManager = (_class2 = class {constructor() { _class2.prototype.__init4.ca
81
81
  }
82
82
  }, _class2);
83
83
 
84
+ // lib/module.ts
85
+ var _changecaseall = require('change-case-all');
86
+ function getModuleGetName(name) {
87
+ return `get${_changecaseall.pascalCase.call(void 0, name)}Module`;
88
+ }
89
+ function getModuleCreateName(name) {
90
+ return `create${_changecaseall.pascalCase.call(void 0, name)}Module`;
91
+ }
92
+ function getModuleVariableName(name) {
93
+ return _changecaseall.camelCase.call(void 0, `${name}Module`);
94
+ }
95
+
84
96
  // lib/plugin.ts
85
97
  var _plugin = require('@baeta/plugin');
86
98
  var GeneratorPluginVersion = /* @__PURE__ */ ((GeneratorPluginVersion2) => {
87
- GeneratorPluginVersion2[GeneratorPluginVersion2["V1"] = 0] = "V1";
99
+ GeneratorPluginVersion2["V1"] = "v1";
88
100
  return GeneratorPluginVersion2;
89
101
  })(GeneratorPluginVersion || {});
90
102
  var defaultPluginFn = async (ctx, next) => {
@@ -95,7 +107,7 @@ function createPluginV1(options) {
95
107
  return {
96
108
  name: options.name,
97
109
  actionName: options.actionName,
98
- version: 0 /* V1 */,
110
+ version: "v1" /* V1 */,
99
111
  type: _plugin.PluginType.Generator,
100
112
  end: _nullishCoalesce(options.end, () => ( defaultPluginFn)),
101
113
  generate: _nullishCoalesce(options.generate, () => ( defaultPluginFn)),
@@ -119,4 +131,7 @@ function getGeneratorPlugins(plugins) {
119
131
 
120
132
 
121
133
 
122
- exports.File = File; exports.FileManager = FileManager; exports.GeneratorPluginVersion = GeneratorPluginVersion; exports.createPluginV1 = createPluginV1; exports.getGeneratorPlugins = getGeneratorPlugins; exports.isGeneratorPlugin = isGeneratorPlugin;
134
+
135
+
136
+
137
+ exports.File = File; exports.FileManager = FileManager; exports.GeneratorPluginVersion = GeneratorPluginVersion; exports.createPluginV1 = createPluginV1; exports.getGeneratorPlugins = getGeneratorPlugins; exports.getModuleCreateName = getModuleCreateName; exports.getModuleGetName = getModuleGetName; exports.getModuleVariableName = getModuleVariableName; exports.isGeneratorPlugin = isGeneratorPlugin;
package/dist/index.d.ts CHANGED
@@ -59,10 +59,14 @@ type Ctx<T = unknown> = {
59
59
  changedFile?: string;
60
60
  } & T;
61
61
 
62
+ declare function getModuleGetName(name: string): string;
63
+ declare function getModuleCreateName(name: string): string;
64
+ declare function getModuleVariableName(name: string): string;
65
+
62
66
  type MatchPattern = string | RegExp;
63
67
  type Matcher = MatchPattern | MatchPattern[];
64
68
  declare enum GeneratorPluginVersion {
65
- V1 = 0
69
+ V1 = "v1"
66
70
  }
67
71
  type GeneratorPluginV1Fn<Store = unknown> = (ctx: Ctx<Store>, next: () => Promise<void>) => Promise<void>;
68
72
  type GeneratorPluginV1WatchOptions = (options: NormalizedGeneratorOptions) => {
@@ -95,4 +99,4 @@ declare function getGeneratorPlugins(plugins?: Array<{
95
99
  type: PluginType;
96
100
  }>): GeneratorPluginV1<unknown>[];
97
101
 
98
- export { Ctx, File, FileManager, GeneratorOptions, GeneratorPluginV1, GeneratorPluginV1Factory, GeneratorPluginV1Fn, GeneratorPluginV1WatchOptions, GeneratorPluginVersion, NormalizedGeneratorOptions, createPluginV1, getGeneratorPlugins, isGeneratorPlugin };
102
+ export { Ctx, File, FileManager, GeneratorOptions, GeneratorPluginV1, GeneratorPluginV1Factory, GeneratorPluginV1Fn, GeneratorPluginV1WatchOptions, GeneratorPluginVersion, NormalizedGeneratorOptions, createPluginV1, getGeneratorPlugins, getModuleCreateName, getModuleGetName, getModuleVariableName, isGeneratorPlugin };
package/dist/index.js CHANGED
@@ -81,10 +81,22 @@ var FileManager = class {
81
81
  }
82
82
  };
83
83
 
84
+ // lib/module.ts
85
+ import { camelCase, pascalCase } from "change-case-all";
86
+ function getModuleGetName(name) {
87
+ return `get${pascalCase(name)}Module`;
88
+ }
89
+ function getModuleCreateName(name) {
90
+ return `create${pascalCase(name)}Module`;
91
+ }
92
+ function getModuleVariableName(name) {
93
+ return camelCase(`${name}Module`);
94
+ }
95
+
84
96
  // lib/plugin.ts
85
97
  import { PluginType } from "@baeta/plugin";
86
98
  var GeneratorPluginVersion = /* @__PURE__ */ ((GeneratorPluginVersion2) => {
87
- GeneratorPluginVersion2[GeneratorPluginVersion2["V1"] = 0] = "V1";
99
+ GeneratorPluginVersion2["V1"] = "v1";
88
100
  return GeneratorPluginVersion2;
89
101
  })(GeneratorPluginVersion || {});
90
102
  var defaultPluginFn = async (ctx, next) => {
@@ -95,7 +107,7 @@ function createPluginV1(options) {
95
107
  return {
96
108
  name: options.name,
97
109
  actionName: options.actionName,
98
- version: 0 /* V1 */,
110
+ version: "v1" /* V1 */,
99
111
  type: PluginType.Generator,
100
112
  end: options.end ?? defaultPluginFn,
101
113
  generate: options.generate ?? defaultPluginFn,
@@ -118,5 +130,8 @@ export {
118
130
  GeneratorPluginVersion,
119
131
  createPluginV1,
120
132
  getGeneratorPlugins,
133
+ getModuleCreateName,
134
+ getModuleGetName,
135
+ getModuleVariableName,
121
136
  isGeneratorPlugin
122
137
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baeta/generator-sdk",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "homepage": "https://github.com/andreisergiu98/baeta#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/andreisergiu98/baeta/issues"
@@ -24,14 +24,15 @@
24
24
  "types": "tsc --noEmit"
25
25
  },
26
26
  "dependencies": {
27
- "@baeta/plugin": "^0.0.17",
27
+ "@baeta/plugin": "^0.0.18",
28
+ "change-case-all": "1.0.15",
28
29
  "chokidar": "^3.5.3"
29
30
  },
30
31
  "devDependencies": {
31
- "@baeta/build-tools": "^0.0.0",
32
+ "@baeta/builder": "^0.0.0",
32
33
  "@baeta/tsconfig": "^0.0.0",
33
- "@types/node": "^18.11.18",
34
- "typescript": "^4.9.4"
34
+ "@types/node": "^18.15.11",
35
+ "typescript": "^4.9.5"
35
36
  },
36
37
  "engines": {
37
38
  "node": ">=18.0.0"