adnbn 0.2.5 → 0.2.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.
Files changed (182) hide show
  1. package/dist/cli/builders/app/index.d.ts +2 -1
  2. package/dist/cli/builders/locale/index.d.ts +2 -1
  3. package/dist/cli/builders/manifest/index.d.ts +2 -1
  4. package/dist/cli/entrypoint/file/resolvers/ImportResolver.js +2 -4
  5. package/dist/cli/entrypoint/file/resolvers/ImportResolver.js.map +1 -1
  6. package/dist/cli/entrypoint/finder/AbstractAssetFinder.d.ts +2 -1
  7. package/dist/cli/entrypoint/finder/AbstractAssetFinder.js +2 -2
  8. package/dist/cli/entrypoint/finder/AbstractAssetFinder.js.map +1 -1
  9. package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.d.ts +2 -1
  10. package/dist/cli/entrypoint/finder/AbstractFinder.d.ts +2 -1
  11. package/dist/cli/entrypoint/finder/AbstractFinder.js +6 -3
  12. package/dist/cli/entrypoint/finder/AbstractFinder.js.map +1 -1
  13. package/dist/cli/entrypoint/finder/AbstractOptionsFinder.d.ts +2 -1
  14. package/dist/cli/entrypoint/finder/AbstractPluginFinder.d.ts +2 -1
  15. package/dist/cli/entrypoint/finder/AbstractTransportFinder.d.ts +2 -1
  16. package/dist/cli/entrypoint/finder/AbstractViewFinder.d.ts +2 -1
  17. package/dist/cli/entrypoint/finder/AssetPluginFinder.d.ts +2 -1
  18. package/dist/cli/entrypoint/finder/BackgroundFinder.d.ts +2 -1
  19. package/dist/cli/entrypoint/finder/CommandFinder.d.ts +2 -1
  20. package/dist/cli/entrypoint/finder/ContentFinder.d.ts +2 -1
  21. package/dist/cli/entrypoint/finder/IconFinder.d.ts +2 -1
  22. package/dist/cli/entrypoint/finder/IconFinder.js +1 -1
  23. package/dist/cli/entrypoint/finder/IconFinder.js.map +1 -1
  24. package/dist/cli/entrypoint/finder/LocaleFinder.d.ts +2 -1
  25. package/dist/cli/entrypoint/finder/OffscreenFinder.d.ts +2 -1
  26. package/dist/cli/entrypoint/finder/OffscreenViewFinder.d.ts +2 -1
  27. package/dist/cli/entrypoint/finder/PageFinder.d.ts +2 -1
  28. package/dist/cli/entrypoint/finder/PluginFinder.d.ts +2 -1
  29. package/dist/cli/entrypoint/finder/PopupFinder.d.ts +2 -1
  30. package/dist/cli/entrypoint/finder/RelayFinder.d.ts +2 -1
  31. package/dist/cli/entrypoint/finder/ServiceFinder.d.ts +2 -1
  32. package/dist/cli/entrypoint/finder/SidebarFinder.d.ts +2 -1
  33. package/dist/cli/entrypoint/finder/index.d.ts +2 -1
  34. package/dist/cli/entrypoint/index.d.ts +2 -1
  35. package/dist/cli/entrypoint/parser/AbstractParser.d.ts +2 -1
  36. package/dist/cli/entrypoint/parser/AbstractParser.js +1 -1
  37. package/dist/cli/entrypoint/parser/AbstractParser.js.map +1 -1
  38. package/dist/cli/entrypoint/parser/BackgroundParser.d.ts +2 -1
  39. package/dist/cli/entrypoint/parser/CommandParser.d.ts +2 -1
  40. package/dist/cli/entrypoint/parser/ContentParser.d.ts +2 -1
  41. package/dist/cli/entrypoint/parser/OffscreenParser.d.ts +2 -1
  42. package/dist/cli/entrypoint/parser/PageParser.d.ts +2 -1
  43. package/dist/cli/entrypoint/parser/PopupParser.d.ts +2 -1
  44. package/dist/cli/entrypoint/parser/RelayParser.d.ts +2 -1
  45. package/dist/cli/entrypoint/parser/ServiceParser.d.ts +2 -1
  46. package/dist/cli/entrypoint/parser/SidebarParser.d.ts +2 -1
  47. package/dist/cli/entrypoint/parser/ViewParser.d.ts +84 -84
  48. package/dist/cli/entrypoint/parser/index.d.ts +2 -1
  49. package/dist/cli/index.js +2 -2
  50. package/dist/cli/index.js.map +1 -1
  51. package/dist/cli/plugins/asset.d.ts +2 -1
  52. package/dist/cli/plugins/background/Background.d.ts +2 -1
  53. package/dist/cli/plugins/background/BackgroundEntry.d.ts +2 -1
  54. package/dist/cli/plugins/background/BackgroundManifest.d.ts +2 -1
  55. package/dist/cli/plugins/background/Command.d.ts +2 -1
  56. package/dist/cli/plugins/background/Service.d.ts +2 -1
  57. package/dist/cli/plugins/background/ServiceDeclaration.d.ts +2 -1
  58. package/dist/cli/plugins/background/index.d.ts +2 -1
  59. package/dist/cli/plugins/bundler.d.ts +2 -1
  60. package/dist/cli/plugins/bundler.js +1 -15
  61. package/dist/cli/plugins/bundler.js.map +1 -1
  62. package/dist/cli/plugins/content/Content.d.ts +2 -1
  63. package/dist/cli/plugins/content/ContentDriver.d.ts +2 -1
  64. package/dist/cli/plugins/content/ContentManager.d.ts +2 -1
  65. package/dist/cli/plugins/content/ContentName.d.ts +2 -1
  66. package/dist/cli/plugins/content/Relay.d.ts +2 -1
  67. package/dist/cli/plugins/content/RelayDeclaration.d.ts +2 -1
  68. package/dist/cli/plugins/content/index.d.ts +2 -1
  69. package/dist/cli/plugins/dotenv/crypt.d.ts +4 -0
  70. package/dist/cli/plugins/dotenv/crypt.js +26 -0
  71. package/dist/cli/plugins/dotenv/crypt.js.map +1 -0
  72. package/dist/cli/plugins/dotenv/index.d.ts +2 -1
  73. package/dist/cli/plugins/dotenv/index.js +9 -12
  74. package/dist/cli/plugins/dotenv/index.js.map +1 -1
  75. package/dist/cli/plugins/dotenv/utils.d.ts +9 -4
  76. package/dist/cli/plugins/dotenv/utils.js +31 -26
  77. package/dist/cli/plugins/dotenv/utils.js.map +1 -1
  78. package/dist/cli/plugins/html.d.ts +2 -1
  79. package/dist/cli/plugins/icon/Icon.d.ts +2 -1
  80. package/dist/cli/plugins/icon/Icon.js +1 -1
  81. package/dist/cli/plugins/icon/Icon.js.map +1 -1
  82. package/dist/cli/plugins/icon/declaration/IconDeclaration.d.ts +2 -1
  83. package/dist/cli/plugins/icon/declaration/index.d.ts +2 -1
  84. package/dist/cli/plugins/icon/index.d.ts +2 -1
  85. package/dist/cli/plugins/icon/index.js +1 -2
  86. package/dist/cli/plugins/icon/index.js.map +1 -1
  87. package/dist/cli/plugins/index.d.ts +2 -1
  88. package/dist/cli/plugins/locale/Locale.d.ts +2 -1
  89. package/dist/cli/plugins/locale/declaration/LocaleDeclaration.d.ts +2 -1
  90. package/dist/cli/plugins/locale/declaration/index.d.ts +2 -1
  91. package/dist/cli/plugins/locale/index.d.ts +2 -1
  92. package/dist/cli/plugins/locale/index.js +1 -1
  93. package/dist/cli/plugins/locale/index.js.map +1 -1
  94. package/dist/cli/plugins/meta/AbstractMeta.d.ts +2 -1
  95. package/dist/cli/plugins/meta/Author.d.ts +2 -1
  96. package/dist/cli/plugins/meta/Email.d.ts +2 -1
  97. package/dist/cli/plugins/meta/Homepage.d.ts +2 -1
  98. package/dist/cli/plugins/meta/Incognito.d.ts +2 -1
  99. package/dist/cli/plugins/meta/index.d.ts +2 -1
  100. package/dist/cli/plugins/offscreen/Offscreen.d.ts +2 -1
  101. package/dist/cli/plugins/offscreen/OffscreenDeclaration.d.ts +2 -1
  102. package/dist/cli/plugins/offscreen/index.d.ts +2 -1
  103. package/dist/cli/plugins/optimization.d.ts +2 -1
  104. package/dist/cli/plugins/optimization.js +2 -2
  105. package/dist/cli/plugins/optimization.js.map +1 -1
  106. package/dist/cli/plugins/output.d.ts +2 -1
  107. package/dist/cli/plugins/output.js +2 -2
  108. package/dist/cli/plugins/output.js.map +1 -1
  109. package/dist/cli/plugins/page/Page.d.ts +2 -1
  110. package/dist/cli/plugins/page/declaration/PageDeclaration.d.ts +2 -1
  111. package/dist/cli/plugins/page/declaration/index.d.ts +2 -1
  112. package/dist/cli/plugins/page/index.d.ts +2 -1
  113. package/dist/cli/plugins/popup/Popup.d.ts +2 -1
  114. package/dist/cli/plugins/popup/declaration/PopupDeclaration.d.ts +2 -1
  115. package/dist/cli/plugins/popup/declaration/index.d.ts +2 -1
  116. package/dist/cli/plugins/popup/index.d.ts +2 -1
  117. package/dist/cli/plugins/public.d.ts +2 -1
  118. package/dist/cli/plugins/react.d.ts +2 -1
  119. package/dist/cli/plugins/react.js +4 -4
  120. package/dist/cli/plugins/react.js.map +1 -1
  121. package/dist/cli/plugins/sidebar/Sidebar.d.ts +2 -1
  122. package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.d.ts +2 -1
  123. package/dist/cli/plugins/sidebar/declaration/index.d.ts +2 -1
  124. package/dist/cli/plugins/sidebar/index.d.ts +2 -1
  125. package/dist/cli/plugins/style.d.ts +2 -1
  126. package/dist/cli/plugins/style.js +4 -4
  127. package/dist/cli/plugins/style.js.map +1 -1
  128. package/dist/cli/plugins/typescript/FileBuilder.d.ts +2 -1
  129. package/dist/cli/plugins/typescript/FileBuilder.js +2 -2
  130. package/dist/cli/plugins/typescript/FileBuilder.js.map +1 -1
  131. package/dist/cli/plugins/typescript/TypescriptConfig.d.ts +2 -1
  132. package/dist/cli/plugins/typescript/TypescriptConfig.js +4 -4
  133. package/dist/cli/plugins/typescript/TypescriptConfig.js.map +1 -1
  134. package/dist/cli/plugins/typescript/declaration/VendorDeclaration.d.ts +2 -1
  135. package/dist/cli/plugins/typescript/declaration/index.d.ts +2 -1
  136. package/dist/cli/plugins/typescript/declaration/transport/TransportDeclaration.d.ts +2 -1
  137. package/dist/cli/plugins/typescript/declaration/transport/index.d.ts +2 -1
  138. package/dist/cli/plugins/typescript/index.d.ts +2 -1
  139. package/dist/cli/plugins/version/AbstractVersion.d.ts +2 -1
  140. package/dist/cli/plugins/version/AddonVersion.d.ts +2 -1
  141. package/dist/cli/plugins/version/AddonVersion.js +2 -2
  142. package/dist/cli/plugins/version/AddonVersion.js.map +1 -1
  143. package/dist/cli/plugins/version/BrowserMinimumVersion.d.ts +2 -1
  144. package/dist/cli/plugins/version/index.d.ts +2 -1
  145. package/dist/cli/plugins/view/View.d.ts +2 -1
  146. package/dist/cli/plugins/view/index.d.ts +2 -1
  147. package/dist/cli/resolvers/bundler.d.ts +2 -1
  148. package/dist/cli/resolvers/config.d.ts +2 -1
  149. package/dist/cli/resolvers/config.js +32 -24
  150. package/dist/cli/resolvers/config.js.map +1 -1
  151. package/dist/cli/resolvers/path.d.ts +6 -4
  152. package/dist/cli/resolvers/path.js +24 -14
  153. package/dist/cli/resolvers/path.js.map +1 -1
  154. package/dist/cli/resolvers/plugin.d.ts +2 -1
  155. package/dist/cli/virtual/index.js +3 -3
  156. package/dist/{config-DzmiK3GH.d.ts → config-Ce0Le6r4.d.ts} +90 -59
  157. package/dist/entry/transport/index.d.ts +5 -5
  158. package/dist/entry/transport/index.js.map +1 -1
  159. package/dist/index.d.ts +2 -1
  160. package/dist/locale/adapters/react/context.d.ts +2 -3
  161. package/dist/locale/adapters/react/index.d.ts +2 -2
  162. package/dist/main/config.d.ts +3 -2
  163. package/dist/main/env.js +1 -1
  164. package/dist/main/env.js.map +1 -1
  165. package/dist/main/index.d.ts +2 -1
  166. package/dist/main/plugin.d.ts +3 -2
  167. package/dist/message/MessageManager.js +4 -1
  168. package/dist/message/MessageManager.js.map +1 -1
  169. package/dist/message/adapters/react/useMessageHandler.d.ts +2 -2
  170. package/dist/message/adapters/react/useMessageHandler.js +15 -8
  171. package/dist/message/adapters/react/useMessageHandler.js.map +1 -1
  172. package/dist/transport/index.d.ts +6 -0
  173. package/dist/transport/index.js +1 -0
  174. package/dist/transport/index.js.map +1 -0
  175. package/dist/types/config.d.ts +2 -1
  176. package/dist/types/content.d.ts +1 -1
  177. package/dist/types/content.js.map +1 -1
  178. package/dist/types/env.d.ts +9 -0
  179. package/dist/types/env.js +5 -0
  180. package/dist/types/env.js.map +1 -0
  181. package/dist/types/plugin.d.ts +2 -1
  182. package/package.json +45 -46
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/plugins/react.ts"],"sourcesContent":["import path from \"path\";\nimport {Configuration as RspackConfig} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {getRootPath} from \"@cli/resolvers/path\";\n\nexport default definePlugin(() => {\n return {\n name: \"adnbn:react\",\n bundler: () => {\n return {\n resolve: {\n extensions: [\".js\", \".jsx\"],\n alias: {\n react: getRootPath(path.join(\"node_modules\", \"react\")),\n \"react-dom\": getRootPath(path.join(\"node_modules\", \"react-dom\")),\n scheduler: getRootPath(path.join(\"node_modules\", \"scheduler\")),\n },\n },\n optimization: {\n splitChunks: {\n cacheGroups: {\n react: {\n name: \"react\",\n test: /[\\\\/]node_modules[\\\\/](react|react-dom|scheduler)([\\\\/]|$)/,\n priority: 100,\n reuseExistingChunk: true,\n enforce: true,\n },\n },\n },\n },\n module: {\n rules: [\n {\n test: /\\.svg$/i,\n issuer: /\\.[jt]sx?$/,\n resourceQuery: /react/,\n use: [\n {\n loader: \"@svgr/webpack\",\n options: {\n expandProps: \"start\",\n typescript: true,\n },\n },\n ],\n },\n ],\n },\n } as RspackConfig;\n },\n };\n});\n"],"mappings":"AAAA,OAAO,UAAU;AAGjB,SAAQ,oBAAmB;AAE3B,SAAQ,mBAAkB;AAE1B,IAAO,gBAAQ,aAAa,MAAM;AAC9B,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,MAAM;AACX,aAAO;AAAA,QACH,SAAS;AAAA,UACL,YAAY,CAAC,OAAO,MAAM;AAAA,UAC1B,OAAO;AAAA,YACH,OAAO,YAAY,KAAK,KAAK,gBAAgB,OAAO,CAAC;AAAA,YACrD,aAAa,YAAY,KAAK,KAAK,gBAAgB,WAAW,CAAC;AAAA,YAC/D,WAAW,YAAY,KAAK,KAAK,gBAAgB,WAAW,CAAC;AAAA,UACjE;AAAA,QACJ;AAAA,QACA,cAAc;AAAA,UACV,aAAa;AAAA,YACT,aAAa;AAAA,cACT,OAAO;AAAA,gBACH,MAAM;AAAA,gBACN,MAAM;AAAA,gBACN,UAAU;AAAA,gBACV,oBAAoB;AAAA,gBACpB,SAAS;AAAA,cACb;AAAA,YACJ;AAAA,UACJ;AAAA,QACJ;AAAA,QACA,QAAQ;AAAA,UACJ,OAAO;AAAA,YACH;AAAA,cACI,MAAM;AAAA,cACN,QAAQ;AAAA,cACR,eAAe;AAAA,cACf,KAAK;AAAA,gBACD;AAAA,kBACI,QAAQ;AAAA,kBACR,SAAS;AAAA,oBACL,aAAa;AAAA,oBACb,YAAY;AAAA,kBAChB;AAAA,gBACJ;AAAA,cACJ;AAAA,YACJ;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;","names":[]}
1
+ {"version":3,"sources":["../../../src/cli/plugins/react.ts"],"sourcesContent":["import path from \"path\";\nimport {Configuration as RspackConfig} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {getResolvePath} from \"@cli/resolvers/path\";\n\nexport default definePlugin(() => {\n return {\n name: \"adnbn:react\",\n bundler: () => {\n return {\n resolve: {\n extensions: [\".js\", \".jsx\"],\n alias: {\n react: getResolvePath(path.join(\"node_modules\", \"react\")),\n \"react-dom\": getResolvePath(path.join(\"node_modules\", \"react-dom\")),\n scheduler: getResolvePath(path.join(\"node_modules\", \"scheduler\")),\n },\n },\n optimization: {\n splitChunks: {\n cacheGroups: {\n react: {\n name: \"react\",\n test: /[\\\\/]node_modules[\\\\/](react|react-dom|scheduler)([\\\\/]|$)/,\n priority: 100,\n reuseExistingChunk: true,\n enforce: true,\n },\n },\n },\n },\n module: {\n rules: [\n {\n test: /\\.svg$/i,\n issuer: /\\.[jt]sx?$/,\n resourceQuery: /react/,\n use: [\n {\n loader: \"@svgr/webpack\",\n options: {\n expandProps: \"start\",\n typescript: true,\n },\n },\n ],\n },\n ],\n },\n } as RspackConfig;\n },\n };\n});\n"],"mappings":"AAAA,OAAO,UAAU;AAGjB,SAAQ,oBAAmB;AAE3B,SAAQ,sBAAqB;AAE7B,IAAO,gBAAQ,aAAa,MAAM;AAC9B,SAAO;AAAA,IACH,MAAM;AAAA,IACN,SAAS,MAAM;AACX,aAAO;AAAA,QACH,SAAS;AAAA,UACL,YAAY,CAAC,OAAO,MAAM;AAAA,UAC1B,OAAO;AAAA,YACH,OAAO,eAAe,KAAK,KAAK,gBAAgB,OAAO,CAAC;AAAA,YACxD,aAAa,eAAe,KAAK,KAAK,gBAAgB,WAAW,CAAC;AAAA,YAClE,WAAW,eAAe,KAAK,KAAK,gBAAgB,WAAW,CAAC;AAAA,UACpE;AAAA,QACJ;AAAA,QACA,cAAc;AAAA,UACV,aAAa;AAAA,YACT,aAAa;AAAA,cACT,OAAO;AAAA,gBACH,MAAM;AAAA,gBACN,MAAM;AAAA,gBACN,UAAU;AAAA,gBACV,oBAAoB;AAAA,gBACpB,SAAS;AAAA,cACb;AAAA,YACJ;AAAA,UACJ;AAAA,QACJ;AAAA,QACA,QAAQ;AAAA,UACJ,OAAO;AAAA,YACH;AAAA,cACI,MAAM;AAAA,cACN,QAAQ;AAAA,cACR,eAAe;AAAA,cACf,KAAK;AAAA,gBACD;AAAA,kBACI,QAAQ;AAAA,kBACR,SAAS;AAAA,oBACL,aAAa;AAAA,oBACb,YAAY;AAAA,kBAChB;AAAA,gBACJ;AAAA,cACJ;AAAA,YACJ;AAAA,UACJ;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EACJ;AACJ,CAAC;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import { ManifestSidebar } from '../../../types/manifest.js';
2
- import { R as ReadonlyConfig } from '../../../config-DzmiK3GH.js';
2
+ import { R as ReadonlyConfig } from '../../../config-Ce0Le6r4.js';
3
3
  import export_default$2 from '../view/View.js';
4
4
  import export_default$1 from '../../entrypoint/finder/SidebarFinder.js';
5
5
  import { SidebarEntrypointOptions } from '../../../types/sidebar.js';
@@ -15,6 +15,7 @@ import '../../../types/locale.js';
15
15
  import '@rspack/core';
16
16
  import 'html-rspack-tags-plugin';
17
17
  import '../../../types/app.js';
18
+ import '../../../types/env.js';
18
19
  import '../../entrypoint/finder/AbstractViewFinder.js';
19
20
  import '../../entrypoint/finder/AbstractPluginFinder.js';
20
21
  import '../../entrypoint/finder/AbstractEntrypointFinder.js';
@@ -1,4 +1,4 @@
1
- import { R as ReadonlyConfig } from '../../../../config-DzmiK3GH.js';
1
+ import { R as ReadonlyConfig } from '../../../../config-Ce0Le6r4.js';
2
2
  import FileBuilder from '../../typescript/FileBuilder.js';
3
3
  import '@rspack/core';
4
4
  import 'html-rspack-tags-plugin';
@@ -13,6 +13,7 @@ import '../../../../types/helpers.js';
13
13
  import '../../../../types/background.js';
14
14
  import '../../../../types/command.js';
15
15
  import '../../../../types/locale.js';
16
+ import '../../../../types/env.js';
16
17
 
17
18
  declare class export_default extends FileBuilder {
18
19
  protected alias: Set<string>;
@@ -1,5 +1,5 @@
1
1
  export { default as SidebarDeclaration } from './SidebarDeclaration.js';
2
- import '../../../../config-DzmiK3GH.js';
2
+ import '../../../../config-Ce0Le6r4.js';
3
3
  import '@rspack/core';
4
4
  import 'html-rspack-tags-plugin';
5
5
  import '../../../../types/app.js';
@@ -13,4 +13,5 @@ import '../../../../types/helpers.js';
13
13
  import '../../../../types/background.js';
14
14
  import '../../../../types/command.js';
15
15
  import '../../../../types/locale.js';
16
+ import '../../../../types/env.js';
16
17
  import '../../typescript/FileBuilder.js';
@@ -1,4 +1,4 @@
1
- import { b as PluginDefinition } from '../../../config-DzmiK3GH.js';
1
+ import { b as PluginDefinition } from '../../../config-Ce0Le6r4.js';
2
2
  import '@rspack/core';
3
3
  import 'html-rspack-tags-plugin';
4
4
  import '../../../types/app.js';
@@ -12,6 +12,7 @@ import '../../../types/helpers.js';
12
12
  import '../../../types/background.js';
13
13
  import '../../../types/command.js';
14
14
  import '../../../types/locale.js';
15
+ import '../../../types/env.js';
15
16
 
16
17
  declare const _default: PluginDefinition<[]>;
17
18
 
@@ -1,4 +1,4 @@
1
- import { b as PluginDefinition } from '../../config-DzmiK3GH.js';
1
+ import { b as PluginDefinition } from '../../config-Ce0Le6r4.js';
2
2
  import '@rspack/core';
3
3
  import 'html-rspack-tags-plugin';
4
4
  import '../../types/app.js';
@@ -12,6 +12,7 @@ import '../../types/helpers.js';
12
12
  import '../../types/background.js';
13
13
  import '../../types/command.js';
14
14
  import '../../types/locale.js';
15
+ import '../../types/env.js';
15
16
 
16
17
  declare const _default: PluginDefinition<[]>;
17
18
 
@@ -5,14 +5,14 @@ import { createHash } from "crypto";
5
5
  import { CssExtractRspackPlugin } from "@rspack/core";
6
6
  import { definePlugin } from "./../../main/plugin.js";
7
7
  import { appFilenameResolver } from "./../../cli/bundler/index.js";
8
- import { getAppSourcePath, getRootPath, getSharedPath } from "./../../cli/resolvers/path.js";
8
+ import { getAppSourcePath, getResolvePath, getSharedPath } from "./../../cli/resolvers/path.js";
9
9
  import { toPosix } from "./../../cli/utils/path.js";
10
10
  const styleMergerLoader = (config) => (sharedStyle, sharedPath) => {
11
- const sharedDir = getRootPath(getSharedPath(config));
11
+ const sharedDir = getResolvePath(getSharedPath(config));
12
12
  if (sharedPath.startsWith(sharedDir)) {
13
13
  const relativePath = path.relative(sharedDir, sharedPath);
14
- const appDir = getRootPath(getAppSourcePath(config));
15
- const appPath = getRootPath(path.join(appDir, relativePath));
14
+ const appDir = getResolvePath(getAppSourcePath(config));
15
+ const appPath = getResolvePath(path.join(appDir, relativePath));
16
16
  if (fs.existsSync(appPath)) {
17
17
  try {
18
18
  let appStyle = fs.readFileSync(appPath, "utf8");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/plugins/style.ts"],"sourcesContent":["import _ from \"lodash\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport {createHash} from \"crypto\";\nimport {Configuration as RspackConfig, CssExtractRspackPlugin, RuleSetUse, RuleSetUseItem} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {appFilenameResolver} from \"@cli/bundler\";\n\nimport {getAppSourcePath, getRootPath, getSharedPath} from \"@cli/resolvers/path\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\nimport {toPosix} from \"@cli/utils/path\";\n\n// prettier-ignore\nconst styleMergerLoader =\n (config: ReadonlyConfig) =>\n (sharedStyle: string, sharedPath: string): string | void => {\n const sharedDir = getRootPath(getSharedPath(config));\n\n if (sharedPath.startsWith(sharedDir)) {\n const relativePath = path.relative(sharedDir, sharedPath);\n\n const appDir = getRootPath(getAppSourcePath(config));\n const appPath = getRootPath(path.join(appDir, relativePath));\n\n if (fs.existsSync(appPath)) {\n try {\n let appStyle = fs.readFileSync(appPath, \"utf8\");\n\n appStyle = appStyle.replace(/url\\((['\"]?)(.*?)\\1\\)/g, (match, quote, filePath) => {\n if (\n filePath.startsWith(\"/\") ||\n filePath.startsWith(\"http\") ||\n filePath.startsWith(\"data:\")\n ) {\n return match;\n }\n\n const cssDir = path.dirname(appPath);\n const assetAbs = path.resolve(cssDir, filePath);\n\n const sharedFileDir = path.dirname(sharedPath);\n\n const relativeToSharedFile = path.relative(sharedFileDir, assetAbs);\n\n return `url(\"${toPosix(relativeToSharedFile)}\")`;\n });\n\n return sharedStyle + \"\\n\" + appStyle;\n } catch (error) {\n console.error(error);\n }\n }\n }\n };\n\nexport default definePlugin(() => {\n return {\n name: \"adnbn:styles\",\n bundler: ({config}) => {\n const {app, cssDir, cssFilename, cssIdentName, mergeStyles} = config;\n\n const filename = appFilenameResolver(app, cssFilename, cssDir);\n\n const createSassRuleSet = (rule: RuleSetUseItem): RuleSetUse => {\n const rules: RuleSetUse = [CssExtractRspackPlugin.loader, rule, \"sass-loader\"];\n\n if (mergeStyles) {\n rules.push({\n loader: \"source-modifier-loader\",\n options: {\n modify: styleMergerLoader(config),\n },\n });\n }\n\n return rules;\n };\n\n return {\n resolve: {\n extensions: [\".css\", \".scss\"],\n },\n plugins: [\n new CssExtractRspackPlugin({\n filename,\n chunkFilename: filename,\n }),\n ],\n module: {\n rules: [\n {\n test: /\\.(scss|css)$/,\n type: \"javascript/auto\",\n oneOf: [\n {\n resourceQuery: /asis/,\n use: createSassRuleSet({\n loader: \"css-loader\",\n options: {\n esModule: true,\n modules: false,\n },\n }),\n },\n {\n use: createSassRuleSet({\n loader: \"css-loader\",\n options: {\n esModule: true,\n modules: {\n exportLocalsConvention: \"as-is\",\n namedExport: false,\n localIdentName: cssIdentName.replaceAll(\"[app]\", _.kebabCase(app)),\n localIdentHashSalt: createHash(\"sha256\").update(app).digest(\"hex\"),\n },\n },\n }),\n },\n ],\n },\n ],\n },\n } satisfies RspackConfig;\n },\n };\n});\n"],"mappings":"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","names":[]}
1
+ {"version":3,"sources":["../../../src/cli/plugins/style.ts"],"sourcesContent":["import _ from \"lodash\";\nimport path from \"path\";\nimport fs from \"fs\";\nimport {createHash} from \"crypto\";\nimport {Configuration as RspackConfig, CssExtractRspackPlugin, RuleSetUse, RuleSetUseItem} from \"@rspack/core\";\n\nimport {definePlugin} from \"@main/plugin\";\n\nimport {appFilenameResolver} from \"@cli/bundler\";\n\nimport {getAppSourcePath, getResolvePath, getSharedPath} from \"@cli/resolvers/path\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\nimport {toPosix} from \"@cli/utils/path\";\n\n// prettier-ignore\nconst styleMergerLoader =\n (config: ReadonlyConfig) =>\n (sharedStyle: string, sharedPath: string): string | void => {\n const sharedDir = getResolvePath(getSharedPath(config));\n\n if (sharedPath.startsWith(sharedDir)) {\n const relativePath = path.relative(sharedDir, sharedPath);\n\n const appDir = getResolvePath(getAppSourcePath(config));\n const appPath = getResolvePath(path.join(appDir, relativePath));\n\n if (fs.existsSync(appPath)) {\n try {\n let appStyle = fs.readFileSync(appPath, \"utf8\");\n\n appStyle = appStyle.replace(/url\\((['\"]?)(.*?)\\1\\)/g, (match, quote, filePath) => {\n if (\n filePath.startsWith(\"/\") ||\n filePath.startsWith(\"http\") ||\n filePath.startsWith(\"data:\")\n ) {\n return match;\n }\n\n const cssDir = path.dirname(appPath);\n const assetAbs = path.resolve(cssDir, filePath);\n\n const sharedFileDir = path.dirname(sharedPath);\n\n const relativeToSharedFile = path.relative(sharedFileDir, assetAbs);\n\n return `url(\"${toPosix(relativeToSharedFile)}\")`;\n });\n\n return sharedStyle + \"\\n\" + appStyle;\n } catch (error) {\n console.error(error);\n }\n }\n }\n };\n\nexport default definePlugin(() => {\n return {\n name: \"adnbn:styles\",\n bundler: ({config}) => {\n const {app, cssDir, cssFilename, cssIdentName, mergeStyles} = config;\n\n const filename = appFilenameResolver(app, cssFilename, cssDir);\n\n const createSassRuleSet = (rule: RuleSetUseItem): RuleSetUse => {\n const rules: RuleSetUse = [CssExtractRspackPlugin.loader, rule, \"sass-loader\"];\n\n if (mergeStyles) {\n rules.push({\n loader: \"source-modifier-loader\",\n options: {\n modify: styleMergerLoader(config),\n },\n });\n }\n\n return rules;\n };\n\n return {\n resolve: {\n extensions: [\".css\", \".scss\"],\n },\n plugins: [\n new CssExtractRspackPlugin({\n filename,\n chunkFilename: filename,\n }),\n ],\n module: {\n rules: [\n {\n test: /\\.(scss|css)$/,\n type: \"javascript/auto\",\n oneOf: [\n {\n resourceQuery: /asis/,\n use: createSassRuleSet({\n loader: \"css-loader\",\n options: {\n esModule: true,\n modules: false,\n },\n }),\n },\n {\n use: createSassRuleSet({\n loader: \"css-loader\",\n options: {\n esModule: true,\n modules: {\n exportLocalsConvention: \"as-is\",\n namedExport: false,\n localIdentName: cssIdentName.replaceAll(\"[app]\", _.kebabCase(app)),\n localIdentHashSalt: createHash(\"sha256\").update(app).digest(\"hex\"),\n },\n },\n }),\n },\n ],\n },\n ],\n },\n } satisfies RspackConfig;\n },\n };\n});\n"],"mappings":"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","names":[]}
@@ -1,4 +1,4 @@
1
- import { R as ReadonlyConfig } from '../../../config-DzmiK3GH.js';
1
+ import { R as ReadonlyConfig } from '../../../config-Ce0Le6r4.js';
2
2
  import '@rspack/core';
3
3
  import 'html-rspack-tags-plugin';
4
4
  import '../../../types/app.js';
@@ -12,6 +12,7 @@ import '../../../types/helpers.js';
12
12
  import '../../../types/background.js';
13
13
  import '../../../types/command.js';
14
14
  import '../../../types/locale.js';
15
+ import '../../../types/env.js';
15
16
 
16
17
  declare abstract class FileBuilder {
17
18
  protected readonly config: ReadonlyConfig;
@@ -1,6 +1,6 @@
1
1
  import fs from "fs";
2
2
  import path from "path";
3
- import { getInputPath, getRootPath } from "./../../../cli/resolvers/path.js";
3
+ import { fromRootPath, getResolvePath } from "./../../../cli/resolvers/path.js";
4
4
  import { PackageName, SystemDir } from "./../../../types/app.js";
5
5
  class FileBuilder {
6
6
  constructor(config) {
@@ -26,7 +26,7 @@ class FileBuilder {
26
26
  return this._file ?? (this._file = fs.readFileSync(this.file(), { encoding: "utf-8" }));
27
27
  }
28
28
  build() {
29
- const systemDirPath = getRootPath(getInputPath(this.config, SystemDir));
29
+ const systemDirPath = getResolvePath(fromRootPath(this.config, SystemDir));
30
30
  let content = this.content().replaceAll("// prettier-ignore", "");
31
31
  if (this.withBanner()) {
32
32
  const banner = "// This file is automatically generated. \n\n";
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/plugins/typescript/FileBuilder.ts"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\n\nimport {getInputPath, getRootPath} from \"@cli/resolvers/path\";\n\nimport {PackageName, SystemDir} from \"@typing/app\";\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport default abstract class FileBuilder {\n private _file?: string;\n\n protected abstract filename(): string;\n\n protected abstract template(): string;\n\n public static make<T extends FileBuilder>(this: new (config: ReadonlyConfig) => T, config: ReadonlyConfig): T {\n return new this(config).build();\n }\n\n protected constructor(protected readonly config: ReadonlyConfig) {}\n\n protected content(): string {\n return this.template().replaceAll(\":package\", PackageName);\n }\n\n protected withBanner(): boolean {\n return true;\n }\n\n protected file(): URL {\n return new URL(`./${this.filename()}`, this.url());\n }\n\n protected url(): string {\n return import.meta.url;\n }\n\n protected readFile(): string {\n return (this._file ??= fs.readFileSync(this.file(), {encoding: \"utf-8\"}));\n }\n\n public build(): this {\n const systemDirPath = getRootPath(getInputPath(this.config, SystemDir));\n\n let content = this.content().replaceAll(\"// prettier-ignore\", \"\");\n\n if (this.withBanner()) {\n const banner = \"// This file is automatically generated. \\n\\n\";\n\n content = `${banner}${content}`;\n }\n\n fs.mkdirSync(systemDirPath, {recursive: true});\n\n fs.writeFileSync(path.join(systemDirPath, this.filename()), content);\n\n return this;\n }\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,SAAQ,cAAc,mBAAkB;AAExC,SAAQ,aAAa,iBAAgB;AAGrC,MAAO,YAAmC;AAAA,EAW5B,YAA+B,QAAwB;AAAxB;AAAA,EAAyB;AAAA,EAV1D;AAAA,EAMR,OAAc,KAAqE,QAA2B;AAC1G,WAAO,IAAI,KAAK,MAAM,EAAE,MAAM;AAAA,EAClC;AAAA,EAIU,UAAkB;AACxB,WAAO,KAAK,SAAS,EAAE,WAAW,YAAY,WAAW;AAAA,EAC7D;AAAA,EAEU,aAAsB;AAC5B,WAAO;AAAA,EACX;AAAA,EAEU,OAAY;AAClB,WAAO,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC;AAAA,EACrD;AAAA,EAEU,MAAc;AACpB,WAAO,YAAY;AAAA,EACvB;AAAA,EAEU,WAAmB;AACzB,WAAQ,KAAK,UAAL,KAAK,QAAU,GAAG,aAAa,KAAK,KAAK,GAAG,EAAC,UAAU,QAAO,CAAC;AAAA,EAC3E;AAAA,EAEO,QAAc;AACjB,UAAM,gBAAgB,YAAY,aAAa,KAAK,QAAQ,SAAS,CAAC;AAEtE,QAAI,UAAU,KAAK,QAAQ,EAAE,WAAW,sBAAsB,EAAE;AAEhE,QAAI,KAAK,WAAW,GAAG;AACnB,YAAM,SAAS;AAEf,gBAAU,GAAG,MAAM,GAAG,OAAO;AAAA,IACjC;AAEA,OAAG,UAAU,eAAe,EAAC,WAAW,KAAI,CAAC;AAE7C,OAAG,cAAc,KAAK,KAAK,eAAe,KAAK,SAAS,CAAC,GAAG,OAAO;AAEnE,WAAO;AAAA,EACX;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/cli/plugins/typescript/FileBuilder.ts"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\n\nimport {fromRootPath, getResolvePath} from \"@cli/resolvers/path\";\n\nimport {PackageName, SystemDir} from \"@typing/app\";\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport default abstract class FileBuilder {\n private _file?: string;\n\n protected abstract filename(): string;\n\n protected abstract template(): string;\n\n public static make<T extends FileBuilder>(this: new (config: ReadonlyConfig) => T, config: ReadonlyConfig): T {\n return new this(config).build();\n }\n\n protected constructor(protected readonly config: ReadonlyConfig) {}\n\n protected content(): string {\n return this.template().replaceAll(\":package\", PackageName);\n }\n\n protected withBanner(): boolean {\n return true;\n }\n\n protected file(): URL {\n return new URL(`./${this.filename()}`, this.url());\n }\n\n protected url(): string {\n return import.meta.url;\n }\n\n protected readFile(): string {\n return (this._file ??= fs.readFileSync(this.file(), {encoding: \"utf-8\"}));\n }\n\n public build(): this {\n const systemDirPath = getResolvePath(fromRootPath(this.config, SystemDir));\n\n let content = this.content().replaceAll(\"// prettier-ignore\", \"\");\n\n if (this.withBanner()) {\n const banner = \"// This file is automatically generated. \\n\\n\";\n\n content = `${banner}${content}`;\n }\n\n fs.mkdirSync(systemDirPath, {recursive: true});\n\n fs.writeFileSync(path.join(systemDirPath, this.filename()), content);\n\n return this;\n }\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,SAAQ,cAAc,sBAAqB;AAE3C,SAAQ,aAAa,iBAAgB;AAGrC,MAAO,YAAmC;AAAA,EAW5B,YAA+B,QAAwB;AAAxB;AAAA,EAAyB;AAAA,EAV1D;AAAA,EAMR,OAAc,KAAqE,QAA2B;AAC1G,WAAO,IAAI,KAAK,MAAM,EAAE,MAAM;AAAA,EAClC;AAAA,EAIU,UAAkB;AACxB,WAAO,KAAK,SAAS,EAAE,WAAW,YAAY,WAAW;AAAA,EAC7D;AAAA,EAEU,aAAsB;AAC5B,WAAO;AAAA,EACX;AAAA,EAEU,OAAY;AAClB,WAAO,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,IAAI,KAAK,IAAI,CAAC;AAAA,EACrD;AAAA,EAEU,MAAc;AACpB,WAAO,YAAY;AAAA,EACvB;AAAA,EAEU,WAAmB;AACzB,WAAQ,KAAK,UAAL,KAAK,QAAU,GAAG,aAAa,KAAK,KAAK,GAAG,EAAC,UAAU,QAAO,CAAC;AAAA,EAC3E;AAAA,EAEO,QAAc;AACjB,UAAM,gBAAgB,eAAe,aAAa,KAAK,QAAQ,SAAS,CAAC;AAEzE,QAAI,UAAU,KAAK,QAAQ,EAAE,WAAW,sBAAsB,EAAE;AAEhE,QAAI,KAAK,WAAW,GAAG;AACnB,YAAM,SAAS;AAEf,gBAAU,GAAG,MAAM,GAAG,OAAO;AAAA,IACjC;AAEA,OAAG,UAAU,eAAe,EAAC,WAAW,KAAI,CAAC;AAE7C,OAAG,cAAc,KAAK,KAAK,eAAe,KAAK,SAAS,CAAC,GAAG,OAAO;AAEnE,WAAO;AAAA,EACX;AACJ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import { TsConfigJson } from 'type-fest';
2
2
  import FileBuilder from './FileBuilder.js';
3
- import { R as ReadonlyConfig } from '../../../config-DzmiK3GH.js';
3
+ import { R as ReadonlyConfig } from '../../../config-Ce0Le6r4.js';
4
4
  import '@rspack/core';
5
5
  import 'html-rspack-tags-plugin';
6
6
  import '../../../types/app.js';
@@ -14,6 +14,7 @@ import '../../../types/helpers.js';
14
14
  import '../../../types/background.js';
15
15
  import '../../../types/command.js';
16
16
  import '../../../types/locale.js';
17
+ import '../../../types/env.js';
17
18
 
18
19
  declare class export_default extends FileBuilder {
19
20
  constructor(config: ReadonlyConfig);
@@ -1,7 +1,7 @@
1
1
  import path from "path";
2
2
  import _ from "lodash";
3
3
  import FileBuilder from "./FileBuilder.js";
4
- import { getRootPath } from "./../../../cli/resolvers/path.js";
4
+ import { getResolvePath } from "./../../../cli/resolvers/path.js";
5
5
  class TypescriptConfig_default extends FileBuilder {
6
6
  constructor(config) {
7
7
  super(config);
@@ -19,7 +19,7 @@ class TypescriptConfig_default extends FileBuilder {
19
19
  return JSON.stringify(this.json(), null, 2);
20
20
  }
21
21
  alias() {
22
- const srcDir = this.config.sourceDir;
22
+ const srcDir = this.config.srcDir;
23
23
  const sharedDir = path.posix.join(srcDir, this.config.sharedDir);
24
24
  return {
25
25
  [srcDir]: srcDir,
@@ -29,10 +29,10 @@ class TypescriptConfig_default extends FileBuilder {
29
29
  };
30
30
  }
31
31
  aliases() {
32
- return _.mapValues(this.alias(), (value) => getRootPath(value));
32
+ return _.mapValues(this.alias(), (value) => getResolvePath(value));
33
33
  }
34
34
  json() {
35
- const outputDir = path.posix.join("..", this.config.outputDir);
35
+ const outputDir = path.posix.join("..", this.config.outDir);
36
36
  return {
37
37
  compilerOptions: {
38
38
  target: "ESNext",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/plugins/typescript/TypescriptConfig.ts"],"sourcesContent":["import path from \"path\";\nimport _ from \"lodash\";\nimport {TsConfigJson} from \"type-fest\";\n\nimport FileBuilder from \"./FileBuilder\";\n\nimport {getRootPath} from \"@cli/resolvers/path\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport default class extends FileBuilder {\n public constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n protected filename(): string {\n return \"tsconfig.json\";\n }\n\n protected withBanner(): boolean {\n return false;\n }\n\n protected template(): string {\n return \"\"; // Not need is this place\n }\n\n protected content(): string {\n return JSON.stringify(this.json(), null, 2);\n }\n\n protected alias(): Record<string, string> {\n const srcDir = this.config.sourceDir;\n const sharedDir = path.posix.join(srcDir, this.config.sharedDir);\n\n return {\n [srcDir]: srcDir,\n \"@\": srcDir,\n \"@shared\": sharedDir,\n \"~\": sharedDir,\n };\n }\n\n public aliases(): Record<string, string> {\n return _.mapValues(this.alias(), value => getRootPath(value));\n }\n\n public json(): TsConfigJson {\n const outputDir = path.posix.join(\"..\", this.config.outputDir);\n\n return {\n compilerOptions: {\n target: \"ESNext\",\n module: \"ESNext\",\n moduleResolution: \"Bundler\",\n esModuleInterop: true,\n forceConsistentCasingInFileNames: true,\n resolveJsonModule: true,\n strict: true,\n skipLibCheck: true,\n noEmit: true,\n outDir: outputDir,\n paths: _.reduce(\n this.alias(),\n (paths, value, key) => ({\n ...paths,\n [path.posix.join(key, \"*\")]: [path.posix.join(\"..\", value, \"*\")],\n }),\n {} as Record<string, string[]>\n ),\n },\n include: [\n \"../**/*\",\n \"./vendor.d.ts\",\n \"./locale.d.ts\",\n \"./service.d.ts\",\n \"./relay.d.ts\",\n \"./offscreen.d.ts\",\n \"./icon.d.ts\",\n \"./page.d.ts\",\n \"./popup.d.ts\",\n \"./sidebar.d.ts\",\n ],\n exclude: [outputDir],\n };\n }\n}\n"],"mappings":"AAAA,OAAO,UAAU;AACjB,OAAO,OAAO;AAGd,OAAO,iBAAiB;AAExB,SAAQ,mBAAkB;AAI1B,MAAO,iCAAsB,YAAY;AAAA,EAC9B,YAAY,QAAwB;AACvC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,WAAmB;AACzB,WAAO;AAAA,EACX;AAAA,EAEU,aAAsB;AAC5B,WAAO;AAAA,EACX;AAAA,EAEU,WAAmB;AACzB,WAAO;AAAA,EACX;AAAA,EAEU,UAAkB;AACxB,WAAO,KAAK,UAAU,KAAK,KAAK,GAAG,MAAM,CAAC;AAAA,EAC9C;AAAA,EAEU,QAAgC;AACtC,UAAM,SAAS,KAAK,OAAO;AAC3B,UAAM,YAAY,KAAK,MAAM,KAAK,QAAQ,KAAK,OAAO,SAAS;AAE/D,WAAO;AAAA,MACH,CAAC,MAAM,GAAG;AAAA,MACV,KAAK;AAAA,MACL,WAAW;AAAA,MACX,KAAK;AAAA,IACT;AAAA,EACJ;AAAA,EAEO,UAAkC;AACrC,WAAO,EAAE,UAAU,KAAK,MAAM,GAAG,WAAS,YAAY,KAAK,CAAC;AAAA,EAChE;AAAA,EAEO,OAAqB;AACxB,UAAM,YAAY,KAAK,MAAM,KAAK,MAAM,KAAK,OAAO,SAAS;AAE7D,WAAO;AAAA,MACH,iBAAiB;AAAA,QACb,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,kBAAkB;AAAA,QAClB,iBAAiB;AAAA,QACjB,kCAAkC;AAAA,QAClC,mBAAmB;AAAA,QACnB,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,OAAO,EAAE;AAAA,UACL,KAAK,MAAM;AAAA,UACX,CAAC,OAAO,OAAO,SAAS;AAAA,YACpB,GAAG;AAAA,YACH,CAAC,KAAK,MAAM,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,MAAM,KAAK,MAAM,OAAO,GAAG,CAAC;AAAA,UACnE;AAAA,UACA,CAAC;AAAA,QACL;AAAA,MACJ;AAAA,MACA,SAAS;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,MACA,SAAS,CAAC,SAAS;AAAA,IACvB;AAAA,EACJ;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/cli/plugins/typescript/TypescriptConfig.ts"],"sourcesContent":["import path from \"path\";\nimport _ from \"lodash\";\nimport {TsConfigJson} from \"type-fest\";\n\nimport FileBuilder from \"./FileBuilder\";\n\nimport {getResolvePath} from \"@cli/resolvers/path\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport default class extends FileBuilder {\n public constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n protected filename(): string {\n return \"tsconfig.json\";\n }\n\n protected withBanner(): boolean {\n return false;\n }\n\n protected template(): string {\n return \"\"; // Not need is this place\n }\n\n protected content(): string {\n return JSON.stringify(this.json(), null, 2);\n }\n\n protected alias(): Record<string, string> {\n const srcDir = this.config.srcDir;\n const sharedDir = path.posix.join(srcDir, this.config.sharedDir);\n\n return {\n [srcDir]: srcDir,\n \"@\": srcDir,\n \"@shared\": sharedDir,\n \"~\": sharedDir,\n };\n }\n\n public aliases(): Record<string, string> {\n return _.mapValues(this.alias(), value => getResolvePath(value));\n }\n\n public json(): TsConfigJson {\n const outputDir = path.posix.join(\"..\", this.config.outDir);\n\n return {\n compilerOptions: {\n target: \"ESNext\",\n module: \"ESNext\",\n moduleResolution: \"Bundler\",\n esModuleInterop: true,\n forceConsistentCasingInFileNames: true,\n resolveJsonModule: true,\n strict: true,\n skipLibCheck: true,\n noEmit: true,\n outDir: outputDir,\n paths: _.reduce(\n this.alias(),\n (paths, value, key) => ({\n ...paths,\n [path.posix.join(key, \"*\")]: [path.posix.join(\"..\", value, \"*\")],\n }),\n {} as Record<string, string[]>\n ),\n },\n include: [\n \"../**/*\",\n \"./vendor.d.ts\",\n \"./locale.d.ts\",\n \"./service.d.ts\",\n \"./relay.d.ts\",\n \"./offscreen.d.ts\",\n \"./icon.d.ts\",\n \"./page.d.ts\",\n \"./popup.d.ts\",\n \"./sidebar.d.ts\",\n ],\n exclude: [outputDir],\n };\n }\n}\n"],"mappings":"AAAA,OAAO,UAAU;AACjB,OAAO,OAAO;AAGd,OAAO,iBAAiB;AAExB,SAAQ,sBAAqB;AAI7B,MAAO,iCAAsB,YAAY;AAAA,EAC9B,YAAY,QAAwB;AACvC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEU,WAAmB;AACzB,WAAO;AAAA,EACX;AAAA,EAEU,aAAsB;AAC5B,WAAO;AAAA,EACX;AAAA,EAEU,WAAmB;AACzB,WAAO;AAAA,EACX;AAAA,EAEU,UAAkB;AACxB,WAAO,KAAK,UAAU,KAAK,KAAK,GAAG,MAAM,CAAC;AAAA,EAC9C;AAAA,EAEU,QAAgC;AACtC,UAAM,SAAS,KAAK,OAAO;AAC3B,UAAM,YAAY,KAAK,MAAM,KAAK,QAAQ,KAAK,OAAO,SAAS;AAE/D,WAAO;AAAA,MACH,CAAC,MAAM,GAAG;AAAA,MACV,KAAK;AAAA,MACL,WAAW;AAAA,MACX,KAAK;AAAA,IACT;AAAA,EACJ;AAAA,EAEO,UAAkC;AACrC,WAAO,EAAE,UAAU,KAAK,MAAM,GAAG,WAAS,eAAe,KAAK,CAAC;AAAA,EACnE;AAAA,EAEO,OAAqB;AACxB,UAAM,YAAY,KAAK,MAAM,KAAK,MAAM,KAAK,OAAO,MAAM;AAE1D,WAAO;AAAA,MACH,iBAAiB;AAAA,QACb,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,kBAAkB;AAAA,QAClB,iBAAiB;AAAA,QACjB,kCAAkC;AAAA,QAClC,mBAAmB;AAAA,QACnB,QAAQ;AAAA,QACR,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,OAAO,EAAE;AAAA,UACL,KAAK,MAAM;AAAA,UACX,CAAC,OAAO,OAAO,SAAS;AAAA,YACpB,GAAG;AAAA,YACH,CAAC,KAAK,MAAM,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,MAAM,KAAK,MAAM,OAAO,GAAG,CAAC;AAAA,UACnE;AAAA,UACA,CAAC;AAAA,QACL;AAAA,MACJ;AAAA,MACA,SAAS;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,MACA,SAAS,CAAC,SAAS;AAAA,IACvB;AAAA,EACJ;AACJ;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import FileBuilder from '../FileBuilder.js';
2
- import { R as ReadonlyConfig } from '../../../../config-DzmiK3GH.js';
2
+ import { R as ReadonlyConfig } from '../../../../config-Ce0Le6r4.js';
3
3
  import '@rspack/core';
4
4
  import 'html-rspack-tags-plugin';
5
5
  import '../../../../types/app.js';
@@ -13,6 +13,7 @@ import '../../../../types/helpers.js';
13
13
  import '../../../../types/background.js';
14
14
  import '../../../../types/command.js';
15
15
  import '../../../../types/locale.js';
16
+ import '../../../../types/env.js';
16
17
 
17
18
  declare class export_default extends FileBuilder {
18
19
  constructor(config: ReadonlyConfig);
@@ -1,7 +1,7 @@
1
1
  export { default as TransportDeclaration, TransportDeclarationLayer } from './transport/TransportDeclaration.js';
2
2
  export { default as VendorDeclaration } from './VendorDeclaration.js';
3
3
  import '../FileBuilder.js';
4
- import '../../../../config-DzmiK3GH.js';
4
+ import '../../../../config-Ce0Le6r4.js';
5
5
  import '@rspack/core';
6
6
  import 'html-rspack-tags-plugin';
7
7
  import '../../../../types/app.js';
@@ -15,3 +15,4 @@ import '../../../../types/helpers.js';
15
15
  import '../../../../types/background.js';
16
16
  import '../../../../types/command.js';
17
17
  import '../../../../types/locale.js';
18
+ import '../../../../types/env.js';
@@ -1,5 +1,5 @@
1
1
  import FileBuilder from '../../FileBuilder.js';
2
- import { R as ReadonlyConfig } from '../../../../../config-DzmiK3GH.js';
2
+ import { R as ReadonlyConfig } from '../../../../../config-Ce0Le6r4.js';
3
3
  import '@rspack/core';
4
4
  import 'html-rspack-tags-plugin';
5
5
  import '../../../../../types/app.js';
@@ -13,6 +13,7 @@ import '../../../../../types/helpers.js';
13
13
  import '../../../../../types/background.js';
14
14
  import '../../../../../types/command.js';
15
15
  import '../../../../../types/locale.js';
16
+ import '../../../../../types/env.js';
16
17
 
17
18
  declare enum TransportDeclarationLayer {
18
19
  Service = "service",
@@ -1,6 +1,6 @@
1
1
  export { default as TransportDeclaration, TransportDeclarationLayer } from './TransportDeclaration.js';
2
2
  import '../../FileBuilder.js';
3
- import '../../../../../config-DzmiK3GH.js';
3
+ import '../../../../../config-Ce0Le6r4.js';
4
4
  import '@rspack/core';
5
5
  import 'html-rspack-tags-plugin';
6
6
  import '../../../../../types/app.js';
@@ -14,3 +14,4 @@ import '../../../../../types/helpers.js';
14
14
  import '../../../../../types/background.js';
15
15
  import '../../../../../types/command.js';
16
16
  import '../../../../../types/locale.js';
17
+ import '../../../../../types/env.js';
@@ -1,4 +1,4 @@
1
- import { b as PluginDefinition } from '../../../config-DzmiK3GH.js';
1
+ import { b as PluginDefinition } from '../../../config-Ce0Le6r4.js';
2
2
  export { default as TypescriptConfig } from './TypescriptConfig.js';
3
3
  export { default as TransportDeclaration, TransportDeclarationLayer } from './declaration/transport/TransportDeclaration.js';
4
4
  export { default as VendorDeclaration } from './declaration/VendorDeclaration.js';
@@ -16,6 +16,7 @@ import '../../../types/helpers.js';
16
16
  import '../../../types/background.js';
17
17
  import '../../../types/command.js';
18
18
  import '../../../types/locale.js';
19
+ import '../../../types/env.js';
19
20
  import 'type-fest';
20
21
 
21
22
  declare const _default: PluginDefinition<[]>;
@@ -1,4 +1,4 @@
1
- import { R as ReadonlyConfig } from '../../../config-DzmiK3GH.js';
1
+ import { R as ReadonlyConfig } from '../../../config-Ce0Le6r4.js';
2
2
  import '@rspack/core';
3
3
  import 'html-rspack-tags-plugin';
4
4
  import '../../../types/app.js';
@@ -12,6 +12,7 @@ import '../../../types/helpers.js';
12
12
  import '../../../types/background.js';
13
13
  import '../../../types/command.js';
14
14
  import '../../../types/locale.js';
15
+ import '../../../types/env.js';
15
16
 
16
17
  declare abstract class AbstractVersion {
17
18
  protected readonly config: ReadonlyConfig;
@@ -1,5 +1,5 @@
1
1
  import AbstractVersion from './AbstractVersion.js';
2
- import { R as ReadonlyConfig } from '../../../config-DzmiK3GH.js';
2
+ import { R as ReadonlyConfig } from '../../../config-Ce0Le6r4.js';
3
3
  import '@rspack/core';
4
4
  import 'html-rspack-tags-plugin';
5
5
  import '../../../types/app.js';
@@ -13,6 +13,7 @@ import '../../../types/helpers.js';
13
13
  import '../../../types/background.js';
14
14
  import '../../../types/command.js';
15
15
  import '../../../types/locale.js';
16
+ import '../../../types/env.js';
16
17
 
17
18
  declare class export_default extends AbstractVersion {
18
19
  constructor(config: ReadonlyConfig);
@@ -1,7 +1,7 @@
1
1
  import fs from "fs";
2
2
  import semver from "semver";
3
3
  import { getEnv } from "./../../../main/env.js";
4
- import { getInputPath } from "./../../../cli/resolvers/path.js";
4
+ import { fromRootPath } from "./../../../cli/resolvers/path.js";
5
5
  import AbstractVersion from "./AbstractVersion.js";
6
6
  class AddonVersion_default extends AbstractVersion {
7
7
  constructor(config) {
@@ -19,7 +19,7 @@ class AddonVersion_default extends AbstractVersion {
19
19
  if (semver.valid(envVersion)) {
20
20
  return envVersion;
21
21
  }
22
- const packagePath = getInputPath(this.config, "package.json");
22
+ const packagePath = fromRootPath(this.config, "package.json");
23
23
  try {
24
24
  const packageJson = JSON.parse(fs.readFileSync(packagePath, "utf-8"));
25
25
  return packageJson.version;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/plugins/version/AddonVersion.ts"],"sourcesContent":["import fs from \"fs\";\nimport semver from \"semver\";\n\nimport {getEnv} from \"@main/env\";\nimport {getInputPath} from \"@cli/resolvers/path\";\n\nimport AbstractVersion from \"./AbstractVersion\";\n\nimport type {ReadonlyConfig} from \"@typing/config\";\n\nexport default class extends AbstractVersion {\n constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n public getVersion(): string | undefined {\n const version = this.extractVersionValue(this.config.version);\n\n if (!version) {\n return;\n }\n\n if (semver.valid(version)) {\n return version;\n }\n\n const envVersion = getEnv(version);\n\n if (semver.valid(envVersion)) {\n return envVersion;\n }\n\n const packagePath = getInputPath(this.config, \"package.json\");\n\n try {\n const packageJson = JSON.parse(fs.readFileSync(packagePath, \"utf-8\"));\n\n return packageJson.version;\n } catch (e) {\n console.error(`Unable to read version from \"${packagePath}\"`, e);\n }\n }\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AACf,OAAO,YAAY;AAEnB,SAAQ,cAAa;AACrB,SAAQ,oBAAmB;AAE3B,OAAO,qBAAqB;AAI5B,MAAO,6BAAsB,gBAAgB;AAAA,EACzC,YAAY,QAAwB;AAChC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEO,aAAiC;AACpC,UAAM,UAAU,KAAK,oBAAoB,KAAK,OAAO,OAAO;AAE5D,QAAI,CAAC,SAAS;AACV;AAAA,IACJ;AAEA,QAAI,OAAO,MAAM,OAAO,GAAG;AACvB,aAAO;AAAA,IACX;AAEA,UAAM,aAAa,OAAO,OAAO;AAEjC,QAAI,OAAO,MAAM,UAAU,GAAG;AAC1B,aAAO;AAAA,IACX;AAEA,UAAM,cAAc,aAAa,KAAK,QAAQ,cAAc;AAE5D,QAAI;AACA,YAAM,cAAc,KAAK,MAAM,GAAG,aAAa,aAAa,OAAO,CAAC;AAEpE,aAAO,YAAY;AAAA,IACvB,SAAS,GAAG;AACR,cAAQ,MAAM,gCAAgC,WAAW,KAAK,CAAC;AAAA,IACnE;AAAA,EACJ;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../../src/cli/plugins/version/AddonVersion.ts"],"sourcesContent":["import fs from \"fs\";\nimport semver from \"semver\";\n\nimport {getEnv} from \"@main/env\";\nimport {fromRootPath} from \"@cli/resolvers/path\";\n\nimport AbstractVersion from \"./AbstractVersion\";\n\nimport type {ReadonlyConfig} from \"@typing/config\";\n\nexport default class extends AbstractVersion {\n constructor(config: ReadonlyConfig) {\n super(config);\n }\n\n public getVersion(): string | undefined {\n const version = this.extractVersionValue(this.config.version);\n\n if (!version) {\n return;\n }\n\n if (semver.valid(version)) {\n return version;\n }\n\n const envVersion = getEnv(version);\n\n if (semver.valid(envVersion)) {\n return envVersion;\n }\n\n const packagePath = fromRootPath(this.config, \"package.json\");\n\n try {\n const packageJson = JSON.parse(fs.readFileSync(packagePath, \"utf-8\"));\n\n return packageJson.version;\n } catch (e) {\n console.error(`Unable to read version from \"${packagePath}\"`, e);\n }\n }\n}\n"],"mappings":"AAAA,OAAO,QAAQ;AACf,OAAO,YAAY;AAEnB,SAAQ,cAAa;AACrB,SAAQ,oBAAmB;AAE3B,OAAO,qBAAqB;AAI5B,MAAO,6BAAsB,gBAAgB;AAAA,EACzC,YAAY,QAAwB;AAChC,UAAM,MAAM;AAAA,EAChB;AAAA,EAEO,aAAiC;AACpC,UAAM,UAAU,KAAK,oBAAoB,KAAK,OAAO,OAAO;AAE5D,QAAI,CAAC,SAAS;AACV;AAAA,IACJ;AAEA,QAAI,OAAO,MAAM,OAAO,GAAG;AACvB,aAAO;AAAA,IACX;AAEA,UAAM,aAAa,OAAO,OAAO;AAEjC,QAAI,OAAO,MAAM,UAAU,GAAG;AAC1B,aAAO;AAAA,IACX;AAEA,UAAM,cAAc,aAAa,KAAK,QAAQ,cAAc;AAE5D,QAAI;AACA,YAAM,cAAc,KAAK,MAAM,GAAG,aAAa,aAAa,OAAO,CAAC;AAEpE,aAAO,YAAY;AAAA,IACvB,SAAS,GAAG;AACR,cAAQ,MAAM,gCAAgC,WAAW,KAAK,CAAC;AAAA,IACnE;AAAA,EACJ;AACJ;","names":[]}
@@ -1,5 +1,5 @@
1
1
  import AbstractVersion from './AbstractVersion.js';
2
- import { R as ReadonlyConfig } from '../../../config-DzmiK3GH.js';
2
+ import { R as ReadonlyConfig } from '../../../config-Ce0Le6r4.js';
3
3
  import '@rspack/core';
4
4
  import 'html-rspack-tags-plugin';
5
5
  import '../../../types/app.js';
@@ -13,6 +13,7 @@ import '../../../types/helpers.js';
13
13
  import '../../../types/background.js';
14
14
  import '../../../types/command.js';
15
15
  import '../../../types/locale.js';
16
+ import '../../../types/env.js';
16
17
 
17
18
  declare class export_default extends AbstractVersion {
18
19
  constructor(config: ReadonlyConfig);
@@ -1,4 +1,4 @@
1
- import { b as PluginDefinition } from '../../../config-DzmiK3GH.js';
1
+ import { b as PluginDefinition } from '../../../config-Ce0Le6r4.js';
2
2
  export { default as AddonVersion } from './AddonVersion.js';
3
3
  export { default as BrowserMinimumVersion } from './BrowserMinimumVersion.js';
4
4
  import '@rspack/core';
@@ -14,6 +14,7 @@ import '../../../types/helpers.js';
14
14
  import '../../../types/background.js';
15
15
  import '../../../types/command.js';
16
16
  import '../../../types/locale.js';
17
+ import '../../../types/env.js';
17
18
  import './AbstractVersion.js';
18
19
 
19
20
  declare const _default: PluginDefinition<[]>;
@@ -1,6 +1,6 @@
1
1
  import { HtmlRspackPluginOptions } from '@rspack/core';
2
2
  import { Options } from 'html-rspack-tags-plugin';
3
- import { R as ReadonlyConfig } from '../../../config-DzmiK3GH.js';
3
+ import { R as ReadonlyConfig } from '../../../config-Ce0Le6r4.js';
4
4
  import { EntrypointEntries } from '../../../types/entrypoint.js';
5
5
  import export_default$1 from '../../entrypoint/finder/AbstractViewFinder.js';
6
6
  import { ViewEntrypointOptions } from '../../../types/view.js';
@@ -14,6 +14,7 @@ import '../../../types/helpers.js';
14
14
  import '../../../types/background.js';
15
15
  import '../../../types/command.js';
16
16
  import '../../../types/locale.js';
17
+ import '../../../types/env.js';
17
18
  import '../../entrypoint/finder/AbstractPluginFinder.js';
18
19
  import '../../entrypoint/finder/AbstractEntrypointFinder.js';
19
20
  import '../../entrypoint/finder/AbstractOptionsFinder.js';
@@ -1,4 +1,4 @@
1
- import { b as PluginDefinition } from '../../../config-DzmiK3GH.js';
1
+ import { b as PluginDefinition } from '../../../config-Ce0Le6r4.js';
2
2
  export { default as View } from './View.js';
3
3
  import '@rspack/core';
4
4
  import 'html-rspack-tags-plugin';
@@ -13,6 +13,7 @@ import '../../../types/helpers.js';
13
13
  import '../../../types/background.js';
14
14
  import '../../../types/command.js';
15
15
  import '../../../types/locale.js';
16
+ import '../../../types/env.js';
16
17
  import '../../entrypoint/finder/AbstractViewFinder.js';
17
18
  import '../../entrypoint/finder/AbstractPluginFinder.js';
18
19
  import '../../entrypoint/finder/AbstractEntrypointFinder.js';
@@ -1,5 +1,5 @@
1
1
  import { Configuration } from '@rspack/core';
2
- import { R as ReadonlyConfig } from '../../config-DzmiK3GH.js';
2
+ import { R as ReadonlyConfig } from '../../config-Ce0Le6r4.js';
3
3
  import 'html-rspack-tags-plugin';
4
4
  import '../../types/app.js';
5
5
  import '../../types/browser.js';
@@ -12,6 +12,7 @@ import '../../types/helpers.js';
12
12
  import '../../types/background.js';
13
13
  import '../../types/command.js';
14
14
  import '../../types/locale.js';
15
+ import '../../types/env.js';
15
16
 
16
17
  declare const _default: (config: ReadonlyConfig) => Promise<Configuration>;
17
18
 
@@ -1,4 +1,4 @@
1
- import { O as OptionalConfig, C as Config } from '../../config-DzmiK3GH.js';
1
+ import { O as OptionalConfig, C as Config } from '../../config-Ce0Le6r4.js';
2
2
  import '@rspack/core';
3
3
  import 'html-rspack-tags-plugin';
4
4
  import '../../types/app.js';
@@ -12,6 +12,7 @@ import '../../types/helpers.js';
12
12
  import '../../types/background.js';
13
13
  import '../../types/command.js';
14
14
  import '../../types/locale.js';
15
+ import '../../types/env.js';
15
16
 
16
17
  declare const _default: (config: OptionalConfig) => Promise<Config>;
17
18