@driveflux/fab 2.2.0 → 2.2.1

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/dist/build.js CHANGED
@@ -185,7 +185,7 @@ import path from 'node:path';
185
185
  import merge from 'lodash.merge';
186
186
  import { clean } from './clean.js';
187
187
  import { ensureDir, getDefaultOptions, runBin, runCommand } from './utils.js';
188
- export var build = function() {
188
+ export var build = /*#__PURE__*/ function() {
189
189
  var _ref = _async_to_generator(function(rawOptions) {
190
190
  var options, promises;
191
191
  return _ts_generator(this, function(_state) {
@@ -222,7 +222,7 @@ export var build = function() {
222
222
  return _ref.apply(this, arguments);
223
223
  };
224
224
  }();
225
- export var copyVerbatim = function() {
225
+ export var copyVerbatim = /*#__PURE__*/ function() {
226
226
  var _ref = _async_to_generator(function(rawOptions) {
227
227
  var _options_copyVerbatim, options, destination, guessTarget;
228
228
  return _ts_generator(this, function(_state) {
@@ -244,7 +244,7 @@ export var copyVerbatim = function() {
244
244
  };
245
245
  return [
246
246
  4,
247
- Promise.all(options.copyVerbatim.map(function() {
247
+ Promise.all(options.copyVerbatim.map(/*#__PURE__*/ function() {
248
248
  var _ref = _async_to_generator(function(fileOrFolderRaw) {
249
249
  var source, target, tagetBasedir;
250
250
  return _ts_generator(this, function(_state) {
@@ -292,7 +292,7 @@ export var copyVerbatim = function() {
292
292
  return _ref.apply(this, arguments);
293
293
  };
294
294
  }();
295
- export var buildTypes = function() {
295
+ export var buildTypes = /*#__PURE__*/ function() {
296
296
  var _ref = _async_to_generator(function(rawOptions) {
297
297
  var options, tsProject;
298
298
  return _ts_generator(this, function(_state) {
@@ -322,7 +322,7 @@ export var buildTypes = function() {
322
322
  return _ref.apply(this, arguments);
323
323
  };
324
324
  }();
325
- export var buildEsm = function() {
325
+ export var buildEsm = /*#__PURE__*/ function() {
326
326
  var _ref = _async_to_generator(function(rawOptions) {
327
327
  var options, finalOptions, swcrc, e, isValid, compilerOptions;
328
328
  return _ts_generator(this, function(_state) {
package/dist/clean.js CHANGED
@@ -126,7 +126,7 @@ import path from 'node:path';
126
126
  import { deleteAsync } from 'del';
127
127
  import merge from 'lodash.merge';
128
128
  import { getDefaultOptions } from './utils.js';
129
- export var clean = function() {
129
+ export var clean = /*#__PURE__*/ function() {
130
130
  var _ref = _async_to_generator(function(rawOptions) {
131
131
  var _merge, destination, all, commandOptions;
132
132
  return _ts_generator(this, function(_state) {
package/dist/config.js CHANGED
@@ -136,7 +136,7 @@ var ConfigValidation = z.object({
136
136
  * or an array of 2 paths [source, destination].
137
137
  */ copyVerbatim: z.array(z.string().or(z.array(z.string()).length(2)))
138
138
  });
139
- export var parseConfig = function() {
139
+ export var parseConfig = /*#__PURE__*/ function() {
140
140
  var _ref = _async_to_generator(function(options) {
141
141
  var cwd, config, parsed;
142
142
  return _ts_generator(this, function(_state) {
@@ -194,7 +194,7 @@ export var parseConfig = function() {
194
194
  return _ref.apply(this, arguments);
195
195
  };
196
196
  }();
197
- var findConfigFile = function() {
197
+ var findConfigFile = /*#__PURE__*/ function() {
198
198
  var _ref = _async_to_generator(function() {
199
199
  var cwd, files, configFile, _tmp;
200
200
  var _arguments = arguments;
@@ -241,7 +241,7 @@ var findConfigFile = function() {
241
241
  return _ref.apply(this, arguments);
242
242
  };
243
243
  }();
244
- var readConfigFile = function() {
244
+ var readConfigFile = /*#__PURE__*/ function() {
245
245
  var _ref = _async_to_generator(function(configPath) {
246
246
  var _;
247
247
  return _ts_generator(this, function(_state) {
@@ -0,0 +1,5 @@
1
+ export declare const DEV_DEPS_TO_INSTALL: {
2
+ readonly backend: readonly ["@driveflux/fab", "@driveflux/tsconfig", "@types/node", "typescript"];
3
+ readonly frontend: readonly ["@driveflux/fab", "@driveflux/tsconfig", "@types/node", "@types/react", "typescript"];
4
+ };
5
+ //# sourceMappingURL=create-package-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-package-config.d.ts","sourceRoot":"","sources":["../src/create-package-config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;CActB,CAAA"}
@@ -0,0 +1,15 @@
1
+ export var DEV_DEPS_TO_INSTALL = {
2
+ backend: [
3
+ '@driveflux/fab',
4
+ '@driveflux/tsconfig',
5
+ '@types/node',
6
+ 'typescript'
7
+ ],
8
+ frontend: [
9
+ '@driveflux/fab',
10
+ '@driveflux/tsconfig',
11
+ '@types/node',
12
+ '@types/react',
13
+ 'typescript'
14
+ ]
15
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAIA,UAAU,aAAa;IACtB,QAAQ,EAAE,SAAS,GAAG,UAAU,CAAA;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAED,eAAO,MAAM,MAAM,gGAMhB,aAAa,kBAyCf,CAAA"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../src/create.ts"],"names":[],"mappings":"AAMA,UAAU,aAAa;IACtB,QAAQ,EAAE,SAAS,GAAG,UAAU,CAAA;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAED,eAAO,MAAM,MAAM,gGAMhB,aAAa,kBA2Cf,CAAA"}
package/dist/create.js CHANGED
@@ -1,3 +1,11 @@
1
+ function _array_like_to_array(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _array_without_holes(arr) {
7
+ if (Array.isArray(arr)) return _array_like_to_array(arr);
8
+ }
1
9
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2
10
  try {
3
11
  var info = gen[key](arg);
@@ -27,6 +35,23 @@ function _async_to_generator(fn) {
27
35
  });
28
36
  };
29
37
  }
38
+ function _iterable_to_array(iter) {
39
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
40
+ }
41
+ function _non_iterable_spread() {
42
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
43
+ }
44
+ function _to_consumable_array(arr) {
45
+ return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
46
+ }
47
+ function _unsupported_iterable_to_array(o, minLen) {
48
+ if (!o) return;
49
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
50
+ var n = Object.prototype.toString.call(o).slice(8, -1);
51
+ if (n === "Object" && o.constructor) n = o.constructor.name;
52
+ if (n === "Map" || n === "Set") return Array.from(n);
53
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
54
+ }
30
55
  function _ts_generator(thisArg, body) {
31
56
  var f, y, t, g, _ = {
32
57
  label: 0,
@@ -125,8 +150,9 @@ function _ts_generator(thisArg, body) {
125
150
  import fs from 'node:fs/promises';
126
151
  import path from 'node:path';
127
152
  import { deleteAsync } from 'del';
153
+ import { DEV_DEPS_TO_INSTALL } from './create-package-config.js';
128
154
  import { ensureDir, getBaseDir, runCommand } from './utils.js';
129
- export var create = function() {
155
+ export var create = /*#__PURE__*/ function() {
130
156
  var _ref = _async_to_generator(function(param) {
131
157
  var template, name, providedDestination, providedCwd, dangerouslyRewrite, cwd, destination, finalDestination, e, templatePath;
132
158
  return _ts_generator(this, function(_state) {
@@ -221,8 +247,9 @@ export var create = function() {
221
247
  return [
222
248
  4,
223
249
  runCommand('pnpm', [
224
- 'i'
225
- ], {
250
+ 'add',
251
+ '-D'
252
+ ].concat(_to_consumable_array(DEV_DEPS_TO_INSTALL[template])), {
226
253
  cwd: cwd
227
254
  })
228
255
  ];
@@ -238,7 +265,7 @@ export var create = function() {
238
265
  return _ref.apply(this, arguments);
239
266
  };
240
267
  }();
241
- var replaceInFile = function() {
268
+ var replaceInFile = /*#__PURE__*/ function() {
242
269
  var _ref = _async_to_generator(function(filePath, replacements) {
243
270
  var content, newContent;
244
271
  return _ts_generator(this, function(_state) {
package/dist/utils.js CHANGED
@@ -153,7 +153,7 @@ function _ts_generator(thisArg, body) {
153
153
  import { spawn } from 'node:child_process';
154
154
  import fs from 'node:fs/promises';
155
155
  import path from 'node:path';
156
- export var ensureDir = function() {
156
+ export var ensureDir = /*#__PURE__*/ function() {
157
157
  var _ref = _async_to_generator(function(dir) {
158
158
  var stat, e;
159
159
  return _ts_generator(this, function(_state) {
@@ -203,7 +203,7 @@ export var ensureDir = function() {
203
203
  return _ref.apply(this, arguments);
204
204
  };
205
205
  }();
206
- export var runBin = function() {
206
+ export var runBin = /*#__PURE__*/ function() {
207
207
  var _ref = _async_to_generator(function(bin, args, options) {
208
208
  var basePath, binPath, c;
209
209
  return _ts_generator(this, function(_state) {
@@ -234,7 +234,7 @@ export var runBin = function() {
234
234
  return _ref.apply(this, arguments);
235
235
  };
236
236
  }();
237
- export var runCommand = function() {
237
+ export var runCommand = /*#__PURE__*/ function() {
238
238
  var _ref = _async_to_generator(function(cmd, args, options) {
239
239
  var c;
240
240
  return _ts_generator(this, function(_state) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driveflux/fab",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -11,23 +11,24 @@
11
11
  "files": [
12
12
  "dist",
13
13
  "bin",
14
+ "templates",
14
15
  "tsconfig.json"
15
16
  ],
16
17
  "dependencies": {
17
- "@swc/cli": "^0.4.0",
18
- "@swc/core": "1.7.2",
18
+ "@swc/cli": "0.4.1-nightly.20240914",
19
+ "@swc/core": "1.7.26",
19
20
  "commander": "^12.1.0",
20
21
  "del": "^7.1.0",
21
22
  "lodash.merge": "^4.6.2",
22
23
  "zod": "^3.23.8"
23
24
  },
24
25
  "devDependencies": {
25
- "@driveflux/tsconfig": "1.2.0",
26
+ "@driveflux/tsconfig": "1.2.1",
26
27
  "@types/lodash.merge": "^4.6.9",
27
- "@types/node": "^20.14.12",
28
+ "@types/node": "^22.5.5",
28
29
  "del-cli": "^5.1.0",
29
- "type-fest": "^4.23.0",
30
- "typescript": "^5.5.4"
30
+ "type-fest": "^4.26.1",
31
+ "typescript": "^5.6.2"
31
32
  },
32
33
  "bin": {
33
34
  "fab": "./bin/fab.js"
@@ -0,0 +1 @@
1
+ v22
@@ -0,0 +1,8 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3
+ "extends": ["../../biome.json"],
4
+ "files": {
5
+ "ignoreUnknown": true,
6
+ "include": ["src/**/*.ts"]
7
+ }
8
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@driveflux/{{name}}",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/index.js",
8
+ "types": "./dist/index.d.ts"
9
+ }
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "scripts": {
15
+ "build": "fab",
16
+ "clean": "fab clean",
17
+ "prepublishOnly": "pnpm build",
18
+ "build:js": "fab -t esm",
19
+ "build:types": "fab -t types",
20
+ "type-check": "tsc --noEmit",
21
+ "check": "biome check --write ./src",
22
+ "lint:errors": "pnpm lint --diagnostic-level error",
23
+ "format": "biome format --write ./src",
24
+ "lint": "biome lint --write --unsafe ./src"
25
+ },
26
+ "devDependencies": {
27
+
28
+ }
29
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@driveflux/{{name}}",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/index.js",
8
+ "types": "./dist/index.d.ts"
9
+ }
10
+ },
11
+ "scripts": {
12
+ "build": "fab",
13
+ "clean": "fab clean",
14
+ "prepublishOnly": "pnpm build",
15
+ "types": "tsc --noEmit",
16
+ "lint": "eslint \"src/**/*.ts\""
17
+ },
18
+ "devDependencies": {
19
+ "@driveflux/tsconfig": "workspace:*",
20
+ "@driveflux/fab": "workspace:*",
21
+ "@types/node": "^20.9.1",
22
+ "typescript": "^5.4.5"
23
+ }
24
+ }
@@ -0,0 +1 @@
1
+ // TODO: remove this file
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "extends": "@driveflux/tsconfig/frontend.json",
4
+ "compilerOptions": {
5
+ "rootDir": "src",
6
+ "outDir": "./dist"
7
+ },
8
+ "include": ["src/**/*.ts", "src/**/*.tsx"],
9
+ "exclude": ["node_modules"]
10
+ }