smartbundle 0.12.3 → 0.13.0-alpha.0

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.
Files changed (73) hide show
  1. package/__compiled__/cjs/src/PrettyErrors.d.ts +2 -0
  2. package/__compiled__/cjs/src/PrettyErrors.js +6 -0
  3. package/__compiled__/cjs/src/PrettyErrors.js.map +1 -0
  4. package/__compiled__/cjs/src/createViteConfig.d.ts +2 -1
  5. package/__compiled__/cjs/src/createViteConfig.js +8 -35
  6. package/__compiled__/cjs/src/createViteConfig.js.map +1 -1
  7. package/__compiled__/cjs/src/detectModules.d.ts +14 -2
  8. package/__compiled__/cjs/src/detectModules.js +58 -9
  9. package/__compiled__/cjs/src/detectModules.js.map +1 -1
  10. package/__compiled__/cjs/src/index.d.ts +6 -2
  11. package/__compiled__/cjs/src/index.js +20 -3
  12. package/__compiled__/cjs/src/index.js.map +1 -1
  13. package/__compiled__/cjs/src/plugins/babel/index.js +2 -6
  14. package/__compiled__/cjs/src/plugins/babel/index.js.map +1 -1
  15. package/__compiled__/cjs/src/plugins/imports/ImportError.d.ts +7 -0
  16. package/__compiled__/cjs/src/plugins/imports/ImportError.js +35 -0
  17. package/__compiled__/cjs/src/plugins/imports/ImportError.js.map +1 -0
  18. package/__compiled__/cjs/src/plugins/imports/index.d.ts +3 -0
  19. package/__compiled__/cjs/src/plugins/imports/index.js +89 -0
  20. package/__compiled__/cjs/src/plugins/imports/index.js.map +1 -0
  21. package/__compiled__/cjs/src/promiseSettledResultErrors.js +1 -1
  22. package/__compiled__/cjs/src/promiseSettledResultErrors.js.map +1 -1
  23. package/__compiled__/cjs/src/run.js +13 -4
  24. package/__compiled__/cjs/src/run.js.map +1 -1
  25. package/__compiled__/cjs/src/tasks/buildTypesTask/callTypescript.d.ts +2 -1
  26. package/__compiled__/cjs/src/tasks/buildTypesTask/callTypescript.js +13 -34
  27. package/__compiled__/cjs/src/tasks/buildTypesTask/callTypescript.js.map +1 -1
  28. package/__compiled__/cjs/src/tasks/buildTypesTask/findTypingsNames.d.ts +2 -1
  29. package/__compiled__/cjs/src/tasks/buildTypesTask/findTypingsNames.js +12 -30
  30. package/__compiled__/cjs/src/tasks/buildTypesTask/findTypingsNames.js.map +1 -1
  31. package/__compiled__/cjs/src/tasks/buildTypesTask/findTypingsPackages.d.ts +2 -1
  32. package/__compiled__/cjs/src/tasks/buildTypesTask/findTypingsPackages.js +13 -13
  33. package/__compiled__/cjs/src/tasks/buildTypesTask/findTypingsPackages.js.map +1 -1
  34. package/__compiled__/cjs/src/tasks/viteTask.d.ts +1 -11
  35. package/__compiled__/cjs/src/tasks/viteTask.js +11 -5
  36. package/__compiled__/cjs/src/tasks/viteTask.js.map +1 -1
  37. package/__compiled__/esm/src/PrettyErrors.d.mts +2 -0
  38. package/__compiled__/esm/src/PrettyErrors.mjs +6 -0
  39. package/__compiled__/esm/src/PrettyErrors.mjs.map +1 -0
  40. package/__compiled__/esm/src/createViteConfig.d.mts +2 -1
  41. package/__compiled__/esm/src/createViteConfig.mjs +4 -31
  42. package/__compiled__/esm/src/createViteConfig.mjs.map +1 -1
  43. package/__compiled__/esm/src/detectModules.d.mts +14 -2
  44. package/__compiled__/esm/src/detectModules.mjs +59 -10
  45. package/__compiled__/esm/src/detectModules.mjs.map +1 -1
  46. package/__compiled__/esm/src/index.d.mts +6 -2
  47. package/__compiled__/esm/src/index.mjs +20 -3
  48. package/__compiled__/esm/src/index.mjs.map +1 -1
  49. package/__compiled__/esm/src/plugins/babel/index.mjs +2 -6
  50. package/__compiled__/esm/src/plugins/babel/index.mjs.map +1 -1
  51. package/__compiled__/esm/src/plugins/imports/ImportError.d.mts +7 -0
  52. package/__compiled__/esm/src/plugins/imports/ImportError.mjs +35 -0
  53. package/__compiled__/esm/src/plugins/imports/ImportError.mjs.map +1 -0
  54. package/__compiled__/esm/src/plugins/imports/index.d.mts +3 -0
  55. package/__compiled__/esm/src/plugins/imports/index.mjs +72 -0
  56. package/__compiled__/esm/src/plugins/imports/index.mjs.map +1 -0
  57. package/__compiled__/esm/src/promiseSettledResultErrors.mjs +1 -1
  58. package/__compiled__/esm/src/promiseSettledResultErrors.mjs.map +1 -1
  59. package/__compiled__/esm/src/run.mjs +13 -4
  60. package/__compiled__/esm/src/run.mjs.map +1 -1
  61. package/__compiled__/esm/src/tasks/buildTypesTask/callTypescript.d.mts +2 -1
  62. package/__compiled__/esm/src/tasks/buildTypesTask/callTypescript.mjs +13 -34
  63. package/__compiled__/esm/src/tasks/buildTypesTask/callTypescript.mjs.map +1 -1
  64. package/__compiled__/esm/src/tasks/buildTypesTask/findTypingsNames.d.mts +2 -1
  65. package/__compiled__/esm/src/tasks/buildTypesTask/findTypingsNames.mjs +3 -4
  66. package/__compiled__/esm/src/tasks/buildTypesTask/findTypingsNames.mjs.map +1 -1
  67. package/__compiled__/esm/src/tasks/buildTypesTask/findTypingsPackages.d.mts +2 -1
  68. package/__compiled__/esm/src/tasks/buildTypesTask/findTypingsPackages.mjs +5 -4
  69. package/__compiled__/esm/src/tasks/buildTypesTask/findTypingsPackages.mjs.map +1 -1
  70. package/__compiled__/esm/src/tasks/viteTask.d.mts +1 -11
  71. package/__compiled__/esm/src/tasks/viteTask.mjs +11 -5
  72. package/__compiled__/esm/src/tasks/viteTask.mjs.map +1 -1
  73. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"findTypingsNames.mjs","sources":["../../../../../../src/tasks/buildTypesTask/findTypingsNames.ts"],"sourcesContent":["import * as ts from \"typescript\";\nimport { join, relative } from \"node:path\";\nimport { readdirSync, statSync } from \"node:fs\";\n\nfunction createCompilerHostWithVirtualSource(sourceDir: string) {\n return ts.createCompilerHost({\n target: ts.ScriptTarget.ESNext,\n moduleResolution: ts.ModuleResolutionKind.NodeNext,\n baseUrl: \".\",\n sourceRoot: sourceDir,\n noEmit: true,\n emitDeclarationOnly: true,\n noEmitOnError: true,\n });\n}\n\n/*\nChatGPT told me we need to specify all files in rootNames for the program to work correctly.\n */\nfunction collectAllFilesInDir(sourceDir: string, ext: string) {\n const files = readdirSync(sourceDir);\n const ret = new Array<string>();\n for (const file of files) {\n // check if the file is a directory\n const stat = statSync(join(sourceDir, file));\n if (stat.isDirectory()) {\n ret.push(...collectAllFilesInDir(join(sourceDir, file), ext));\n } else if (file.endsWith(ext)) {\n ret.push(join(sourceDir, file));\n }\n }\n\n return ret;\n}\n\nexport function findTypingsNames(\n entrypoint: string,\n sourceDir: string,\n ext: string,\n) {\n const host = createCompilerHostWithVirtualSource(sourceDir);\n const program = ts.createProgram({\n rootNames: collectAllFilesInDir(sourceDir, ext),\n options: {},\n host,\n });\n\n const packages = new Set<string>();\n const processedFiles = new Set<string>();\n const filesQueue = [relative(sourceDir, entrypoint)];\n\n function processModuleSpecifier(moduleSpecifier: ts.StringLiteral) {\n const moduleName = moduleSpecifier.text;\n if (moduleName.startsWith(\".\")) {\n filesQueue.push(moduleName.replace(/\\.js$/, ext));\n return;\n }\n\n packages.add(moduleName);\n }\n\n while (filesQueue.length > 0) {\n const relativeCurrentFile = filesQueue.pop()!;\n const currentFile = join(sourceDir, relativeCurrentFile);\n if (processedFiles.has(currentFile)) continue;\n\n const sourceFile = program.getSourceFile(currentFile);\n if (!sourceFile) continue;\n\n function visit(node: ts.Node) {\n // import \"moduleSpecifier\";\n if (\n ts.isImportDeclaration(node) &&\n ts.isStringLiteral(node.moduleSpecifier)\n ) {\n processModuleSpecifier(node.moduleSpecifier);\n }\n\n // Generic<import(\"node\")>;\n if (\n ts.isImportTypeNode(node) &&\n ts.isLiteralTypeNode(node.argument) &&\n ts.isStringLiteral(node.argument.literal)\n ) {\n processModuleSpecifier(node.argument.literal);\n }\n\n // export * from \"moduleSpecifier\";\n if (\n ts.isExportDeclaration(node) &&\n node.moduleSpecifier &&\n ts.isStringLiteral(node.moduleSpecifier)\n ) {\n processModuleSpecifier(node.moduleSpecifier);\n }\n\n ts.forEachChild(node, visit);\n }\n\n processedFiles.add(currentFile);\n\n ts.forEachChild(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B,UAAA,GAAG,oBAAoB,IAAI,KAC3B,GAAG,gBAAgB,KAAK,eAAe,GACvC;AACA,+BAAuB,KAAK,eAAe;AAAA,MAAA;AAI7C,UACE,GAAG,iBAAiB,IAAI,KACxB,GAAG,kBAAkB,KAAK,QAAQ,KAClC,GAAG,gBAAgB,KAAK,SAAS,OAAO,GACxC;AACuB,+BAAA,KAAK,SAAS,OAAO;AAAA,MAAA;AAK5C,UAAA,GAAG,oBAAoB,IAAI,KAC3B,KAAK,mBACL,GAAG,gBAAgB,KAAK,eAAe,GACvC;AACA,+BAAuB,KAAK,eAAe;AAAA,MAAA;AAG1C,SAAA,aAAa,MAAM,KAAK;AAAA,IAC7B;AAnCM,UAAA,sBAAsB,WAAW,IAAI;AACrC,UAAA,cAAc,KAAK,WAAW,mBAAmB;AACnD,QAAA,eAAe,IAAI,WAAW,EAAG;AAE/B,UAAA,aAAa,QAAQ,cAAc,WAAW;AACpD,QAAI,CAAC,WAAY;AAgCjB,mBAAe,IAAI,WAAW;AAE3B,OAAA,aAAa,YAAY,KAAK;AAAA,EAAA;AAG5B,SAAA;AACT;"}
1
+ {"version":3,"file":"findTypingsNames.mjs","sources":["../../../../../../src/tasks/buildTypesTask/findTypingsNames.ts"],"sourcesContent":["import type * as ts from \"typescript\";\nimport { join, relative } from \"node:path\";\nimport { readdirSync, statSync } from \"node:fs\";\nimport type { TS } from \"../../detectModules.js\";\n\nfunction createCompilerHostWithVirtualSource(ts: TS[\"ts\"], sourceDir: string) {\n return ts.createCompilerHost({\n target: ts.ScriptTarget.ESNext,\n moduleResolution: ts.ModuleResolutionKind.NodeNext,\n baseUrl: \".\",\n sourceRoot: sourceDir,\n noEmit: true,\n emitDeclarationOnly: true,\n noEmitOnError: true,\n });\n}\n\n/*\nChatGPT told me we need to specify all files in rootNames for the program to work correctly.\n */\nfunction collectAllFilesInDir(sourceDir: string, ext: string) {\n const files = readdirSync(sourceDir);\n const ret = new Array<string>();\n for (const file of files) {\n // check if the file is a directory\n const stat = statSync(join(sourceDir, file));\n if (stat.isDirectory()) {\n ret.push(...collectAllFilesInDir(join(sourceDir, file), ext));\n } else if (file.endsWith(ext)) {\n ret.push(join(sourceDir, file));\n }\n }\n\n return ret;\n}\n\nexport function findTypingsNames(\n { ts }: TS,\n entrypoint: string,\n sourceDir: string,\n ext: string,\n) {\n const host = createCompilerHostWithVirtualSource(ts, sourceDir);\n const program = ts.createProgram({\n rootNames: collectAllFilesInDir(sourceDir, ext),\n options: {},\n host,\n });\n\n const packages = new Set<string>();\n const processedFiles = new Set<string>();\n const filesQueue = [relative(sourceDir, entrypoint)];\n\n function processModuleSpecifier(moduleSpecifier: ts.StringLiteral) {\n const moduleName = moduleSpecifier.text;\n if (moduleName.startsWith(\".\")) {\n filesQueue.push(moduleName.replace(/\\.js$/, ext));\n return;\n }\n\n packages.add(moduleName);\n }\n\n while (filesQueue.length > 0) {\n const relativeCurrentFile = filesQueue.pop()!;\n const currentFile = join(sourceDir, relativeCurrentFile);\n if (processedFiles.has(currentFile)) continue;\n\n const sourceFile = program.getSourceFile(currentFile);\n if (!sourceFile) continue;\n\n function visit(node: ts.Node) {\n // import \"moduleSpecifier\";\n if (\n ts.isImportDeclaration(node) &&\n ts.isStringLiteral(node.moduleSpecifier)\n ) {\n processModuleSpecifier(node.moduleSpecifier);\n }\n\n // Generic<import(\"node\")>;\n if (\n ts.isImportTypeNode(node) &&\n ts.isLiteralTypeNode(node.argument) &&\n ts.isStringLiteral(node.argument.literal)\n ) {\n processModuleSpecifier(node.argument.literal);\n }\n\n // export * from \"moduleSpecifier\";\n if (\n ts.isExportDeclaration(node) &&\n node.moduleSpecifier &&\n ts.isStringLiteral(node.moduleSpecifier)\n ) {\n processModuleSpecifier(node.moduleSpecifier);\n }\n\n ts.forEachChild(node, visit);\n }\n\n processedFiles.add(currentFile);\n\n ts.forEachChild(sourceFile, visit);\n }\n\n return packages;\n}\n"],"names":[],"mappings":";;AAKA,SAAS,oCAAoC,IAAc,WAAmB;AAC5E,S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GACvC;AACA,+BAAuB,KAAK,eAAe;AAAA,MAAA;AAI7C,UACE,GAAG,iBAAiB,IAAI,KACxB,GAAG,kBAAkB,KAAK,QAAQ,KAClC,GAAG,gBAAgB,KAAK,SAAS,OAAO,GACxC;AACuB,+BAAA,KAAK,SAAS,OAAO;AAAA,MAAA;AAK5C,UAAA,GAAG,oBAAoB,IAAI,KAC3B,KAAK,mBACL,GAAG,gBAAgB,KAAK,eAAe,GACvC;AACA,+BAAuB,KAAK,eAAe;AAAA,MAAA;AAG1C,SAAA,aAAa,MAAM,KAAK;AAAA,IAC7B;AAnCM,UAAA,sBAAsB,WAAW,IAAI;AACrC,UAAA,cAAc,KAAK,WAAW,mBAAmB;AACnD,QAAA,eAAe,IAAI,WAAW,EAAG;AAE/B,UAAA,aAAa,QAAQ,cAAc,WAAW;AACpD,QAAI,CAAC,WAAY;AAgCjB,mBAAe,IAAI,WAAW;AAE3B,OAAA,aAAa,YAAY,KAAK;AAAA,EAAA;AAG5B,SAAA;AACT;"}
@@ -1,4 +1,5 @@
1
- export declare function findTypingsPackages(packages: Set<string>, sourceDir: string): {
1
+ import type { TS } from "../../detectModules.js";
2
+ export declare function findTypingsPackages({ ts }: TS, packages: Set<string>, sourceDir: string): {
2
3
  missingTypings: Set<string>;
3
4
  existingTypingPackages: Set<string>;
4
5
  };
@@ -1,6 +1,5 @@
1
- import * as ts from "typescript";
2
1
  import * as path from "node:path";
3
- function createVirtualHostFunctions(virtualFilePath, virtualSourceContent, originalHost) {
2
+ function createVirtualHostFunctions(ts, virtualFilePath, virtualSourceContent, originalHost) {
4
3
  const getSourceFile = (fileName, languageVersion) => {
5
4
  if (fileName === virtualFilePath) {
6
5
  return ts.createSourceFile(
@@ -29,7 +28,7 @@ function createVirtualHostFunctions(virtualFilePath, virtualSourceContent, origi
29
28
  readFile
30
29
  };
31
30
  }
32
- function createCompilerHostWithVirtualSource(packages, sourceDir) {
31
+ function createCompilerHostWithVirtualSource(ts, packages, sourceDir) {
33
32
  const virtualSourceContent = [...packages].map((p) => `import "${p}";`).join("\n") + // for ignoring the `Generated an empty chunk: "."` error
34
33
  "export const a = 1;\n";
35
34
  const virtualFilePath = path.join(sourceDir, "virtual.ts");
@@ -46,6 +45,7 @@ function createCompilerHostWithVirtualSource(packages, sourceDir) {
46
45
  }
47
46
  });
48
47
  const virtualFunctions = createVirtualHostFunctions(
48
+ ts,
49
49
  virtualFilePath,
50
50
  virtualSourceContent,
51
51
  originalHost
@@ -59,8 +59,9 @@ function createCompilerHostWithVirtualSource(packages, sourceDir) {
59
59
  virtualFilePath
60
60
  };
61
61
  }
62
- function findTypingsPackages(packages, sourceDir) {
62
+ function findTypingsPackages({ ts }, packages, sourceDir) {
63
63
  const { host, virtualFilePath } = createCompilerHostWithVirtualSource(
64
+ ts,
64
65
  packages,
65
66
  sourceDir
66
67
  );
@@ -1 +1 @@
1
- {"version":3,"file":"findTypingsPackages.mjs","sources":["../../../../../../src/tasks/buildTypesTask/findTypingsPackages.ts"],"sourcesContent":["import * as ts from \"typescript\";\nimport * as path from \"node:path\";\n\ntype HostFunctions = {\n getSourceFile: ts.CompilerHost[\"getSourceFile\"];\n fileExists: ts.CompilerHost[\"fileExists\"];\n readFile: ts.CompilerHost[\"readFile\"];\n};\n\nfunction createVirtualHostFunctions(\n virtualFilePath: string,\n virtualSourceContent: string,\n originalHost: ts.CompilerHost,\n): HostFunctions {\n const getSourceFile: ts.CompilerHost[\"getSourceFile\"] = (\n fileName,\n languageVersion,\n ) => {\n if (fileName === virtualFilePath) {\n return ts.createSourceFile(\n fileName,\n virtualSourceContent,\n languageVersion,\n );\n }\n return originalHost.getSourceFile(fileName, languageVersion);\n };\n\n const fileExists: ts.CompilerHost[\"fileExists\"] = (fileName) => {\n if (fileName === virtualFilePath) {\n return true;\n }\n return originalHost.fileExists(fileName);\n };\n\n const readFile: ts.CompilerHost[\"readFile\"] = (fileName) => {\n if (fileName === virtualFilePath) {\n return virtualSourceContent;\n }\n return originalHost.readFile(fileName);\n };\n\n return {\n getSourceFile,\n fileExists,\n readFile,\n };\n}\n\nfunction createCompilerHostWithVirtualSource(\n packages: Set<string>,\n sourceDir: string,\n) {\n const virtualSourceContent =\n [...packages].map((p) => `import \"${p}\";`).join(\"\\n\") +\n // for ignoring the `Generated an empty chunk: \".\"` error\n \"export const a = 1;\\n\";\n const virtualFilePath = path.join(sourceDir, \"virtual.ts\");\n\n const originalHost = ts.createCompilerHost({\n target: ts.ScriptTarget.ESNext,\n moduleResolution: ts.ModuleResolutionKind.NodeNext,\n baseUrl: \".\",\n sourceRoot: sourceDir,\n noEmit: true,\n emitDeclarationOnly: true,\n noEmitOnError: true,\n paths: {\n \"*\": [\"node_modules/*\"],\n },\n });\n const virtualFunctions = createVirtualHostFunctions(\n virtualFilePath,\n virtualSourceContent,\n originalHost,\n );\n\n return {\n host: new Proxy(originalHost, {\n get(target, prop: keyof ts.CompilerHost) {\n return virtualFunctions[prop as keyof HostFunctions] || target[prop];\n },\n }),\n virtualFilePath,\n };\n}\n\nexport function findTypingsPackages(packages: Set<string>, sourceDir: string) {\n const { host, virtualFilePath } = createCompilerHostWithVirtualSource(\n packages,\n sourceDir,\n );\n\n const program = ts.createProgram({\n rootNames: [virtualFilePath],\n options: {},\n host: host,\n });\n\n const sourceFile = program.getSourceFile(virtualFilePath);\n if (!sourceFile) {\n throw new Error(\n \"[getSourceFile] Impossible error inside findMissingTypings\",\n );\n }\n\n const missingTypings = new Set<string>();\n const existingTypingPackages = new Set<string>();\n sourceFile.forEachChild((node) => {\n if (ts.isImportDeclaration(node)) {\n const moduleSpecifier = node.moduleSpecifier;\n if (ts.isStringLiteral(moduleSpecifier)) {\n const moduleResolution = ts.resolveModuleName(\n moduleSpecifier.text,\n virtualFilePath,\n {},\n host,\n );\n\n if (!moduleResolution?.resolvedModule?.packageId) {\n missingTypings.add(moduleSpecifier.text);\n } else {\n existingTypingPackages.add(\n moduleResolution.resolvedModule.packageId.name,\n );\n }\n }\n }\n });\n\n return { missingTypings, existingT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AAA,IACD;AAAA,EACF;AACF;AAEgB,SAAA,oBAAoB,UAAuB,WAAmB;AACtE,QAAA,EAAE,MAAM,gBAAA,IAAoB;AAAA,IAChC;AAAA,IACA;AAAA,EACF;AAEM,QAAA,UAAU,GAAG,cAAc;AAAA,IAC/B,WAAW,CAAC,eAAe;AAAA,IAC3B,SAAS,CAAC;AAAA,IACV;AAAA,EAAA,CACD;AAEK,QAAA,aAAa,QAAQ,cAAc,eAAe;AACxD,MAAI,CAAC,YAAY;AACf,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EAAA;AAGI,QAAA,qCAAqB,IAAY;AACjC,QAAA,6CAA6B,IAAY;AACpC,aAAA,aAAa,CAAC,SAAS;;AAC5B,QAAA,GAAG,oBAAoB,IAAI,GAAG;AAChC,YAAM,kBAAkB,KAAK;AACzB,UAAA,GAAG,gBAAgB,eAAe,GAAG;AACvC,cAAM,mBAAmB,GAAG;AAAA,UAC1B,gBAAgB;AAAA,UAChB;AAAA,UACA,CAAC;AAAA,UACD;AAAA,QACF;AAEI,YAAA,GAAC,0DAAkB,mBAAlB,mBAAkC,YAAW;AACjC,yBAAA,IAAI,gBAAgB,IAAI;AAAA,QAAA,OAClC;AACkB,iCAAA;AAAA,YACrB,iBAAiB,eAAe,UAAU;AAAA,UAC5C;AAAA,QAAA;AAAA,MACF;AAAA,IACF;AAAA,EACF,CACD;AAEM,SAAA,EAAE,gBAAgB,uBAAuB;AAClD;"}
1
+ {"version":3,"file":"findTypingsPackages.mjs","sources":["../../../../../../src/tasks/buildTypesTask/findTypingsPackages.ts"],"sourcesContent":["import type * as ts from \"typescript\";\nimport * as path from \"node:path\";\nimport type { TS } from \"../../detectModules.js\";\n\ntype HostFunctions = {\n getSourceFile: ts.CompilerHost[\"getSourceFile\"];\n fileExists: ts.CompilerHost[\"fileExists\"];\n readFile: ts.CompilerHost[\"readFile\"];\n};\n\nfunction createVirtualHostFunctions(\n ts: TS[\"ts\"],\n virtualFilePath: string,\n virtualSourceContent: string,\n originalHost: ts.CompilerHost,\n): HostFunctions {\n const getSourceFile: ts.CompilerHost[\"getSourceFile\"] = (\n fileName,\n languageVersion,\n ) => {\n if (fileName === virtualFilePath) {\n return ts.createSourceFile(\n fileName,\n virtualSourceContent,\n languageVersion,\n );\n }\n return originalHost.getSourceFile(fileName, languageVersion);\n };\n\n const fileExists: ts.CompilerHost[\"fileExists\"] = (fileName) => {\n if (fileName === virtualFilePath) {\n return true;\n }\n return originalHost.fileExists(fileName);\n };\n\n const readFile: ts.CompilerHost[\"readFile\"] = (fileName) => {\n if (fileName === virtualFilePath) {\n return virtualSourceContent;\n }\n return originalHost.readFile(fileName);\n };\n\n return {\n getSourceFile,\n fileExists,\n readFile,\n };\n}\n\nfunction createCompilerHostWithVirtualSource(\n ts: TS[\"ts\"],\n packages: Set<string>,\n sourceDir: string,\n) {\n const virtualSourceContent =\n [...packages].map((p) => `import \"${p}\";`).join(\"\\n\") +\n // for ignoring the `Generated an empty chunk: \".\"` error\n \"export const a = 1;\\n\";\n const virtualFilePath = path.join(sourceDir, \"virtual.ts\");\n\n const originalHost = ts.createCompilerHost({\n target: ts.ScriptTarget.ESNext,\n moduleResolution: ts.ModuleResolutionKind.NodeNext,\n baseUrl: \".\",\n sourceRoot: sourceDir,\n noEmit: true,\n emitDeclarationOnly: true,\n noEmitOnError: true,\n paths: {\n \"*\": [\"node_modules/*\"],\n },\n });\n const virtualFunctions = createVirtualHostFunctions(\n ts,\n virtualFilePath,\n virtualSourceContent,\n originalHost,\n );\n\n return {\n host: new Proxy(originalHost, {\n get(target, prop: keyof ts.CompilerHost) {\n return virtualFunctions[prop as keyof HostFunctions] || target[prop];\n },\n }),\n virtualFilePath,\n };\n}\n\nexport function findTypingsPackages(\n { ts }: TS,\n packages: Set<string>,\n sourceDir: string,\n) {\n const { host, virtualFilePath } = createCompilerHostWithVirtualSource(\n ts,\n packages,\n sourceDir,\n );\n\n const program = ts.createProgram({\n rootNames: [virtualFilePath],\n options: {},\n host: host,\n });\n\n const sourceFile = program.getSourceFile(virtualFilePath);\n if (!sourceFile) {\n throw new Error(\n \"[getSourceFile] Impossible error inside findMissingTypings\",\n );\n }\n\n const missingTypings = new Set<string>();\n const existingTypingPackages = new Set<string>();\n sourceFile.forEachChild((node) => {\n if (ts.isImportDeclaration(node)) {\n const moduleSpecifier = node.moduleSpecifier;\n if (ts.isStringLiteral(moduleSpecifier)) {\n const moduleResolution = ts.resolveModuleName(\n moduleSpecifier.text,\n virtualFilePath,\n {},\n host,\n );\n\n if (!moduleResolution?.resolvedModule?.packageId) {\n missingTypings.add(moduleSpecifier.text);\n } else {\n existingTypingPackages.add(\n moduleResolution.resolvedModule.packageId.name,\n );\n }\n }\n }\n });\n\n return { missingTypings, existingTypingPackages };\n}\n"],"names":[],"mappings":";AAUA,SAAS,2BACP,IACA,iBACA,sBACA,cACe;AACT,QAAA,gBAAkD,CACtD,UACA,oBACG;AACH,QAAI,aAAa,iBAAiB;AAChC,aAAO,GAAG;AAAA,QACR;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAAA;AAEK,WAAA,aAAa,cAAc,UAAU,eAAe;AAAA,EAC7D;AAEM,QAAA,aAA4C,CAAC,aAAa;AAC9D,QAAI,aAAa,iBAAiB;AACzB,aAAA;AAAA,IAAA;AAEF,WAAA,aAAa,WAAW,QAAQ;AAAA,EACzC;AAEM,QAAA,WAAwC,CAAC,aAAa;AAC1D,QAAI,aAAa,iBAAiB;AACzB,aAAA;AAAA,IAAA;AAEF,WAAA,aAAa,SAAS,QAAQ;AAAA,EACvC;AAEO,SAAA;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,SAAS,oCACP,IACA,UACA,WACA;AACA,QAAM,uBACJ,CAAC,GAAG,QAAQ,EAAE,IAAI,CAAC,MAAM,WAAW,CAAC,IAAI,EAAE,KAAK,IAAI;AAAA,EAEpD;AACF,QAAM,kBAAkB,KAAK,KAAK,WAAW,YAAY;AAEnD,QAAA,eAAe,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AA,OAClC;AACkB,iCAAA;AAAA,YACrB,iBAAiB,eAAe,UAAU;AAAA,UAC5C;AAAA,QAAA;AAAA,MACF;AAAA,IACF;AAAA,EACF,CACD;AAEM,SAAA,EAAE,gBAAgB,uBAAuB;AAClD;"}
@@ -1,16 +1,6 @@
1
- import { type UserConfig, type Rollup } from "vite";
1
+ import { type UserConfig } from "vite";
2
2
  type ViteTaskParams = {
3
3
  viteConfig: UserConfig;
4
4
  };
5
- type BuildSuccess = {
6
- error: false;
7
- output: Rollup.OutputChunk[];
8
- };
9
- type BuildErrorType = {
10
- error: true;
11
- errors: Array<string>;
12
- };
13
- type BuildResult = BuildSuccess | BuildErrorType;
14
- export declare function buildVite({ viteConfig, }: ViteTaskParams): Promise<BuildResult>;
15
5
  export declare function viteTask({ viteConfig }: ViteTaskParams): Promise<any>;
16
6
  export {};
@@ -2,9 +2,8 @@ import { build } from "vite";
2
2
  import { errors } from "../errors.mjs";
3
3
  import { okLog } from "../log.mjs";
4
4
  import { BuildError } from "../error.mjs";
5
- async function buildVite({
6
- viteConfig
7
- }) {
5
+ import { PrettyError } from "../PrettyErrors.mjs";
6
+ async function buildVite({ viteConfig }) {
8
7
  try {
9
8
  const outputs = await build(viteConfig);
10
9
  if (!Array.isArray(outputs)) {
@@ -20,6 +19,12 @@ async function buildVite({
20
19
  )
21
20
  };
22
21
  } catch (e) {
22
+ if (e instanceof PrettyError) {
23
+ return {
24
+ error: true,
25
+ errors: [e]
26
+ };
27
+ }
23
28
  if (e instanceof Error) {
24
29
  return {
25
30
  error: true,
@@ -35,13 +40,14 @@ async function buildVite({
35
40
  async function viteTask({ viteConfig }) {
36
41
  const outputs = await buildVite({ viteConfig });
37
42
  if (outputs.error) {
38
- throw outputs.errors.map((e) => new BuildError(e));
43
+ throw outputs.errors.map(
44
+ (e) => e instanceof PrettyError ? e : new BuildError(e)
45
+ );
39
46
  }
40
47
  okLog("Vite");
41
48
  return outputs.output;
42
49
  }
43
50
  export {
44
- buildVite,
45
51
  viteTask
46
52
  };
47
53
  //# sourceMappingURL=viteTask.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"viteTask.mjs","sources":["../../../../../src/tasks/viteTask.ts"],"sourcesContent":["import { build, type UserConfig, type Rollup } from \"vite\";\nimport { errors } from \"../errors.js\";\nimport { okLog } from \"../log.js\";\nimport { BuildError } from \"../error.js\";\n\ntype ViteTaskParams = {\n viteConfig: UserConfig;\n};\n\ntype BuildSuccess = {\n error: false;\n output: Rollup.OutputChunk[];\n};\ntype BuildErrorType = {\n error: true;\n errors: Array<string>;\n};\n\ntype BuildResult = BuildSuccess | BuildErrorType;\n\nexport async function buildVite({\n viteConfig,\n}: ViteTaskParams): Promise<BuildResult> {\n try {\n const outputs = await build(viteConfig);\n if (!Array.isArray(outputs)) {\n return {\n error: true,\n errors: [errors.rollupError],\n };\n }\n\n return {\n error: false,\n output: outputs.flatMap((x) =>\n x.output.filter((x) => x.type === \"chunk\"),\n ),\n };\n } catch (e) {\n if (e instanceof Error) {\n return {\n error: true,\n errors: [e.message],\n };\n }\n }\n return {\n error: true,\n errors: [errors.rollupError],\n };\n}\n\nexport async function viteTask({ viteConfig }: ViteTaskParams) {\n const outputs = await buildVite({ viteConfig });\n if (outputs.error) {\n throw outputs.errors.map((e) => new BuildError(e));\n }\n\n okLog(\"Vite\");\n return outputs.output;\n}\n"],"names":["x"],"mappings":";;;;AAoBA,eAAsB,UAAU;AAAA,EAC9B;AACF,GAAyC;AACnC,MAAA;AACI,UAAA,UAAU,MAAM,MAAM,UAAU;AACtC,QAAI,CAAC,MAAM,QAAQ,OAAO,GAAG;AACpB,aAAA;AAAA,QACL,OAAO;AAAA,QACP,QAAQ,CAAC,OAAO,WAAW;AAAA,MAC7B;AAAA,IAAA;AAGK,WAAA;AAAA,MACL,OAAO;AAAA,MACP,QAAQ,QAAQ;AAAA,QAAQ,CAAC,MACvB,EAAE,OAAO,OAAO,CAACA,OAAMA,GAAE,SAAS,OAAO;AAAA,MAAA;AAAA,IAE7C;AAAA,WACO,GAAG;AACV,QAAI,aAAa,OAAO;AACf,aAAA;AAAA,QACL,OAAO;AAAA,QACP,QAAQ,CAAC,EAAE,OAAO;AAAA,MACpB;AAAA,IAAA;AAAA,EACF;AAEK,SAAA;AAAA,IACL,OAAO;AAAA,IACP,QAAQ,CAAC,OAAO,WAAW;AAAA,EAC7B;AACF;AAEsB,eAAA,SAAS,EAAE,cAA8B;AAC7D,QAAM,UAAU,MAAM,UAAU,EAAE,YAAY;AAC9C,MAAI,QAAQ,OAAO;AACX,UAAA,QAAQ,OAAO,IAAI,CAAC,MAAM,IAAI,WAAW,CAAC,CAAC;AAAA,EAAA;AAGnD,QAAM,MAAM;AACZ,SAAO,QAAQ;AACjB;"}
1
+ {"version":3,"file":"viteTask.mjs","sources":["../../../../../src/tasks/viteTask.ts"],"sourcesContent":["import { build, type UserConfig, type Rollup } from \"vite\";\nimport { errors } from \"../errors.js\";\nimport { okLog } from \"../log.js\";\nimport { BuildError } from \"../error.js\";\nimport { PrettyError } from \"../PrettyErrors.js\";\n\ntype ViteTaskParams = {\n viteConfig: UserConfig;\n};\n\ntype BuildSuccess = {\n error: false;\n output: Rollup.OutputChunk[];\n};\ntype BuildErrorType = {\n error: true;\n errors: Array<string | PrettyError>;\n};\n\ntype BuildResult = BuildSuccess | BuildErrorType;\n\nasync function buildVite({ viteConfig }: ViteTaskParams): Promise<BuildResult> {\n try {\n const outputs = await build(viteConfig);\n if (!Array.isArray(outputs)) {\n return {\n error: true,\n errors: [errors.rollupError],\n };\n }\n\n return {\n error: false,\n output: outputs.flatMap((x) =>\n x.output.filter((x) => x.type === \"chunk\"),\n ),\n };\n } catch (e) {\n if (e instanceof PrettyError) {\n return {\n error: true,\n errors: [e],\n };\n }\n if (e instanceof Error) {\n return {\n error: true,\n errors: [e.message],\n };\n }\n }\n return {\n error: true,\n errors: [errors.rollupError],\n };\n}\n\nexport async function viteTask({ viteConfig }: ViteTaskParams) {\n const outputs = await buildVite({ viteConfig });\n if (outputs.error) {\n throw outputs.errors.map((e) =>\n e instanceof PrettyError ? e : new BuildError(e),\n );\n }\n\n okLog(\"Vite\");\n return outputs.output;\n}\n"],"names":["x"],"mappings":";;;;;AAqBA,eAAe,UAAU,EAAE,cAAoD;AACzE,MAAA;AACI,UAAA,UAAU,MAAM,MAAM,UAAU;AACtC,QAAI,CAAC,MAAM,QAAQ,OAAO,GAAG;AACpB,aAAA;AAAA,QACL,OAAO;AAAA,QACP,QAAQ,CAAC,OAAO,WAAW;AAAA,MAC7B;AAAA,IAAA;AAGK,WAAA;AAAA,MACL,OAAO;AAAA,MACP,QAAQ,QAAQ;AAAA,QAAQ,CAAC,MACvB,EAAE,OAAO,OAAO,CAACA,OAAMA,GAAE,SAAS,OAAO;AAAA,MAAA;AAAA,IAE7C;AAAA,WACO,GAAG;AACV,QAAI,aAAa,aAAa;AACrB,aAAA;AAAA,QACL,OAAO;AAAA,QACP,QAAQ,CAAC,CAAC;AAAA,MACZ;AAAA,IAAA;AAEF,QAAI,aAAa,OAAO;AACf,aAAA;AAAA,QACL,OAAO;AAAA,QACP,QAAQ,CAAC,EAAE,OAAO;AAAA,MACpB;AAAA,IAAA;AAAA,EACF;AAEK,SAAA;AAAA,IACL,OAAO;AAAA,IACP,QAAQ,CAAC,OAAO,WAAW;AAAA,EAC7B;AACF;AAEsB,eAAA,SAAS,EAAE,cAA8B;AAC7D,QAAM,UAAU,MAAM,UAAU,EAAE,YAAY;AAC9C,MAAI,QAAQ,OAAO;AACjB,UAAM,QAAQ,OAAO;AAAA,MAAI,CAAC,MACxB,aAAa,cAAc,IAAI,IAAI,WAAW,CAAC;AAAA,IACjD;AAAA,EAAA;AAGF,QAAM,MAAM;AACZ,SAAO,QAAQ;AACjB;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "smartbundle",
3
3
  "type": "commonjs",
4
- "version": "0.12.3",
4
+ "version": "0.13.0-alpha.0",
5
5
  "bin": {
6
6
  "smartbundle": "__bin__/smartbundle.js"
7
7
  },
@@ -28,6 +28,7 @@
28
28
  "semver": "^7.6.3",
29
29
  "vite": "^5.4.11",
30
30
  "yargs": "^17.7.2",
31
+ "youch": "4.1.0-beta.4",
31
32
  "zod": "^3.24.0"
32
33
  },
33
34
  "repository": {