@bemedev/dev-utils 0.6.0 → 0.6.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.
@@ -0,0 +1,5 @@
1
+ import { createRequire } from "module";
2
+ //#region \0rolldown/runtime.js
3
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
4
+ //#endregion
5
+ export { __require };
@@ -1 +1 @@
1
- export declare const addTarball: () => Promise<void>;
1
+ export declare const addTarball: () => any;
@@ -1,52 +1,2 @@
1
1
  export declare const BIN = "build-tests";
2
- export declare const cli: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
3
- parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
4
- command: "posttest";
5
- args: {};
6
- } | {
7
- command: "pretest";
8
- args: {};
9
- } | {
10
- command: "test";
11
- args: {
12
- pretest: boolean;
13
- posttest: boolean;
14
- pre: boolean;
15
- post: boolean;
16
- };
17
- }>>;
18
- } & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{
19
- command: "posttest";
20
- args: {};
21
- } | {
22
- command: "pretest";
23
- args: {};
24
- } | {
25
- command: "test";
26
- args: {
27
- pretest: boolean;
28
- posttest: boolean;
29
- pre: boolean;
30
- post: boolean;
31
- };
32
- }, {
33
- command: "posttest";
34
- value: void;
35
- } | {
36
- command: "pretest";
37
- value: Promise<void>;
38
- } | {
39
- command: "test";
40
- value: Promise<void>;
41
- }> & {
42
- run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
43
- command: "posttest";
44
- value: void;
45
- } | {
46
- command: "pretest";
47
- value: Promise<void>;
48
- } | {
49
- command: "test";
50
- value: Promise<void>;
51
- }>>;
52
- };
2
+ export declare const cli: any;
@@ -1,5 +1 @@
1
- export declare const posttest: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
2
- parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{}>>;
3
- } & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & import("cmd-ts/dist/cjs/helpdoc").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{}, void> & {
4
- run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<void>>;
5
- } & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned & import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Aliased>;
1
+ export declare const posttest: any;
@@ -1,5 +1 @@
1
- export declare const pretest: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
2
- parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{}>>;
3
- } & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & import("cmd-ts/dist/cjs/helpdoc").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{}, Promise<void>> & {
4
- run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<Promise<void>>>;
5
- } & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned & import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Aliased>;
1
+ export declare const pretest: any;
@@ -1,15 +1 @@
1
- export declare const test: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
2
- parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
3
- pretest: boolean;
4
- posttest: boolean;
5
- pre: boolean;
6
- post: boolean;
7
- }>>;
8
- } & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & import("cmd-ts/dist/cjs/helpdoc").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{
9
- pretest: boolean;
10
- posttest: boolean;
11
- pre: boolean;
12
- post: boolean;
13
- }, Promise<void>> & {
14
- run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<Promise<void>>>;
15
- } & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned & import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Aliased>;
1
+ export declare const test: any;
@@ -1,6 +1,6 @@
1
- export declare const DEFAULT_EXCLUDE: string[];
2
- export declare const DEFAULT_CIRCULAR_DEPS: string[];
3
- export declare const IGNORE: string[];
1
+ export declare const DEFAULT_EXCLUDE: {};
2
+ export declare const DEFAULT_CIRCULAR_DEPS: {};
3
+ export declare const IGNORE: any;
4
4
  export declare const DEFAULT_DIR = "lib";
5
5
  export declare const WARNING_CODES: {
6
6
  EMPTY_BUNDLE: string;
@@ -1,2 +1,2 @@
1
- export declare const withoutExtension: (file: string) => string;
1
+ export declare const withoutExtension: (file: string) => any;
2
2
  export declare const cleanupJS: (files: Set<string>, dir: string, sourcemap: boolean) => void;
@@ -3,13 +3,4 @@ export type EndPluginOptions = {
3
3
  sourcemap?: boolean;
4
4
  dir?: string;
5
5
  };
6
- export declare const clean: (options?: EndPluginOptions) => {
7
- name: string;
8
- onLog: {
9
- handler: (this: import("rolldown").MinimalPluginContext, _: import("rolldown").LogLevel, { code, names }: import("rolldown").RolldownLog) => false | undefined;
10
- };
11
- closeBundle: {
12
- order: "post";
13
- handler: () => void;
14
- };
15
- };
6
+ export declare const clean: (options?: EndPluginOptions) => any;
@@ -13,15 +13,6 @@ export declare const PLUGIN_BUILDERS: {
13
13
  tsPaths: typeof tsPaths;
14
14
  circulars: typeof circulars;
15
15
  externals: typeof externals;
16
- clean: (options?: import("./clean").EndPluginOptions) => {
17
- name: string;
18
- onLog: {
19
- handler: (this: import("rolldown").MinimalPluginContext, _: import("rolldown").LogLevel, { code, names }: import("rolldown").RolldownLog) => false | undefined;
20
- };
21
- closeBundle: {
22
- order: "post";
23
- handler: () => void;
24
- };
25
- };
16
+ clean: (options?: import("./clean").EndPluginOptions) => any;
26
17
  };
27
- export declare const DEFAULT_PLUGINS_ORDER: string[];
18
+ export declare const DEFAULT_PLUGINS_ORDER: {};
@@ -3,6 +3,7 @@ const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
3
3
  const require_rolldown_config_utils = require("../utils.cjs");
4
4
  const require_rolldown_config_plugins_typescript_config = require("./typescript.config.cjs");
5
5
  let fs = require("fs");
6
+ let path = require("path");
6
7
  let tsc_alias = require("tsc-alias");
7
8
  let typescript = require("typescript");
8
9
  typescript = require_runtime.__toESM(typescript, 1);
@@ -23,6 +24,11 @@ const typescript$1 = ({ exclude, include, declarationMap, dir: outDir } = {}) =>
23
24
  const tsconfigPath = typescript.default.findConfigFile(cwd, fs.existsSync, "tsconfig.json");
24
25
  const configFile = require_rolldown_config_plugins_typescript_config.readTsConfig(tsconfigPath);
25
26
  const host = typescript.default.createCompilerHost(configFile.options);
27
+ const libLocation = (0, path.join)((0, path.dirname)(require.resolve("typescript")), "lib");
28
+ host.getDefaultLibLocation = () => libLocation;
29
+ host.getDefaultLibFileName = (options) => {
30
+ return (0, path.join)(libLocation, typescript.default.getDefaultLibFileName(options));
31
+ };
26
32
  const parsed = typescript.default.parseJsonConfigFileContent({
27
33
  ...configFile,
28
34
  include,
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.cjs","names":["typescript","toArray","ts","existsSync","readTsConfig"],"sources":["../../../src/rolldown-config/plugins/typescript.ts"],"sourcesContent":["import { toArray } from '../utils';\nimport { existsSync } from 'node:fs';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { replaceTscAliasPaths } from 'tsc-alias';\nimport ts from 'typescript';\nimport { readTsConfig } from './typescript.config';\n\ntype Props = {\n exclude?: string | string[];\n include?: Record<string, string>;\n declarationMap?: boolean;\n dir?: string;\n};\n\nexport const typescript = ({\n exclude,\n include,\n declarationMap,\n dir: outDir,\n}: Props = {}): RolldownPluginOption => {\n let done = false;\n\n return {\n name: 'bemedev-dts',\n options(opts) {\n const existing = toArray(opts.external).filter(\n v => typeof v === 'string' || v instanceof RegExp,\n );\n opts.external = [...existing, 'source-map-support'];\n return opts;\n },\n closeBundle: {\n order: 'pre',\n async handler() {\n if (done) return;\n const cwd = process.cwd();\n\n const tsconfigPath = ts.findConfigFile(\n cwd,\n existsSync,\n 'tsconfig.json',\n )!;\n\n const configFile = readTsConfig(tsconfigPath);\n const host = ts.createCompilerHost(configFile.options);\n\n const parsed = ts.parseJsonConfigFileContent(\n {\n ...configFile,\n include,\n exclude: [...toArray(exclude), '*.ts'],\n compilerOptions: {\n ...configFile.options,\n outDir,\n noEmit: false,\n emitDeclarationOnly: true,\n declaration: true,\n declarationMap,\n },\n },\n ts.sys,\n cwd,\n );\n\n const program = ts.createProgram(\n parsed.fileNames,\n parsed.options,\n host,\n );\n\n const emitResult = program.emit();\n\n const errors = ts\n .getPreEmitDiagnostics(program)\n .concat(emitResult.diagnostics)\n .filter(d => d.category === ts.DiagnosticCategory.Error);\n\n if (errors.length > 0) {\n console.error(\n ts.formatDiagnosticsWithColorAndContext(errors, host),\n );\n }\n\n await replaceTscAliasPaths({\n configFile: tsconfigPath,\n outDir,\n });\n\n done = true;\n console.log('DTS generation complete');\n },\n },\n };\n};\n"],"mappings":";;;;;;;;;AAcA,MAAaA,gBAAc,EACzB,SACA,SACA,gBACA,KAAK,WACI,EAAE,KAA2B;CACtC,IAAI,OAAO;AAEX,QAAO;EACL,MAAM;EACN,QAAQ,MAAM;AAIZ,QAAK,WAAW,CAAC,GAHAC,8BAAAA,QAAQ,KAAK,SAAS,CAAC,QACtC,MAAK,OAAO,MAAM,YAAY,aAAa,OAC5C,EAC6B,qBAAqB;AACnD,UAAO;;EAET,aAAa;GACX,OAAO;GACP,MAAM,UAAU;AACd,QAAI,KAAM;IACV,MAAM,MAAM,QAAQ,KAAK;IAEzB,MAAM,eAAeC,WAAAA,QAAG,eACtB,KACAC,GAAAA,YACA,gBACD;IAED,MAAM,aAAaC,kDAAAA,aAAa,aAAa;IAC7C,MAAM,OAAOF,WAAAA,QAAG,mBAAmB,WAAW,QAAQ;IAEtD,MAAM,SAASA,WAAAA,QAAG,2BAChB;KACE,GAAG;KACH;KACA,SAAS,CAAC,GAAGD,8BAAAA,QAAQ,QAAQ,EAAE,OAAO;KACtC,iBAAiB;MACf,GAAG,WAAW;MACd;MACA,QAAQ;MACR,qBAAqB;MACrB,aAAa;MACb;MACD;KACF,EACDC,WAAAA,QAAG,KACH,IACD;IAED,MAAM,UAAUA,WAAAA,QAAG,cACjB,OAAO,WACP,OAAO,SACP,KACD;IAED,MAAM,aAAa,QAAQ,MAAM;IAEjC,MAAM,SAASA,WAAAA,QACZ,sBAAsB,QAAQ,CAC9B,OAAO,WAAW,YAAY,CAC9B,QAAO,MAAK,EAAE,aAAaA,WAAAA,QAAG,mBAAmB,MAAM;AAE1D,QAAI,OAAO,SAAS,EAClB,SAAQ,MACNA,WAAAA,QAAG,qCAAqC,QAAQ,KAAK,CACtD;AAGH,WAAA,GAAA,UAAA,sBAA2B;KACzB,YAAY;KACZ;KACD,CAAC;AAEF,WAAO;AACP,YAAQ,IAAI,0BAA0B;;GAEzC;EACF"}
1
+ {"version":3,"file":"typescript.cjs","names":["typescript","toArray","ts","existsSync","readTsConfig"],"sources":["../../../src/rolldown-config/plugins/typescript.ts"],"sourcesContent":["import { toArray } from '../utils';\nimport { existsSync } from 'node:fs';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { replaceTscAliasPaths } from 'tsc-alias';\nimport ts from 'typescript';\nimport { readTsConfig } from './typescript.config';\nimport { dirname, join } from 'node:path';\n\ntype Props = {\n exclude?: string | string[];\n include?: Record<string, string>;\n declarationMap?: boolean;\n dir?: string;\n};\n\nexport const typescript = ({\n exclude,\n include,\n declarationMap,\n dir: outDir,\n}: Props = {}): RolldownPluginOption => {\n let done = false;\n\n return {\n name: 'bemedev-dts',\n options(opts) {\n const existing = toArray(opts.external).filter(\n v => typeof v === 'string' || v instanceof RegExp,\n );\n opts.external = [...existing, 'source-map-support'];\n return opts;\n },\n closeBundle: {\n order: 'pre',\n async handler() {\n if (done) return;\n const cwd = process.cwd();\n\n const tsconfigPath = ts.findConfigFile(\n cwd,\n existsSync,\n 'tsconfig.json',\n )!;\n\n const configFile = readTsConfig(tsconfigPath);\n const host = ts.createCompilerHost(configFile.options);\n const libLocation = join(\n dirname(require.resolve('typescript')),\n 'lib',\n );\n host.getDefaultLibLocation = () => libLocation;\n host.getDefaultLibFileName = options => {\n return join(libLocation, ts.getDefaultLibFileName(options));\n };\n\n // host.useCaseSensitiveFileNames = () =>\n // ts.sys.useCaseSensitiveFileNames;\n // host.readFile = ts.sys.readFile;\n // host.fileExists = ts.sys.fileExists;\n\n const parsed = ts.parseJsonConfigFileContent(\n {\n ...configFile,\n include,\n exclude: [...toArray(exclude), '*.ts'],\n compilerOptions: {\n ...configFile.options,\n outDir,\n noEmit: false,\n emitDeclarationOnly: true,\n declaration: true,\n declarationMap,\n },\n },\n ts.sys,\n cwd,\n );\n\n const program = ts.createProgram(\n parsed.fileNames,\n parsed.options,\n host,\n );\n\n const emitResult = program.emit();\n\n const errors = ts\n .getPreEmitDiagnostics(program)\n .concat(emitResult.diagnostics)\n .filter(d => d.category === ts.DiagnosticCategory.Error);\n\n if (errors.length > 0) {\n console.error(\n ts.formatDiagnosticsWithColorAndContext(errors, host),\n );\n }\n\n await replaceTscAliasPaths({\n configFile: tsconfigPath,\n outDir,\n });\n\n done = true;\n console.log('DTS generation complete');\n },\n },\n };\n};\n"],"mappings":";;;;;;;;;;AAeA,MAAaA,gBAAc,EACzB,SACA,SACA,gBACA,KAAK,WACI,EAAE,KAA2B;CACtC,IAAI,OAAO;AAEX,QAAO;EACL,MAAM;EACN,QAAQ,MAAM;AAIZ,QAAK,WAAW,CAAC,GAHAC,8BAAAA,QAAQ,KAAK,SAAS,CAAC,QACtC,MAAK,OAAO,MAAM,YAAY,aAAa,OAC5C,EAC6B,qBAAqB;AACnD,UAAO;;EAET,aAAa;GACX,OAAO;GACP,MAAM,UAAU;AACd,QAAI,KAAM;IACV,MAAM,MAAM,QAAQ,KAAK;IAEzB,MAAM,eAAeC,WAAAA,QAAG,eACtB,KACAC,GAAAA,YACA,gBACD;IAED,MAAM,aAAaC,kDAAAA,aAAa,aAAa;IAC7C,MAAM,OAAOF,WAAAA,QAAG,mBAAmB,WAAW,QAAQ;IACtD,MAAM,eAAA,GAAA,KAAA,OAAA,GAAA,KAAA,SACI,QAAQ,QAAQ,aAAa,CAAC,EACtC,MACD;AACD,SAAK,8BAA8B;AACnC,SAAK,yBAAwB,YAAW;AACtC,aAAA,GAAA,KAAA,MAAY,aAAaA,WAAAA,QAAG,sBAAsB,QAAQ,CAAC;;IAQ7D,MAAM,SAASA,WAAAA,QAAG,2BAChB;KACE,GAAG;KACH;KACA,SAAS,CAAC,GAAGD,8BAAAA,QAAQ,QAAQ,EAAE,OAAO;KACtC,iBAAiB;MACf,GAAG,WAAW;MACd;MACA,QAAQ;MACR,qBAAqB;MACrB,aAAa;MACb;MACD;KACF,EACDC,WAAAA,QAAG,KACH,IACD;IAED,MAAM,UAAUA,WAAAA,QAAG,cACjB,OAAO,WACP,OAAO,SACP,KACD;IAED,MAAM,aAAa,QAAQ,MAAM;IAEjC,MAAM,SAASA,WAAAA,QACZ,sBAAsB,QAAQ,CAC9B,OAAO,WAAW,YAAY,CAC9B,QAAO,MAAK,EAAE,aAAaA,WAAAA,QAAG,mBAAmB,MAAM;AAE1D,QAAI,OAAO,SAAS,EAClB,SAAQ,MACNA,WAAAA,QAAG,qCAAqC,QAAQ,KAAK,CACtD;AAGH,WAAA,GAAA,UAAA,sBAA2B;KACzB,YAAY;KACZ;KACD,CAAC;AAEF,WAAO;AACP,YAAQ,IAAI,0BAA0B;;GAEzC;EACF"}
@@ -50,7 +50,7 @@ const readTsConfig = (path$1) => {
50
50
  getCurrentDirectory: () => process.cwd(),
51
51
  getNewLine: () => "\n"
52
52
  }));
53
- return typescript.default.parseJsonConfigFileContent(configFile.config, _host, (0, path.resolve)(path$1.split("/").slice(0, -1).join("/")));
53
+ return typescript.default.parseJsonConfigFileContent(configFile.config, _host, (0, path.dirname)(path$1));
54
54
  };
55
55
  //#endregion
56
56
  exports.readTsConfig = readTsConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.config.cjs","names":["existsSync","ts","path"],"sources":["../../../src/rolldown-config/plugins/typescript.config.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport ts from 'typescript';\n\nconst _readFile = (filePath: string): string | undefined => {\n try {\n return readFileSync(filePath, 'utf-8');\n } catch {\n return undefined;\n }\n};\n\nconst _readDirectory: ts.ParseConfigHost['readDirectory'] = (\n rootDir,\n extensions,\n _,\n __,\n depth,\n): string[] => {\n const results: string[] = [];\n\n const walk = (dir: string, currentDepth: number) => {\n if (depth !== undefined && currentDepth > depth) return;\n\n let entries: string[];\n try {\n entries = readdirSync(dir);\n } catch {\n return;\n }\n\n for (const entry of entries) {\n const fullPath = join(dir, entry);\n let stat;\n try {\n stat = statSync(fullPath);\n } catch {\n continue;\n }\n\n if (stat.isDirectory()) {\n walk(fullPath, currentDepth + 1);\n } else if (\n !extensions ||\n extensions.some(ext => entry.endsWith(ext))\n ) {\n results.push(fullPath);\n }\n }\n };\n\n walk(rootDir, 0);\n return results;\n};\n\nconst _host: ts.ParseConfigHost = {\n useCaseSensitiveFileNames: true,\n readDirectory: _readDirectory,\n fileExists: existsSync,\n readFile: _readFile,\n};\n\nexport const readTsConfig = (path: string) => {\n const configFile = ts.readConfigFile(path, _readFile);\n\n if (configFile.error) {\n throw new Error(\n ts.formatDiagnostic(configFile.error, {\n getCanonicalFileName: f => f,\n getCurrentDirectory: () => process.cwd(),\n getNewLine: () => '\\n',\n }),\n );\n }\n\n const parsedConfig = ts.parseJsonConfigFileContent(\n configFile.config,\n _host,\n resolve(path.split('/').slice(0, -1).join('/')),\n );\n\n return parsedConfig;\n};\n"],"mappings":";;;;;;;AAIA,MAAM,aAAa,aAAyC;AAC1D,KAAI;AACF,UAAA,GAAA,GAAA,cAAoB,UAAU,QAAQ;SAChC;AACN;;;AAIJ,MAAM,kBACJ,SACA,YACA,GACA,IACA,UACa;CACb,MAAM,UAAoB,EAAE;CAE5B,MAAM,QAAQ,KAAa,iBAAyB;AAClD,MAAI,UAAU,KAAA,KAAa,eAAe,MAAO;EAEjD,IAAI;AACJ,MAAI;AACF,cAAA,GAAA,GAAA,aAAsB,IAAI;UACpB;AACN;;AAGF,OAAK,MAAM,SAAS,SAAS;GAC3B,MAAM,YAAA,GAAA,KAAA,MAAgB,KAAK,MAAM;GACjC,IAAI;AACJ,OAAI;AACF,YAAA,GAAA,GAAA,UAAgB,SAAS;WACnB;AACN;;AAGF,OAAI,KAAK,aAAa,CACpB,MAAK,UAAU,eAAe,EAAE;YAEhC,CAAC,cACD,WAAW,MAAK,QAAO,MAAM,SAAS,IAAI,CAAC,CAE3C,SAAQ,KAAK,SAAS;;;AAK5B,MAAK,SAAS,EAAE;AAChB,QAAO;;AAGT,MAAM,QAA4B;CAChC,2BAA2B;CAC3B,eAAe;CACf,YAAYA,GAAAA;CACZ,UAAU;CACX;AAED,MAAa,gBAAgB,WAAiB;CAC5C,MAAM,aAAaC,WAAAA,QAAG,eAAeC,QAAM,UAAU;AAErD,KAAI,WAAW,MACb,OAAM,IAAI,MACRD,WAAAA,QAAG,iBAAiB,WAAW,OAAO;EACpC,uBAAsB,MAAK;EAC3B,2BAA2B,QAAQ,KAAK;EACxC,kBAAkB;EACnB,CAAC,CACH;AASH,QANqBA,WAAAA,QAAG,2BACtB,WAAW,QACX,QAAA,GAAA,KAAA,SACQC,OAAK,MAAM,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,KAAK,IAAI,CAAC,CAChD"}
1
+ {"version":3,"file":"typescript.config.cjs","names":["existsSync","ts","path"],"sources":["../../../src/rolldown-config/plugins/typescript.config.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport ts from 'typescript';\n\nconst _readFile = (filePath: string): string | undefined => {\n try {\n return readFileSync(filePath, 'utf-8');\n } catch {\n return undefined;\n }\n};\n\nconst _readDirectory: ts.ParseConfigHost['readDirectory'] = (\n rootDir,\n extensions,\n _,\n __,\n depth,\n): string[] => {\n const results: string[] = [];\n\n const walk = (dir: string, currentDepth: number) => {\n if (depth !== undefined && currentDepth > depth) return;\n\n let entries: string[];\n try {\n entries = readdirSync(dir);\n } catch {\n return;\n }\n\n for (const entry of entries) {\n const fullPath = join(dir, entry);\n let stat;\n try {\n stat = statSync(fullPath);\n } catch {\n continue;\n }\n\n if (stat.isDirectory()) {\n walk(fullPath, currentDepth + 1);\n } else if (\n !extensions ||\n extensions.some(ext => entry.endsWith(ext))\n ) {\n results.push(fullPath);\n }\n }\n };\n\n walk(rootDir, 0);\n return results;\n};\n\nconst _host: ts.ParseConfigHost = {\n useCaseSensitiveFileNames: true,\n readDirectory: _readDirectory,\n fileExists: existsSync,\n readFile: _readFile,\n};\n\nexport const readTsConfig = (path: string) => {\n const configFile = ts.readConfigFile(path, _readFile);\n\n if (configFile.error) {\n throw new Error(\n ts.formatDiagnostic(configFile.error, {\n getCanonicalFileName: f => f,\n getCurrentDirectory: () => process.cwd(),\n getNewLine: () => '\\n',\n }),\n );\n }\n\n const parsedConfig = ts.parseJsonConfigFileContent(\n configFile.config,\n _host,\n dirname(path),\n );\n\n return parsedConfig;\n};\n"],"mappings":";;;;;;;AAIA,MAAM,aAAa,aAAyC;AAC1D,KAAI;AACF,UAAA,GAAA,GAAA,cAAoB,UAAU,QAAQ;SAChC;AACN;;;AAIJ,MAAM,kBACJ,SACA,YACA,GACA,IACA,UACa;CACb,MAAM,UAAoB,EAAE;CAE5B,MAAM,QAAQ,KAAa,iBAAyB;AAClD,MAAI,UAAU,KAAA,KAAa,eAAe,MAAO;EAEjD,IAAI;AACJ,MAAI;AACF,cAAA,GAAA,GAAA,aAAsB,IAAI;UACpB;AACN;;AAGF,OAAK,MAAM,SAAS,SAAS;GAC3B,MAAM,YAAA,GAAA,KAAA,MAAgB,KAAK,MAAM;GACjC,IAAI;AACJ,OAAI;AACF,YAAA,GAAA,GAAA,UAAgB,SAAS;WACnB;AACN;;AAGF,OAAI,KAAK,aAAa,CACpB,MAAK,UAAU,eAAe,EAAE;YAEhC,CAAC,cACD,WAAW,MAAK,QAAO,MAAM,SAAS,IAAI,CAAC,CAE3C,SAAQ,KAAK,SAAS;;;AAK5B,MAAK,SAAS,EAAE;AAChB,QAAO;;AAGT,MAAM,QAA4B;CAChC,2BAA2B;CAC3B,eAAe;CACf,YAAYA,GAAAA;CACZ,UAAU;CACX;AAED,MAAa,gBAAgB,WAAiB;CAC5C,MAAM,aAAaC,WAAAA,QAAG,eAAeC,QAAM,UAAU;AAErD,KAAI,WAAW,MACb,OAAM,IAAI,MACRD,WAAAA,QAAG,iBAAiB,WAAW,OAAO;EACpC,uBAAsB,MAAK;EAC3B,2BAA2B,QAAQ,KAAK;EACxC,kBAAkB;EACnB,CAAC,CACH;AASH,QANqBA,WAAAA,QAAG,2BACtB,WAAW,QACX,QAAA,GAAA,KAAA,SACQC,OAAK,CACd"}
@@ -1,5 +1,5 @@
1
1
  import { existsSync, readFileSync, readdirSync, statSync } from "fs";
2
- import { join, resolve } from "path";
2
+ import { dirname, join } from "path";
3
3
  import ts from "typescript";
4
4
  //#region src/rolldown-config/plugins/typescript.config.ts
5
5
  const _readFile = (filePath) => {
@@ -47,7 +47,7 @@ const readTsConfig = (path) => {
47
47
  getCurrentDirectory: () => process.cwd(),
48
48
  getNewLine: () => "\n"
49
49
  }));
50
- return ts.parseJsonConfigFileContent(configFile.config, _host, resolve(path.split("/").slice(0, -1).join("/")));
50
+ return ts.parseJsonConfigFileContent(configFile.config, _host, dirname(path));
51
51
  };
52
52
  //#endregion
53
53
  export { readTsConfig };
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.config.js","names":[],"sources":["../../../src/rolldown-config/plugins/typescript.config.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport ts from 'typescript';\n\nconst _readFile = (filePath: string): string | undefined => {\n try {\n return readFileSync(filePath, 'utf-8');\n } catch {\n return undefined;\n }\n};\n\nconst _readDirectory: ts.ParseConfigHost['readDirectory'] = (\n rootDir,\n extensions,\n _,\n __,\n depth,\n): string[] => {\n const results: string[] = [];\n\n const walk = (dir: string, currentDepth: number) => {\n if (depth !== undefined && currentDepth > depth) return;\n\n let entries: string[];\n try {\n entries = readdirSync(dir);\n } catch {\n return;\n }\n\n for (const entry of entries) {\n const fullPath = join(dir, entry);\n let stat;\n try {\n stat = statSync(fullPath);\n } catch {\n continue;\n }\n\n if (stat.isDirectory()) {\n walk(fullPath, currentDepth + 1);\n } else if (\n !extensions ||\n extensions.some(ext => entry.endsWith(ext))\n ) {\n results.push(fullPath);\n }\n }\n };\n\n walk(rootDir, 0);\n return results;\n};\n\nconst _host: ts.ParseConfigHost = {\n useCaseSensitiveFileNames: true,\n readDirectory: _readDirectory,\n fileExists: existsSync,\n readFile: _readFile,\n};\n\nexport const readTsConfig = (path: string) => {\n const configFile = ts.readConfigFile(path, _readFile);\n\n if (configFile.error) {\n throw new Error(\n ts.formatDiagnostic(configFile.error, {\n getCanonicalFileName: f => f,\n getCurrentDirectory: () => process.cwd(),\n getNewLine: () => '\\n',\n }),\n );\n }\n\n const parsedConfig = ts.parseJsonConfigFileContent(\n configFile.config,\n _host,\n resolve(path.split('/').slice(0, -1).join('/')),\n );\n\n return parsedConfig;\n};\n"],"mappings":";;;;AAIA,MAAM,aAAa,aAAyC;AAC1D,KAAI;AACF,SAAO,aAAa,UAAU,QAAQ;SAChC;AACN;;;AAIJ,MAAM,kBACJ,SACA,YACA,GACA,IACA,UACa;CACb,MAAM,UAAoB,EAAE;CAE5B,MAAM,QAAQ,KAAa,iBAAyB;AAClD,MAAI,UAAU,KAAA,KAAa,eAAe,MAAO;EAEjD,IAAI;AACJ,MAAI;AACF,aAAU,YAAY,IAAI;UACpB;AACN;;AAGF,OAAK,MAAM,SAAS,SAAS;GAC3B,MAAM,WAAW,KAAK,KAAK,MAAM;GACjC,IAAI;AACJ,OAAI;AACF,WAAO,SAAS,SAAS;WACnB;AACN;;AAGF,OAAI,KAAK,aAAa,CACpB,MAAK,UAAU,eAAe,EAAE;YAEhC,CAAC,cACD,WAAW,MAAK,QAAO,MAAM,SAAS,IAAI,CAAC,CAE3C,SAAQ,KAAK,SAAS;;;AAK5B,MAAK,SAAS,EAAE;AAChB,QAAO;;AAGT,MAAM,QAA4B;CAChC,2BAA2B;CAC3B,eAAe;CACf,YAAY;CACZ,UAAU;CACX;AAED,MAAa,gBAAgB,SAAiB;CAC5C,MAAM,aAAa,GAAG,eAAe,MAAM,UAAU;AAErD,KAAI,WAAW,MACb,OAAM,IAAI,MACR,GAAG,iBAAiB,WAAW,OAAO;EACpC,uBAAsB,MAAK;EAC3B,2BAA2B,QAAQ,KAAK;EACxC,kBAAkB;EACnB,CAAC,CACH;AASH,QANqB,GAAG,2BACtB,WAAW,QACX,OACA,QAAQ,KAAK,MAAM,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,KAAK,IAAI,CAAC,CAChD"}
1
+ {"version":3,"file":"typescript.config.js","names":[],"sources":["../../../src/rolldown-config/plugins/typescript.config.ts"],"sourcesContent":["import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport ts from 'typescript';\n\nconst _readFile = (filePath: string): string | undefined => {\n try {\n return readFileSync(filePath, 'utf-8');\n } catch {\n return undefined;\n }\n};\n\nconst _readDirectory: ts.ParseConfigHost['readDirectory'] = (\n rootDir,\n extensions,\n _,\n __,\n depth,\n): string[] => {\n const results: string[] = [];\n\n const walk = (dir: string, currentDepth: number) => {\n if (depth !== undefined && currentDepth > depth) return;\n\n let entries: string[];\n try {\n entries = readdirSync(dir);\n } catch {\n return;\n }\n\n for (const entry of entries) {\n const fullPath = join(dir, entry);\n let stat;\n try {\n stat = statSync(fullPath);\n } catch {\n continue;\n }\n\n if (stat.isDirectory()) {\n walk(fullPath, currentDepth + 1);\n } else if (\n !extensions ||\n extensions.some(ext => entry.endsWith(ext))\n ) {\n results.push(fullPath);\n }\n }\n };\n\n walk(rootDir, 0);\n return results;\n};\n\nconst _host: ts.ParseConfigHost = {\n useCaseSensitiveFileNames: true,\n readDirectory: _readDirectory,\n fileExists: existsSync,\n readFile: _readFile,\n};\n\nexport const readTsConfig = (path: string) => {\n const configFile = ts.readConfigFile(path, _readFile);\n\n if (configFile.error) {\n throw new Error(\n ts.formatDiagnostic(configFile.error, {\n getCanonicalFileName: f => f,\n getCurrentDirectory: () => process.cwd(),\n getNewLine: () => '\\n',\n }),\n );\n }\n\n const parsedConfig = ts.parseJsonConfigFileContent(\n configFile.config,\n _host,\n dirname(path),\n );\n\n return parsedConfig;\n};\n"],"mappings":";;;;AAIA,MAAM,aAAa,aAAyC;AAC1D,KAAI;AACF,SAAO,aAAa,UAAU,QAAQ;SAChC;AACN;;;AAIJ,MAAM,kBACJ,SACA,YACA,GACA,IACA,UACa;CACb,MAAM,UAAoB,EAAE;CAE5B,MAAM,QAAQ,KAAa,iBAAyB;AAClD,MAAI,UAAU,KAAA,KAAa,eAAe,MAAO;EAEjD,IAAI;AACJ,MAAI;AACF,aAAU,YAAY,IAAI;UACpB;AACN;;AAGF,OAAK,MAAM,SAAS,SAAS;GAC3B,MAAM,WAAW,KAAK,KAAK,MAAM;GACjC,IAAI;AACJ,OAAI;AACF,WAAO,SAAS,SAAS;WACnB;AACN;;AAGF,OAAI,KAAK,aAAa,CACpB,MAAK,UAAU,eAAe,EAAE;YAEhC,CAAC,cACD,WAAW,MAAK,QAAO,MAAM,SAAS,IAAI,CAAC,CAE3C,SAAQ,KAAK,SAAS;;;AAK5B,MAAK,SAAS,EAAE;AAChB,QAAO;;AAGT,MAAM,QAA4B;CAChC,2BAA2B;CAC3B,eAAe;CACf,YAAY;CACZ,UAAU;CACX;AAED,MAAa,gBAAgB,SAAiB;CAC5C,MAAM,aAAa,GAAG,eAAe,MAAM,UAAU;AAErD,KAAI,WAAW,MACb,OAAM,IAAI,MACR,GAAG,iBAAiB,WAAW,OAAO;EACpC,uBAAsB,MAAK;EAC3B,2BAA2B,QAAQ,KAAK;EACxC,kBAAkB;EACnB,CAAC,CACH;AASH,QANqB,GAAG,2BACtB,WAAW,QACX,OACA,QAAQ,KAAK,CACd"}
@@ -1,6 +1,8 @@
1
+ import { __require } from "../../_virtual/_rolldown/runtime.js";
1
2
  import { toArray } from "../utils.js";
2
3
  import { readTsConfig } from "./typescript.config.js";
3
4
  import { existsSync } from "fs";
5
+ import { dirname, join } from "path";
4
6
  import { replaceTscAliasPaths } from "tsc-alias";
5
7
  import ts from "typescript";
6
8
  //#region src/rolldown-config/plugins/typescript.ts
@@ -20,6 +22,11 @@ const typescript = ({ exclude, include, declarationMap, dir: outDir } = {}) => {
20
22
  const tsconfigPath = ts.findConfigFile(cwd, existsSync, "tsconfig.json");
21
23
  const configFile = readTsConfig(tsconfigPath);
22
24
  const host = ts.createCompilerHost(configFile.options);
25
+ const libLocation = join(dirname(__require.resolve("typescript")), "lib");
26
+ host.getDefaultLibLocation = () => libLocation;
27
+ host.getDefaultLibFileName = (options) => {
28
+ return join(libLocation, ts.getDefaultLibFileName(options));
29
+ };
23
30
  const parsed = ts.parseJsonConfigFileContent({
24
31
  ...configFile,
25
32
  include,
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.js","names":[],"sources":["../../../src/rolldown-config/plugins/typescript.ts"],"sourcesContent":["import { toArray } from '../utils';\nimport { existsSync } from 'node:fs';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { replaceTscAliasPaths } from 'tsc-alias';\nimport ts from 'typescript';\nimport { readTsConfig } from './typescript.config';\n\ntype Props = {\n exclude?: string | string[];\n include?: Record<string, string>;\n declarationMap?: boolean;\n dir?: string;\n};\n\nexport const typescript = ({\n exclude,\n include,\n declarationMap,\n dir: outDir,\n}: Props = {}): RolldownPluginOption => {\n let done = false;\n\n return {\n name: 'bemedev-dts',\n options(opts) {\n const existing = toArray(opts.external).filter(\n v => typeof v === 'string' || v instanceof RegExp,\n );\n opts.external = [...existing, 'source-map-support'];\n return opts;\n },\n closeBundle: {\n order: 'pre',\n async handler() {\n if (done) return;\n const cwd = process.cwd();\n\n const tsconfigPath = ts.findConfigFile(\n cwd,\n existsSync,\n 'tsconfig.json',\n )!;\n\n const configFile = readTsConfig(tsconfigPath);\n const host = ts.createCompilerHost(configFile.options);\n\n const parsed = ts.parseJsonConfigFileContent(\n {\n ...configFile,\n include,\n exclude: [...toArray(exclude), '*.ts'],\n compilerOptions: {\n ...configFile.options,\n outDir,\n noEmit: false,\n emitDeclarationOnly: true,\n declaration: true,\n declarationMap,\n },\n },\n ts.sys,\n cwd,\n );\n\n const program = ts.createProgram(\n parsed.fileNames,\n parsed.options,\n host,\n );\n\n const emitResult = program.emit();\n\n const errors = ts\n .getPreEmitDiagnostics(program)\n .concat(emitResult.diagnostics)\n .filter(d => d.category === ts.DiagnosticCategory.Error);\n\n if (errors.length > 0) {\n console.error(\n ts.formatDiagnosticsWithColorAndContext(errors, host),\n );\n }\n\n await replaceTscAliasPaths({\n configFile: tsconfigPath,\n outDir,\n });\n\n done = true;\n console.log('DTS generation complete');\n },\n },\n };\n};\n"],"mappings":";;;;;;AAcA,MAAa,cAAc,EACzB,SACA,SACA,gBACA,KAAK,WACI,EAAE,KAA2B;CACtC,IAAI,OAAO;AAEX,QAAO;EACL,MAAM;EACN,QAAQ,MAAM;AAIZ,QAAK,WAAW,CAAC,GAHA,QAAQ,KAAK,SAAS,CAAC,QACtC,MAAK,OAAO,MAAM,YAAY,aAAa,OAC5C,EAC6B,qBAAqB;AACnD,UAAO;;EAET,aAAa;GACX,OAAO;GACP,MAAM,UAAU;AACd,QAAI,KAAM;IACV,MAAM,MAAM,QAAQ,KAAK;IAEzB,MAAM,eAAe,GAAG,eACtB,KACA,YACA,gBACD;IAED,MAAM,aAAa,aAAa,aAAa;IAC7C,MAAM,OAAO,GAAG,mBAAmB,WAAW,QAAQ;IAEtD,MAAM,SAAS,GAAG,2BAChB;KACE,GAAG;KACH;KACA,SAAS,CAAC,GAAG,QAAQ,QAAQ,EAAE,OAAO;KACtC,iBAAiB;MACf,GAAG,WAAW;MACd;MACA,QAAQ;MACR,qBAAqB;MACrB,aAAa;MACb;MACD;KACF,EACD,GAAG,KACH,IACD;IAED,MAAM,UAAU,GAAG,cACjB,OAAO,WACP,OAAO,SACP,KACD;IAED,MAAM,aAAa,QAAQ,MAAM;IAEjC,MAAM,SAAS,GACZ,sBAAsB,QAAQ,CAC9B,OAAO,WAAW,YAAY,CAC9B,QAAO,MAAK,EAAE,aAAa,GAAG,mBAAmB,MAAM;AAE1D,QAAI,OAAO,SAAS,EAClB,SAAQ,MACN,GAAG,qCAAqC,QAAQ,KAAK,CACtD;AAGH,UAAM,qBAAqB;KACzB,YAAY;KACZ;KACD,CAAC;AAEF,WAAO;AACP,YAAQ,IAAI,0BAA0B;;GAEzC;EACF"}
1
+ {"version":3,"file":"typescript.js","names":[],"sources":["../../../src/rolldown-config/plugins/typescript.ts"],"sourcesContent":["import { toArray } from '../utils';\nimport { existsSync } from 'node:fs';\nimport type { RolldownPluginOption } from 'rolldown';\nimport { replaceTscAliasPaths } from 'tsc-alias';\nimport ts from 'typescript';\nimport { readTsConfig } from './typescript.config';\nimport { dirname, join } from 'node:path';\n\ntype Props = {\n exclude?: string | string[];\n include?: Record<string, string>;\n declarationMap?: boolean;\n dir?: string;\n};\n\nexport const typescript = ({\n exclude,\n include,\n declarationMap,\n dir: outDir,\n}: Props = {}): RolldownPluginOption => {\n let done = false;\n\n return {\n name: 'bemedev-dts',\n options(opts) {\n const existing = toArray(opts.external).filter(\n v => typeof v === 'string' || v instanceof RegExp,\n );\n opts.external = [...existing, 'source-map-support'];\n return opts;\n },\n closeBundle: {\n order: 'pre',\n async handler() {\n if (done) return;\n const cwd = process.cwd();\n\n const tsconfigPath = ts.findConfigFile(\n cwd,\n existsSync,\n 'tsconfig.json',\n )!;\n\n const configFile = readTsConfig(tsconfigPath);\n const host = ts.createCompilerHost(configFile.options);\n const libLocation = join(\n dirname(require.resolve('typescript')),\n 'lib',\n );\n host.getDefaultLibLocation = () => libLocation;\n host.getDefaultLibFileName = options => {\n return join(libLocation, ts.getDefaultLibFileName(options));\n };\n\n // host.useCaseSensitiveFileNames = () =>\n // ts.sys.useCaseSensitiveFileNames;\n // host.readFile = ts.sys.readFile;\n // host.fileExists = ts.sys.fileExists;\n\n const parsed = ts.parseJsonConfigFileContent(\n {\n ...configFile,\n include,\n exclude: [...toArray(exclude), '*.ts'],\n compilerOptions: {\n ...configFile.options,\n outDir,\n noEmit: false,\n emitDeclarationOnly: true,\n declaration: true,\n declarationMap,\n },\n },\n ts.sys,\n cwd,\n );\n\n const program = ts.createProgram(\n parsed.fileNames,\n parsed.options,\n host,\n );\n\n const emitResult = program.emit();\n\n const errors = ts\n .getPreEmitDiagnostics(program)\n .concat(emitResult.diagnostics)\n .filter(d => d.category === ts.DiagnosticCategory.Error);\n\n if (errors.length > 0) {\n console.error(\n ts.formatDiagnosticsWithColorAndContext(errors, host),\n );\n }\n\n await replaceTscAliasPaths({\n configFile: tsconfigPath,\n outDir,\n });\n\n done = true;\n console.log('DTS generation complete');\n },\n },\n };\n};\n"],"mappings":";;;;;;;;AAeA,MAAa,cAAc,EACzB,SACA,SACA,gBACA,KAAK,WACI,EAAE,KAA2B;CACtC,IAAI,OAAO;AAEX,QAAO;EACL,MAAM;EACN,QAAQ,MAAM;AAIZ,QAAK,WAAW,CAAC,GAHA,QAAQ,KAAK,SAAS,CAAC,QACtC,MAAK,OAAO,MAAM,YAAY,aAAa,OAC5C,EAC6B,qBAAqB;AACnD,UAAO;;EAET,aAAa;GACX,OAAO;GACP,MAAM,UAAU;AACd,QAAI,KAAM;IACV,MAAM,MAAM,QAAQ,KAAK;IAEzB,MAAM,eAAe,GAAG,eACtB,KACA,YACA,gBACD;IAED,MAAM,aAAa,aAAa,aAAa;IAC7C,MAAM,OAAO,GAAG,mBAAmB,WAAW,QAAQ;IACtD,MAAM,cAAc,KAClB,QAAA,UAAgB,QAAQ,aAAa,CAAC,EACtC,MACD;AACD,SAAK,8BAA8B;AACnC,SAAK,yBAAwB,YAAW;AACtC,YAAO,KAAK,aAAa,GAAG,sBAAsB,QAAQ,CAAC;;IAQ7D,MAAM,SAAS,GAAG,2BAChB;KACE,GAAG;KACH;KACA,SAAS,CAAC,GAAG,QAAQ,QAAQ,EAAE,OAAO;KACtC,iBAAiB;MACf,GAAG,WAAW;MACd;MACA,QAAQ;MACR,qBAAqB;MACrB,aAAa;MACb;MACD;KACF,EACD,GAAG,KACH,IACD;IAED,MAAM,UAAU,GAAG,cACjB,OAAO,WACP,OAAO,SACP,KACD;IAED,MAAM,aAAa,QAAQ,MAAM;IAEjC,MAAM,SAAS,GACZ,sBAAsB,QAAQ,CAC9B,OAAO,WAAW,YAAY,CAC9B,QAAO,MAAK,EAAE,aAAa,GAAG,mBAAmB,MAAM;AAE1D,QAAI,OAAO,SAAS,EAClB,SAAQ,MACN,GAAG,qCAAqC,QAAQ,KAAK,CACtD;AAGH,UAAM,qBAAqB;KACzB,YAAY;KACZ;KACD,CAAC;AAEF,WAAO;AACP,YAAQ,IAAI,0BAA0B;;GAEzC;EACF"}
@@ -1 +1 @@
1
- export declare const sleep: (ms: number) => Promise<unknown>;
1
+ export declare const sleep: (ms: number) => any;
@@ -20,9 +20,7 @@ type Plugin = Exclude<ViteUserConfig['plugins'], undefined>[number];
20
20
  * }
21
21
  *</code>
22
22
  */
23
- export declare const createAlias: (tsconfig?: TsConf) => {
24
- [k: string]: string;
25
- };
23
+ export declare const createAlias: (tsconfig?: TsConf) => any;
26
24
  /**
27
25
  * Plugin to add alias from tsconfig to test.alias
28
26
  *
@@ -5,15 +5,9 @@ import type { Args, WithPattern } from './types';
5
5
  * @param args Globs to ignore for test and coverage files
6
6
  * @returns an object with includeTest and includeCoverage string arrays
7
7
  */
8
- export declare function create(args?: Args[1]): Promise<{
9
- files: string[];
10
- coverage: string[];
11
- }>;
8
+ export declare function create(args?: Args[1]): unknown;
12
9
  export declare namespace create {
13
- var withPattern: ({ patternTest, patternCov, }?: Partial<Args[0]>, { ignoreTestFiles, ignoreCoverageFiles }?: Args[1]) => Promise<{
14
- files: string[];
15
- coverage: string[];
16
- }>;
10
+ var withPattern: ({ patternTest, patternCov, }?: Partial<Args[0]>, { ignoreTestFiles, ignoreCoverageFiles }?: Args[1]) => unknown;
17
11
  }
18
12
  /**
19
13
  * Plugin to add files with glob patterns to vitest
@@ -26,7 +20,7 @@ export declare namespace create {
26
20
  * You don't have to use test.exclude.
27
21
  * The default search patter is './src/**\/*.ts'
28
22
  */
29
- export declare function exclude(args?: Args[1]): import("vite").Plugin<any>;
23
+ export declare function exclude(args?: Args[1]): Exclude<Exclude<T, undefined>, any>;
30
24
  export declare namespace exclude {
31
25
  var withPattern: WithPattern;
32
26
  }
@@ -1,4 +1,4 @@
1
1
  export declare const hasSrc: () => boolean;
2
2
  export declare const defaultCovPattern: () => string;
3
- export declare const buildInclude: (pattern: string | string[], ignore?: string[]) => Promise<string[]>;
3
+ export declare const buildInclude: (pattern: string | string[], ignore?: string[]) => unknown;
4
4
  export declare const testPattern: () => string;
@@ -41,8 +41,8 @@ export declare const createTests: {
41
41
  toError?: ToError_F<F>;
42
42
  }): {
43
43
  acceptation: () => void;
44
- success: (...cases: import("./types").TestArgs<import("./types").ChainedFn<F, T>>) => () => void;
45
- fails: (...cases: import("./types").TestErrors<import("./types").ChainedFn<F, T>>) => () => void;
44
+ success: (...cases: import("./types").TestArgs<import("./types").ChainedFn<F_1, T_1>>) => () => void;
45
+ fails: (...cases: import("./types").TestErrors<import("./types").ChainedFn<F_1, T_1>>) => () => void;
46
46
  };
47
47
  withImplementation<F extends Fn, T extends NextFn<F> = Identity<F>>(f: F, { instanciation, name, transform, toError, }: {
48
48
  instanciation: () => Promise<F> | F;
@@ -51,8 +51,8 @@ export declare const createTests: {
51
51
  toError?: ToError_F<F>;
52
52
  }): {
53
53
  acceptation: () => void;
54
- success: (...cases: import("./types").TestArgs<import("./types").ChainedFn<import("vitest").Mock<F>, NextFn<import("vitest").Mock<F>>>>) => () => void;
55
- fails: (...cases: import("./types").TestErrors<import("./types").ChainedFn<import("vitest").Mock<F>, NextFn<import("vitest").Mock<F>>>>) => () => void;
54
+ success: (...cases: import("./types").TestArgs<import("./types").ChainedFn<F_1, T_1>>) => () => void;
55
+ fails: (...cases: import("./types").TestErrors<import("./types").ChainedFn<F_1, T_1>>) => () => void;
56
56
  };
57
57
  withoutImplementation: /*elided*/ any;
58
58
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bemedev/dev-utils",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "A collection of utilities for Node.js development, including build tools, testing utilities, and configuration management.",
5
5
  "author": {
6
6
  "email": "bri_lvi@icloud.com",