@warlock.js/core 3.0.5 → 3.0.7

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.
@@ -1,6 +1,2 @@
1
- /**
2
- * Generate TypeScript types for config keys using module augmentation
3
- * Links to user's src/config/config-types.ts for deep typing
4
- */
5
1
  export declare function generateConfigTypes(): Promise<string[]>;
6
2
  //# sourceMappingURL=config-types-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-generator.d.ts","sourceRoot":"","sources":["../../src/builder/config-types-generator.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAsB,mBAAmB,sBA0DxC"}
1
+ {"version":3,"file":"config-types-generator.d.ts","sourceRoot":"","sources":["../../src/builder/config-types-generator.ts"],"names":[],"mappings":"AAmCA,wBAAsB,mBAAmB,sBA8DxC"}
@@ -1,7 +1,26 @@
1
1
  'use strict';var fs=require('@mongez/fs'),path=require('path'),glob=require('../utils/glob.js'),paths=require('../utils/paths.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var path__default=/*#__PURE__*/_interopDefault(path);/**
2
- * Generate TypeScript types for config keys using module augmentation
3
- * Links to user's src/config/config-types.ts for deep typing
2
+ * Check if tsconfig.json includes .warlock types
3
+ * If not, log a warning to help the user
4
4
  */
5
+ async function checkTsConfigIncludes() {
6
+ try {
7
+ const tsconfigPath = paths.rootPath("tsconfig.json");
8
+ const tsconfigContent = await fs.getFileAsync(tsconfigPath);
9
+ if (!tsconfigContent)
10
+ return;
11
+ // Check if .warlock types are in the include array
12
+ const warlockPattern = ".warlock/**/*.d.ts";
13
+ const hasWarlockTypes = tsconfigContent.includes(`"${warlockPattern}"`) ||
14
+ tsconfigContent.includes(`'${warlockPattern}'`);
15
+ if (!hasWarlockTypes) {
16
+ console.warn(`⚠️ [config types] Add "${warlockPattern}" to tsconfig.json "include" array for config autocomplete`);
17
+ console.info(`ℹ️ [config types] Example: "include": ["src", "${warlockPattern}"]`);
18
+ }
19
+ }
20
+ catch (error) {
21
+ // Silently fail - tsconfig.json might not exist or be malformed
22
+ }
23
+ }
5
24
  async function generateConfigTypes() {
6
25
  try {
7
26
  // Find all config files in src/config/
@@ -27,6 +46,7 @@ async function generateConfigTypes() {
27
46
  * Type mappings are defined in src/config/config-types.ts (you can edit that file!)
28
47
  */
29
48
 
49
+ /* eslint-disable @typescript-eslint/no-empty-object-type */
30
50
  import type { ConfigTypeMap as UserConfigTypeMap } from "../src/config/config-types";
31
51
 
32
52
  declare module "@warlock.js/core" {
@@ -48,6 +68,8 @@ ${configKeys.map(key => ` ${key}: true;`).join("\n")}
48
68
  // Write type augmentation file
49
69
  const outputPath = paths.warlockPath("config-augmentation.d.ts");
50
70
  await fs.putFileAsync(outputPath, typeDefinition);
71
+ // Check if tsconfig.json includes .warlock/**/*.d.ts
72
+ await checkTsConfigIncludes();
51
73
  return configKeys;
52
74
  }
53
75
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-generator.js","sources":["../../src/builder/config-types-generator.ts"],"sourcesContent":[null],"names":["rootPath","globFiles","path","warlockPath","putFileAsync"],"mappings":"yPAKA;;;AAGG;AACI,eAAe,mBAAmB,GAAA;IACvC,IAAI;;AAEF,QAAA,MAAM,SAAS,GAAGA,cAAQ,CAAC,YAAY,CAAC,CAAC;AACzC,QAAA,MAAM,WAAW,GAAG,MAAMC,cAAS,CAAC,SAAS,EAAE;AAC7C,YAAA,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;AACnC,SAAA,CAAC,CAAC;;QAGH,MAAM,UAAU,GAAG,WAAW;aAC3B,GAAG,CAAC,QAAQ,IAAG;YACd,MAAM,QAAQ,GAAGC,qBAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;;YAEzC,OAAO,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAChD,SAAC,CAAC;AACD,aAAA,MAAM,CAAC,GAAG,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,cAAc,CAAC;aACxD,IAAI,EAAE,CAAC;;AAGV,QAAA,MAAM,cAAc,GAAG,CAAA;;;;;;;;;;;;;;;;AAgBzB,EAAA,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAO,IAAA,EAAA,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;;;;;;;;CAStD,CAAC;;AAGE,QAAA,MAAM,UAAU,GAAGC,iBAAW,CAAC,0BAA0B,CAAC,CAAC;AAC3D,QAAA,MAAMC,eAAY,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;AAE/C,QAAA,OAAO,UAAU,CAAC;AACnB,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,IAAI,CACV,qCAAqC,EACrC,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;AACF,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AACH"}
1
+ {"version":3,"file":"config-types-generator.js","sources":["../../src/builder/config-types-generator.ts"],"sourcesContent":[null],"names":["rootPath","getFileAsync","globFiles","path","warlockPath","putFileAsync"],"mappings":"yPAKA;;;AAGG;AACH,eAAe,qBAAqB,GAAA;IAClC,IAAI;AACF,QAAA,MAAM,YAAY,GAAGA,cAAQ,CAAC,eAAe,CAAC,CAAC;AAC/C,QAAA,MAAM,eAAe,GAAG,MAAMC,eAAY,CAAC,YAAY,CAAC,CAAC;AAEzD,QAAA,IAAI,CAAC,eAAe;YAAE,OAAO;;QAG7B,MAAM,cAAc,GAAG,oBAAoB,CAAC;QAC5C,MAAM,eAAe,GACnB,eAAe,CAAC,QAAQ,CAAC,CAAA,CAAA,EAAI,cAAc,CAAA,CAAA,CAAG,CAAC;AAC/C,YAAA,eAAe,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAA,CAAA,CAAG,CAAC,CAAC;QAElD,IAAI,CAAC,eAAe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AAA;AAAC,IAAA,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,IAAI,CACV,qCAAqC,EACrC,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;AACF,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AACH"}
@@ -1,6 +1,2 @@
1
- /**
2
- * Generate TypeScript types for config keys using module augmentation
3
- * Links to user's src/config/config-types.ts for deep typing
4
- */
5
1
  export declare function generateConfigTypes(): Promise<string[]>;
6
2
  //# sourceMappingURL=config-types-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-generator.d.ts","sourceRoot":"","sources":["../../src/builder/config-types-generator.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,wBAAsB,mBAAmB,sBA0DxC"}
1
+ {"version":3,"file":"config-types-generator.d.ts","sourceRoot":"","sources":["../../src/builder/config-types-generator.ts"],"names":[],"mappings":"AAmCA,wBAAsB,mBAAmB,sBA8DxC"}
@@ -1,7 +1,26 @@
1
- import {putFileAsync}from'@mongez/fs';import path from'path';import {globFiles}from'../utils/glob.js';import {rootPath,warlockPath}from'../utils/paths.js';/**
2
- * Generate TypeScript types for config keys using module augmentation
3
- * Links to user's src/config/config-types.ts for deep typing
1
+ import {putFileAsync,getFileAsync}from'@mongez/fs';import path from'path';import {globFiles}from'../utils/glob.js';import {rootPath,warlockPath}from'../utils/paths.js';/**
2
+ * Check if tsconfig.json includes .warlock types
3
+ * If not, log a warning to help the user
4
4
  */
5
+ async function checkTsConfigIncludes() {
6
+ try {
7
+ const tsconfigPath = rootPath("tsconfig.json");
8
+ const tsconfigContent = await getFileAsync(tsconfigPath);
9
+ if (!tsconfigContent)
10
+ return;
11
+ // Check if .warlock types are in the include array
12
+ const warlockPattern = ".warlock/**/*.d.ts";
13
+ const hasWarlockTypes = tsconfigContent.includes(`"${warlockPattern}"`) ||
14
+ tsconfigContent.includes(`'${warlockPattern}'`);
15
+ if (!hasWarlockTypes) {
16
+ console.warn(`⚠️ [config types] Add "${warlockPattern}" to tsconfig.json "include" array for config autocomplete`);
17
+ console.info(`ℹ️ [config types] Example: "include": ["src", "${warlockPattern}"]`);
18
+ }
19
+ }
20
+ catch (error) {
21
+ // Silently fail - tsconfig.json might not exist or be malformed
22
+ }
23
+ }
5
24
  async function generateConfigTypes() {
6
25
  try {
7
26
  // Find all config files in src/config/
@@ -27,6 +46,7 @@ async function generateConfigTypes() {
27
46
  * Type mappings are defined in src/config/config-types.ts (you can edit that file!)
28
47
  */
29
48
 
49
+ /* eslint-disable @typescript-eslint/no-empty-object-type */
30
50
  import type { ConfigTypeMap as UserConfigTypeMap } from "../src/config/config-types";
31
51
 
32
52
  declare module "@warlock.js/core" {
@@ -48,6 +68,8 @@ ${configKeys.map(key => ` ${key}: true;`).join("\n")}
48
68
  // Write type augmentation file
49
69
  const outputPath = warlockPath("config-augmentation.d.ts");
50
70
  await putFileAsync(outputPath, typeDefinition);
71
+ // Check if tsconfig.json includes .warlock/**/*.d.ts
72
+ await checkTsConfigIncludes();
51
73
  return configKeys;
52
74
  }
53
75
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"config-types-generator.js","sources":["../../src/builder/config-types-generator.ts"],"sourcesContent":[null],"names":[],"mappings":"2JAKA;;;AAGG;AACI,eAAe,mBAAmB,GAAA;IACvC,IAAI;;AAEF,QAAA,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AACzC,QAAA,MAAM,WAAW,GAAG,MAAM,SAAS,CAAC,SAAS,EAAE;AAC7C,YAAA,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC;AACnC,SAAA,CAAC,CAAC;;QAGH,MAAM,UAAU,GAAG,WAAW;aAC3B,GAAG,CAAC,QAAQ,IAAG;YACd,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;;YAEzC,OAAO,QAAQ,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAChD,SAAC,CAAC;AACD,aAAA,MAAM,CAAC,GAAG,IAAI,GAAG,KAAK,OAAO,IAAI,GAAG,KAAK,cAAc,CAAC;aACxD,IAAI,EAAE,CAAC;;AAGV,QAAA,MAAM,cAAc,GAAG,CAAA;;;;;;;;;;;;;;;;AAgBzB,EAAA,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAO,IAAA,EAAA,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;;;;;;;;CAStD,CAAC;;AAGE,QAAA,MAAM,UAAU,GAAG,WAAW,CAAC,0BAA0B,CAAC,CAAC;AAC3D,QAAA,MAAM,YAAY,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;AAE/C,QAAA,OAAO,UAAU,CAAC;AACnB,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,IAAI,CACV,qCAAqC,EACrC,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;AACF,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AACH"}
1
+ {"version":3,"file":"config-types-generator.js","sources":["../../src/builder/config-types-generator.ts"],"sourcesContent":[null],"names":[],"mappings":"wKAKA;;;AAGG;AACH,eAAe,qBAAqB,GAAA;IAClC,IAAI;AACF,QAAA,MAAM,YAAY,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAC/C,QAAA,MAAM,eAAe,GAAG,MAAM,YAAY,CAAC,YAAY,CAAC,CAAC;AAEzD,QAAA,IAAI,CAAC,eAAe;YAAE,OAAO;;QAG7B,MAAM,cAAc,GAAG,oBAAoB,CAAC;QAC5C,MAAM,eAAe,GACnB,eAAe,CAAC,QAAQ,CAAC,CAAA,CAAA,EAAI,cAAc,CAAA,CAAA,CAAG,CAAC;AAC/C,YAAA,eAAe,CAAC,QAAQ,CAAC,IAAI,cAAc,CAAA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C;AAE9B,QAAA,OAAO,UAAU,CAAC;AACnB,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,IAAI,CACV,qCAAqC,EACrC,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;AACF,QAAA,OAAO,EAAE,CAAC;AACX,KAAA;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@warlock.js/core",
3
- "version": "3.0.5",
3
+ "version": "3.0.7",
4
4
  "description": "A robust nodejs framework for building blazing fast applications",
5
5
  "main": "./cjs/index.js",
6
6
  "bin": {
@@ -29,8 +29,8 @@
29
29
  "@mongez/fs": "^3.0.5",
30
30
  "@mongez/http": "^2.2.10",
31
31
  "@mongez/localization": "^3.0.0",
32
- "@warlock.js/logger": "3.0.5",
33
- "@warlock.js/cascade": "3.0.5",
32
+ "@warlock.js/logger": "3.0.7",
33
+ "@warlock.js/cascade": "3.0.7",
34
34
  "@mongez/reinforcements": "^2.3.10",
35
35
  "commander": "^12.0.0",
36
36
  "@mongez/slug": "^1.0.7",