@dxtmisha/scripts 1.1.0 → 1.1.2

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
@@ -2,6 +2,28 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.1.2] - 2026-09-07
6
+
7
+ ### Fixed
8
+ - **Web-Types Generator AST Parsing (`DesignWikiStormItem`)**:
9
+ - Replaced runtime dynamic Node.js ESM imports (`await import(...)`) of `wikiData.ts` with static TypeScript AST parsing via the TypeScript Compiler API (`ts.createSourceFile`).
10
+ - Fixed `ERR_MODULE_NOT_FOUND` resolution errors occurring when `@dxtmisha/scripts` is installed and executed as an external package in consumer repositories containing extensionless TypeScript imports (`'../../../wiki/wiki'`, `'./props'`).
11
+ - Added AST-based extraction for default prop values (`getDefaultsFromProps`) from `props.ts` and design wiki configurations (`getWikiDesign`) from `src/wiki/wiki.ts`.
12
+ - Fixed TypeScript typing in `getSlots()` by removing unsupported `description` access on `StorybookSlotProperty`.
13
+ - Updated unit tests in `src/classes/Design/__tests__/DesignWikiStorm.test.ts` to test AST metadata extraction.
14
+
15
+ ## [1.1.1] - 2026-09-07
16
+
17
+ ### Added
18
+ - **`PropertiesFile.toUrl` Helper**:
19
+ - Added static `PropertiesFile.toUrl()` method for resolving paths to absolute file URLs for ESM dynamic imports.
20
+ - Added unit test suite in `src/classes/Properties/__tests__/PropertiesFile.test.ts` and updated Storybook documentation (EN, RU, VI).
21
+
22
+ ### Fixed
23
+ - **Web-Types Generation (`DesignWikiStormItem`)**:
24
+ - Fixed type formatting in `web-types.json`: string enum options from `getOptions()` are now properly quoted as literal string unions (`'sm' | 'md' | 'lg' | 'auto'`), while interfaces, generics, and function types retain clean TypeScript syntax without invalid outer quotes.
25
+ - Improved `cleanType()` to remove redundant enclosing parentheses and trailing `| undefined`.
26
+
5
27
  ## [1.1.0] - 2026-09-07
6
28
 
7
29
  ### Added
@@ -1,4 +1,4 @@
1
- import { t as e } from "./PropertiesConfig-BKZz_FWW.js";
1
+ import { t as e } from "./PropertiesConfig-BBsuNndv.js";
2
2
  import { forEach as t, random as n, sleep as r } from "@dxtmisha/functional-basic";
3
3
  //#region src/classes/Ai/AiAbstract.ts
4
4
  var i = class {
@@ -3,14 +3,14 @@ import { Datetime as i, forEach as a, toArray as o, toKebabCase as s, transforma
3
3
  import l from "path";
4
4
  import u from "node:fs";
5
5
  import d from "node:path";
6
- import { fileURLToPath as f } from "node:url";
6
+ import { fileURLToPath as f, pathToFileURL as p } from "node:url";
7
7
  //#region src/functions/toPathStandardSep.ts
8
- function p(e) {
8
+ function m(e) {
9
9
  return e.replace(/\//g, l.sep);
10
10
  }
11
11
  //#endregion
12
12
  //#region src/classes/Properties/PropertiesFile.ts
13
- var m = d.dirname(f(import.meta.url)), h = class {
13
+ var h = d.dirname(f(import.meta.url)), g = class {
14
14
  static root;
15
15
  static module;
16
16
  static is(e) {
@@ -69,6 +69,9 @@ var m = d.dirname(f(import.meta.url)), h = class {
69
69
  static toSep(e) {
70
70
  return this.sep() === "/" ? e : e.replace("/", this.sep());
71
71
  }
72
+ static toUrl(e) {
73
+ return p(d.resolve(this.root, this.joinPath(e))).href;
74
+ }
72
75
  static readDir(e) {
73
76
  return this.is(e) ? u.readdirSync(this.joinPath(e)) : [];
74
77
  }
@@ -128,9 +131,9 @@ var m = d.dirname(f(import.meta.url)), h = class {
128
131
  return this.joinPath(e).replace(`${this.root}${d.sep}`, "").replace(`${this.root}`, "");
129
132
  }
130
133
  static {
131
- this.module = !!m.match("node_modules"), this.root = process.cwd();
134
+ this.module = !!h.match("node_modules"), this.root = process.cwd();
132
135
  }
133
- }, g = class {
136
+ }, _ = class {
134
137
  static config;
135
138
  static isPromptPackageOnly() {
136
139
  return !!this.config?.promptPackageOnly;
@@ -214,9 +217,9 @@ var m = d.dirname(f(import.meta.url)), h = class {
214
217
  return this.config?.wikiLanguage ?? "en";
215
218
  }
216
219
  static getExtends(e, t = []) {
217
- let n = [...t, p(e)], r = this.getLocalPath(n), i = h.readFile(n), a = h.readFile(r), o = a?.extends ?? i?.extends;
220
+ let n = [...t, m(e)], r = this.getLocalPath(n), i = g.readFile(n), a = g.readFile(r), o = a?.extends ?? i?.extends;
218
221
  return o ? {
219
- ...this.getExtends(o, [h.getPathDir(n)]),
222
+ ...this.getExtends(o, [g.getPathDir(n)]),
220
223
  ...i,
221
224
  ...a
222
225
  } : {
@@ -236,12 +239,12 @@ var m = d.dirname(f(import.meta.url)), h = class {
236
239
  let t = [];
237
240
  for (let n = 0; n < 32; n++) {
238
241
  let n = [...t, e], r = this.getLocalPath(n);
239
- if (h.is(n) || h.is(r)) {
240
- let e = h.readFile(n), t = h.readFile(r);
242
+ if (g.is(n) || g.is(r)) {
243
+ let e = g.readFile(n), t = g.readFile(r);
241
244
  if (e || t) {
242
245
  let r = t?.extends ?? e?.extends;
243
246
  return r ? {
244
- ...this.getExtends(r, [h.getPathDir(n)]),
247
+ ...this.getExtends(r, [g.getPathDir(n)]),
245
248
  ...e,
246
249
  ...t
247
250
  } : {
@@ -259,4 +262,4 @@ var m = d.dirname(f(import.meta.url)), h = class {
259
262
  }
260
263
  };
261
264
  //#endregion
262
- export { h as n, g as t };
265
+ export { g as n, _ as t };
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s, u as c } from "./AiZAi-BiLAcdFy.js";
1
+ import { a as e, c as t, i as n, n as r, o as i, r as a, s as o, t as s, u as c } from "./AiZAi-P-St-CZL.js";
2
2
  export { c as AiAbstract, o as AiClaude, t as AiClaudeLite, e as AiGoogle, i as AiGoogleLite, a as AiOpenAi, n as AiOpenAiLite, s as AiZAi, r as AiZAiLite };
@@ -1,4 +1,4 @@
1
- import { t as e } from "./PropertiesConfig-BKZz_FWW.js";
1
+ import { t as e } from "./PropertiesConfig-BBsuNndv.js";
2
2
  import { n as t, t as n } from "./figmaApiTypes-CArSsNW8.js";
3
3
  //#region src/classes/FigmaApi.ts
4
4
  var r = class {