adnbn 0.2.6 → 0.2.8

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 (173) 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/finder/AbstractAssetFinder.d.ts +2 -1
  5. package/dist/cli/entrypoint/finder/AbstractAssetFinder.js +2 -2
  6. package/dist/cli/entrypoint/finder/AbstractAssetFinder.js.map +1 -1
  7. package/dist/cli/entrypoint/finder/AbstractEntrypointFinder.d.ts +2 -1
  8. package/dist/cli/entrypoint/finder/AbstractFinder.d.ts +2 -1
  9. package/dist/cli/entrypoint/finder/AbstractOptionsFinder.d.ts +2 -1
  10. package/dist/cli/entrypoint/finder/AbstractPluginFinder.d.ts +2 -1
  11. package/dist/cli/entrypoint/finder/AbstractTransportFinder.d.ts +2 -1
  12. package/dist/cli/entrypoint/finder/AbstractViewFinder.d.ts +2 -1
  13. package/dist/cli/entrypoint/finder/AssetPluginFinder.d.ts +2 -1
  14. package/dist/cli/entrypoint/finder/BackgroundFinder.d.ts +2 -1
  15. package/dist/cli/entrypoint/finder/CommandFinder.d.ts +2 -1
  16. package/dist/cli/entrypoint/finder/ContentFinder.d.ts +2 -1
  17. package/dist/cli/entrypoint/finder/IconFinder.d.ts +2 -1
  18. package/dist/cli/entrypoint/finder/IconFinder.js +1 -1
  19. package/dist/cli/entrypoint/finder/IconFinder.js.map +1 -1
  20. package/dist/cli/entrypoint/finder/LocaleFinder.d.ts +2 -1
  21. package/dist/cli/entrypoint/finder/OffscreenFinder.d.ts +2 -1
  22. package/dist/cli/entrypoint/finder/OffscreenViewFinder.d.ts +2 -1
  23. package/dist/cli/entrypoint/finder/PageFinder.d.ts +2 -1
  24. package/dist/cli/entrypoint/finder/PluginFinder.d.ts +2 -1
  25. package/dist/cli/entrypoint/finder/PopupFinder.d.ts +2 -1
  26. package/dist/cli/entrypoint/finder/RelayFinder.d.ts +2 -1
  27. package/dist/cli/entrypoint/finder/ServiceFinder.d.ts +2 -1
  28. package/dist/cli/entrypoint/finder/SidebarFinder.d.ts +2 -1
  29. package/dist/cli/entrypoint/finder/index.d.ts +2 -1
  30. package/dist/cli/entrypoint/index.d.ts +2 -1
  31. package/dist/cli/entrypoint/parser/AbstractParser.d.ts +2 -1
  32. package/dist/cli/entrypoint/parser/AbstractParser.js +1 -1
  33. package/dist/cli/entrypoint/parser/AbstractParser.js.map +1 -1
  34. package/dist/cli/entrypoint/parser/BackgroundParser.d.ts +2 -1
  35. package/dist/cli/entrypoint/parser/CommandParser.d.ts +2 -1
  36. package/dist/cli/entrypoint/parser/ContentParser.d.ts +2 -1
  37. package/dist/cli/entrypoint/parser/OffscreenParser.d.ts +2 -1
  38. package/dist/cli/entrypoint/parser/PageParser.d.ts +2 -1
  39. package/dist/cli/entrypoint/parser/PopupParser.d.ts +2 -1
  40. package/dist/cli/entrypoint/parser/RelayParser.d.ts +2 -1
  41. package/dist/cli/entrypoint/parser/ServiceParser.d.ts +2 -1
  42. package/dist/cli/entrypoint/parser/SidebarParser.d.ts +2 -1
  43. package/dist/cli/entrypoint/parser/ViewParser.d.ts +84 -84
  44. package/dist/cli/entrypoint/parser/index.d.ts +2 -1
  45. package/dist/cli/index.js +2 -2
  46. package/dist/cli/index.js.map +1 -1
  47. package/dist/cli/plugins/asset.d.ts +2 -1
  48. package/dist/cli/plugins/background/Background.d.ts +2 -1
  49. package/dist/cli/plugins/background/BackgroundEntry.d.ts +2 -1
  50. package/dist/cli/plugins/background/BackgroundManifest.d.ts +2 -1
  51. package/dist/cli/plugins/background/Command.d.ts +2 -1
  52. package/dist/cli/plugins/background/Service.d.ts +2 -1
  53. package/dist/cli/plugins/background/ServiceDeclaration.d.ts +2 -1
  54. package/dist/cli/plugins/background/index.d.ts +2 -1
  55. package/dist/cli/plugins/bundler.d.ts +2 -1
  56. package/dist/cli/plugins/bundler.js +1 -15
  57. package/dist/cli/plugins/bundler.js.map +1 -1
  58. package/dist/cli/plugins/content/Content.d.ts +2 -1
  59. package/dist/cli/plugins/content/ContentDriver.d.ts +2 -1
  60. package/dist/cli/plugins/content/ContentManager.d.ts +2 -1
  61. package/dist/cli/plugins/content/ContentName.d.ts +2 -1
  62. package/dist/cli/plugins/content/Relay.d.ts +2 -1
  63. package/dist/cli/plugins/content/RelayDeclaration.d.ts +2 -1
  64. package/dist/cli/plugins/content/index.d.ts +2 -1
  65. package/dist/cli/plugins/dotenv/crypt.d.ts +4 -0
  66. package/dist/cli/plugins/dotenv/crypt.js +26 -0
  67. package/dist/cli/plugins/dotenv/crypt.js.map +1 -0
  68. package/dist/cli/plugins/dotenv/index.d.ts +2 -1
  69. package/dist/cli/plugins/dotenv/index.js +9 -12
  70. package/dist/cli/plugins/dotenv/index.js.map +1 -1
  71. package/dist/cli/plugins/dotenv/utils.d.ts +9 -4
  72. package/dist/cli/plugins/dotenv/utils.js +31 -26
  73. package/dist/cli/plugins/dotenv/utils.js.map +1 -1
  74. package/dist/cli/plugins/html.d.ts +2 -1
  75. package/dist/cli/plugins/icon/Icon.d.ts +2 -1
  76. package/dist/cli/plugins/icon/Icon.js +1 -1
  77. package/dist/cli/plugins/icon/Icon.js.map +1 -1
  78. package/dist/cli/plugins/icon/declaration/IconDeclaration.d.ts +2 -1
  79. package/dist/cli/plugins/icon/declaration/index.d.ts +2 -1
  80. package/dist/cli/plugins/icon/index.d.ts +2 -1
  81. package/dist/cli/plugins/icon/index.js +1 -2
  82. package/dist/cli/plugins/icon/index.js.map +1 -1
  83. package/dist/cli/plugins/index.d.ts +2 -1
  84. package/dist/cli/plugins/locale/Locale.d.ts +2 -1
  85. package/dist/cli/plugins/locale/declaration/LocaleDeclaration.d.ts +2 -1
  86. package/dist/cli/plugins/locale/declaration/index.d.ts +2 -1
  87. package/dist/cli/plugins/locale/index.d.ts +2 -1
  88. package/dist/cli/plugins/meta/AbstractMeta.d.ts +2 -1
  89. package/dist/cli/plugins/meta/Author.d.ts +2 -1
  90. package/dist/cli/plugins/meta/Email.d.ts +2 -1
  91. package/dist/cli/plugins/meta/Homepage.d.ts +2 -1
  92. package/dist/cli/plugins/meta/Incognito.d.ts +2 -1
  93. package/dist/cli/plugins/meta/index.d.ts +2 -1
  94. package/dist/cli/plugins/offscreen/Offscreen.d.ts +2 -1
  95. package/dist/cli/plugins/offscreen/OffscreenDeclaration.d.ts +2 -1
  96. package/dist/cli/plugins/offscreen/index.d.ts +2 -1
  97. package/dist/cli/plugins/optimization.d.ts +2 -1
  98. package/dist/cli/plugins/optimization.js +2 -2
  99. package/dist/cli/plugins/optimization.js.map +1 -1
  100. package/dist/cli/plugins/output.d.ts +2 -1
  101. package/dist/cli/plugins/output.js +2 -2
  102. package/dist/cli/plugins/output.js.map +1 -1
  103. package/dist/cli/plugins/page/Page.d.ts +2 -1
  104. package/dist/cli/plugins/page/declaration/PageDeclaration.d.ts +2 -1
  105. package/dist/cli/plugins/page/declaration/index.d.ts +2 -1
  106. package/dist/cli/plugins/page/index.d.ts +2 -1
  107. package/dist/cli/plugins/popup/Popup.d.ts +2 -1
  108. package/dist/cli/plugins/popup/declaration/PopupDeclaration.d.ts +2 -1
  109. package/dist/cli/plugins/popup/declaration/index.d.ts +2 -1
  110. package/dist/cli/plugins/popup/index.d.ts +2 -1
  111. package/dist/cli/plugins/public.d.ts +2 -1
  112. package/dist/cli/plugins/react.d.ts +2 -1
  113. package/dist/cli/plugins/react.js +4 -4
  114. package/dist/cli/plugins/react.js.map +1 -1
  115. package/dist/cli/plugins/sidebar/Sidebar.d.ts +2 -1
  116. package/dist/cli/plugins/sidebar/declaration/SidebarDeclaration.d.ts +2 -1
  117. package/dist/cli/plugins/sidebar/declaration/index.d.ts +2 -1
  118. package/dist/cli/plugins/sidebar/index.d.ts +2 -1
  119. package/dist/cli/plugins/style.d.ts +2 -1
  120. package/dist/cli/plugins/style.js +4 -4
  121. package/dist/cli/plugins/style.js.map +1 -1
  122. package/dist/cli/plugins/typescript/FileBuilder.d.ts +2 -1
  123. package/dist/cli/plugins/typescript/FileBuilder.js +2 -2
  124. package/dist/cli/plugins/typescript/FileBuilder.js.map +1 -1
  125. package/dist/cli/plugins/typescript/TypescriptConfig.d.ts +2 -1
  126. package/dist/cli/plugins/typescript/TypescriptConfig.js +4 -4
  127. package/dist/cli/plugins/typescript/TypescriptConfig.js.map +1 -1
  128. package/dist/cli/plugins/typescript/declaration/VendorDeclaration.d.ts +2 -1
  129. package/dist/cli/plugins/typescript/declaration/index.d.ts +2 -1
  130. package/dist/cli/plugins/typescript/declaration/transport/TransportDeclaration.d.ts +2 -1
  131. package/dist/cli/plugins/typescript/declaration/transport/index.d.ts +2 -1
  132. package/dist/cli/plugins/typescript/index.d.ts +2 -1
  133. package/dist/cli/plugins/version/AbstractVersion.d.ts +2 -1
  134. package/dist/cli/plugins/version/AddonVersion.d.ts +2 -1
  135. package/dist/cli/plugins/version/AddonVersion.js +2 -2
  136. package/dist/cli/plugins/version/AddonVersion.js.map +1 -1
  137. package/dist/cli/plugins/version/BrowserMinimumVersion.d.ts +2 -1
  138. package/dist/cli/plugins/version/index.d.ts +2 -1
  139. package/dist/cli/plugins/view/View.d.ts +2 -1
  140. package/dist/cli/plugins/view/index.d.ts +2 -1
  141. package/dist/cli/resolvers/bundler.d.ts +2 -1
  142. package/dist/cli/resolvers/config.d.ts +2 -1
  143. package/dist/cli/resolvers/config.js +32 -24
  144. package/dist/cli/resolvers/config.js.map +1 -1
  145. package/dist/cli/resolvers/path.d.ts +6 -4
  146. package/dist/cli/resolvers/path.js +24 -14
  147. package/dist/cli/resolvers/path.js.map +1 -1
  148. package/dist/cli/resolvers/plugin.d.ts +2 -1
  149. package/dist/{config-DzmiK3GH.d.ts → config-Ce0Le6r4.d.ts} +90 -59
  150. package/dist/entry/offscreen/Builder.d.ts +3 -3
  151. package/dist/entry/relay/Builder.d.ts +3 -3
  152. package/dist/index.d.ts +2 -1
  153. package/dist/locale/adapters/react/LocaleProvider.d.ts +8 -0
  154. package/dist/locale/adapters/react/LocaleProvider.js +47 -0
  155. package/dist/locale/adapters/react/LocaleProvider.js.map +1 -0
  156. package/dist/locale/adapters/react/context.d.ts +2 -3
  157. package/dist/locale/adapters/react/index.d.ts +2 -8
  158. package/dist/main/config.d.ts +3 -2
  159. package/dist/main/env.js +1 -1
  160. package/dist/main/env.js.map +1 -1
  161. package/dist/main/index.d.ts +2 -1
  162. package/dist/main/plugin.d.ts +3 -2
  163. package/dist/message/MessageManager.js +4 -1
  164. package/dist/message/MessageManager.js.map +1 -1
  165. package/dist/message/adapters/react/useMessageHandler.d.ts +2 -2
  166. package/dist/message/adapters/react/useMessageHandler.js +15 -8
  167. package/dist/message/adapters/react/useMessageHandler.js.map +1 -1
  168. package/dist/types/config.d.ts +2 -1
  169. package/dist/types/env.d.ts +9 -0
  170. package/dist/types/env.js +5 -0
  171. package/dist/types/env.js.map +1 -0
  172. package/dist/types/plugin.d.ts +2 -1
  173. package/package.json +18 -22
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/resolvers/config.ts"],"sourcesContent":["import {existsSync} from \"fs\";\nimport dotenv, {type DotenvParseOutput} from \"dotenv\";\nimport {loadConfig} from \"c12\";\nimport _ from \"lodash\";\n\nimport {\n assetPlugin,\n backgroundPlugin,\n bundlerPlugin,\n contentPlugin,\n dotenvPlugin,\n htmlPlugin,\n iconPlugin,\n localePlugin,\n metaPlugin,\n offscreenPlugin,\n optimizationPlugin,\n outputPlugin,\n pagePlugin,\n popupPlugin,\n publicPlugin,\n reactPlugin,\n sidebarPlugin,\n stylePlugin,\n typescriptPlugin,\n versionPlugin,\n viewPlugin,\n} from \"../plugins\";\n\nimport {getAppPath, getAppSourcePath, getConfigFile, getInputPath} from \"../resolvers/path\";\n\nimport {Config, OptionalConfig, ReadonlyConfig, UserConfig} from \"@typing/config\";\nimport {Command, Mode} from \"@typing/app\";\nimport {Browser} from \"@typing/browser\";\nimport {Plugin} from \"@typing/plugin\";\nimport {ManifestVersion} from \"@typing/manifest\";\nimport {Language} from \"@typing/locale\";\n\nconst getUserConfig = async (config: ReadonlyConfig): Promise<UserConfig> => {\n const configFilePath = getConfigFile(config);\n\n if (existsSync(configFilePath)) {\n const {config: userConfig} = await loadConfig<UserConfig>({\n configFile: configFilePath,\n dotenv: true,\n });\n\n if (config.debug) {\n console.log(\"Loaded user config:\", configFilePath);\n }\n\n return userConfig || {};\n } else if (config.debug) {\n console.warn(\"Config file not found:\", configFilePath);\n }\n\n return {};\n};\n\nconst validateConfig = (config: ReadonlyConfig): ReadonlyConfig => {\n const {\n outputDir,\n sourceDir,\n sharedDir,\n appsDir,\n appSourceDir,\n jsDir,\n cssDir,\n assetsDir,\n htmlDir,\n publicDir,\n localeDir,\n icon,\n } = config;\n\n if (\n [\n outputDir,\n sourceDir,\n sharedDir,\n appsDir,\n appSourceDir,\n jsDir,\n cssDir,\n assetsDir,\n htmlDir,\n publicDir,\n localeDir,\n icon.outputDir,\n icon.sourceDir,\n ]\n .filter(dir => _.isString(dir))\n .some(dir => dir.includes(\"..\"))\n ) {\n throw new Error('Directory paths cannot contain relative paths (\"..\") for security reasons.');\n }\n\n if (appsDir === sharedDir) {\n throw new Error(\"Apps directory (appsDir) and shared directory (sharedDir) cannot be the same.\");\n }\n\n if (sourceDir === outputDir) {\n throw new Error(\"Source directory (srcDir) and destination directory (outputDir) cannot be the same.\");\n }\n\n if (sourceDir === \".\") {\n throw new Error('Source directory cannot be the root directory (\".\") for security reasons.');\n }\n\n if (publicDir === \".\" || [sourceDir, outputDir, appSourceDir].includes(publicDir)) {\n throw new Error(\n 'Public directory cannot be the root directory (\".\") or intersect with other root directories for security reasons.'\n );\n }\n\n return config;\n};\n\nconst updateLocalDotenv = (config: ReadonlyConfig): DotenvParseOutput => {\n const {mode, app, browser, manifestVersion} = config;\n\n const localVars: DotenvParseOutput = {\n APP: app,\n BROWSER: browser,\n MODE: mode,\n MANIFEST_VERSION: String(manifestVersion),\n };\n\n Object.assign(process.env, localVars);\n\n return localVars;\n};\n\nconst loadDotenv = (config: ReadonlyConfig): DotenvParseOutput => {\n const {mode, browser} = config;\n\n const preset = [\n `.env.${mode}.${browser}.local`,\n `.env.${mode}.${browser}`,\n `.env.${browser}.local`,\n `.env.${browser}`,\n `.env.${mode}.local`,\n `.env.${mode}`,\n `.env.local`,\n `.env`,\n ];\n\n const appSourcePaths = preset.map(file => getAppSourcePath(config, file));\n const appPaths = preset.map(file => getAppPath(config, file));\n const rootPaths = preset.map(file => getInputPath(config, file));\n\n const paths = [...appSourcePaths, ...appPaths, ...rootPaths];\n\n const {parsed: fileVars = {}} = dotenv.config({path: paths});\n\n return {...fileVars, ...updateLocalDotenv(config)};\n};\n\nexport default async (config: OptionalConfig): Promise<Config> => {\n let {\n command = Command.Build,\n debug = false,\n configFile = \"adnbn.config.ts\",\n browser = Browser.Chrome,\n app = \"myapp\",\n name = app,\n description,\n shortName,\n version = \"VERSION\",\n minimumVersion = \"MINIMUM_VERSION\",\n author = undefined,\n email = \"EMAIL\",\n homepage = \"HOMEPAGE\",\n lang = Language.English,\n incognito,\n inputDir = \".\",\n outputDir = \"dist\",\n sourceDir = \"src\",\n sharedDir = \"shared\",\n appsDir = \"apps\",\n appSourceDir = \".\",\n localeDir = \"locales\",\n jsDir = \"js\",\n cssDir = \"css\",\n assetsDir = \"assets\",\n publicDir = \"public\",\n htmlDir = \".\",\n html = [],\n bundler = {},\n env = {},\n icon = {},\n manifestVersion = (new Set<Browser>([Browser.Safari]).has(browser) ? 2 : 3) as ManifestVersion,\n mode = Mode.Development,\n analyze = false,\n plugins = [],\n mergeBackground = false,\n mergeCommands = false,\n mergeContentScripts = false,\n concatContentScripts = true,\n mergeStyles = true,\n mergeIcons = false,\n mergeLocales = true,\n mergePages = false,\n mergePopup = false,\n mergePublic = false,\n multiplePopup = false,\n mergeSidebar = false,\n multipleSidebar = false,\n mergeRelay = false,\n mergeService = false,\n mergeOffscreen = false,\n commonChunks = true,\n assetsFilename = mode === Mode.Production && command === Command.Build && !debug\n ? \"[contenthash:4][ext]\"\n : \"[name]-[contenthash:4][ext]\",\n jsFilename = mode === Mode.Production && command === Command.Build && !debug\n ? \"[contenthash:5].js\"\n : \"[name].js\",\n cssFilename = mode === Mode.Production && command === Command.Build && !debug\n ? \"[contenthash:5].css\"\n : \"[name].css\",\n cssIdentName = mode === Mode.Production && command === Command.Build && !debug\n ? \"[app]-[hash:base64:5]\"\n : \"[local]-[hash:base64:5]\",\n } = config;\n\n let resolvedConfig: Config = {\n command,\n debug,\n mode,\n browser,\n app,\n name,\n description,\n shortName,\n version,\n minimumVersion,\n email,\n author,\n homepage,\n lang,\n incognito,\n manifestVersion,\n inputDir,\n outputDir,\n sourceDir,\n sharedDir,\n appsDir,\n appSourceDir,\n jsDir,\n cssDir,\n assetsDir,\n publicDir,\n htmlDir,\n localeDir,\n html,\n bundler,\n env,\n icon,\n plugins,\n analyze,\n configFile,\n mergeBackground,\n mergeCommands,\n mergeContentScripts,\n concatContentScripts,\n mergeStyles,\n mergeIcons,\n mergeLocales,\n mergePages,\n mergePopup,\n mergePublic,\n multiplePopup,\n mergeSidebar,\n multipleSidebar,\n mergeRelay,\n mergeService,\n mergeOffscreen,\n commonChunks,\n assetsFilename,\n jsFilename,\n cssFilename,\n cssIdentName,\n };\n\n let vars = loadDotenv(resolvedConfig);\n\n const {plugins: userPlugins = [], ...userConfig} = await getUserConfig(resolvedConfig);\n\n resolvedConfig = validateConfig({...resolvedConfig, ...userConfig});\n\n vars = {...vars, ...loadDotenv(resolvedConfig)};\n\n /**\n * IMPORTANT: the order of plugins matters. Early plugins prepare the environment and artifacts for the following ones\n * (e.g., environment variables/output/transpilation/assets → page/version generation → bundling).\n * Reordering may result in missing artifacts, incorrect configuration, or build failures.\n */\n const corePlugins: Plugin[] = [\n dotenvPlugin(vars),\n outputPlugin(),\n optimizationPlugin(),\n typescriptPlugin(),\n reactPlugin(),\n iconPlugin(),\n assetPlugin(),\n stylePlugin(),\n localePlugin(),\n metaPlugin(),\n contentPlugin(),\n backgroundPlugin(),\n popupPlugin(),\n publicPlugin(),\n sidebarPlugin(),\n offscreenPlugin(),\n pagePlugin(),\n viewPlugin(),\n htmlPlugin(),\n versionPlugin(),\n bundlerPlugin(),\n ];\n\n return {\n ...resolvedConfig,\n plugins: [...plugins, ...userPlugins, ...corePlugins],\n };\n};\n"],"mappings":"AAAA,SAAQ,kBAAiB;AACzB,OAAO,YAAsC;AAC7C,SAAQ,kBAAiB;AACzB,OAAO,OAAO;AAEd;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,SAAQ,YAAY,kBAAkB,eAAe,oBAAmB;AAGxE,SAAQ,SAAS,YAAW;AAC5B,SAAQ,eAAc;AAGtB,SAAQ,gBAAe;AAEvB,MAAM,gBAAgB,OAAO,WAAgD;AACzE,QAAM,iBAAiB,cAAc,MAAM;AAE3C,MAAI,WAAW,cAAc,GAAG;AAC5B,UAAM,EAAC,QAAQ,WAAU,IAAI,MAAM,WAAuB;AAAA,MACtD,YAAY;AAAA,MACZ,QAAQ;AAAA,IACZ,CAAC;AAED,QAAI,OAAO,OAAO;AACd,cAAQ,IAAI,uBAAuB,cAAc;AAAA,IACrD;AAEA,WAAO,cAAc,CAAC;AAAA,EAC1B,WAAW,OAAO,OAAO;AACrB,YAAQ,KAAK,0BAA0B,cAAc;AAAA,EACzD;AAEA,SAAO,CAAC;AACZ;AAEA,MAAM,iBAAiB,CAAC,WAA2C;AAC/D,QAAM;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA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AAEA,MAAI,OAAO,WAAW,cAAc;AAEpC,QAAM,EAAC,SAAS,cAAc,CAAC,GAAG,GAAG,WAAU,IAAI,MAAM,cAAc,cAAc;AAErF,mBAAiB,eAAe,EAAC,GAAG,gBAAgB,GAAG,WAAU,CAAC;AAElE,SAAO,EAAC,GAAG,MAAM,GAAG,WAAW,cAAc,EAAC;AAO9C,QAAM,cAAwB;AAAA,IAC1B,aAAa,IAAI;AAAA,IACjB,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,WAAW;AAAA,IACX,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,cAAc;AAAA,IACd,cAAc;AAAA,EAClB;AAEA,SAAO;AAAA,IACH,GAAG;AAAA,IACH,SAAS,CAAC,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW;AAAA,EACxD;AACJ;","names":[]}
1
+ {"version":3,"sources":["../../../src/cli/resolvers/config.ts"],"sourcesContent":["import {existsSync} from \"fs\";\nimport dotenv, {type DotenvParseOutput} from \"dotenv\";\nimport {loadConfig} from \"c12\";\nimport _ from \"lodash\";\n\nimport {\n assetPlugin,\n backgroundPlugin,\n bundlerPlugin,\n contentPlugin,\n dotenvPlugin,\n htmlPlugin,\n iconPlugin,\n localePlugin,\n metaPlugin,\n offscreenPlugin,\n optimizationPlugin,\n outputPlugin,\n pagePlugin,\n popupPlugin,\n publicPlugin,\n reactPlugin,\n sidebarPlugin,\n stylePlugin,\n typescriptPlugin,\n versionPlugin,\n viewPlugin,\n} from \"../plugins\";\n\nimport {fromRootPath, getAppPath, getAppSourcePath, getConfigFile} from \"../resolvers/path\";\n\nimport {Config, OptionalConfig, ReadonlyConfig, UserConfig} from \"@typing/config\";\nimport {Command, Mode} from \"@typing/app\";\nimport {Browser} from \"@typing/browser\";\nimport {Plugin} from \"@typing/plugin\";\nimport {ManifestVersion} from \"@typing/manifest\";\nimport {Language} from \"@typing/locale\";\nimport {DefaultIconGroupName} from \"@typing/icon\";\n\nconst getUserConfig = async (config: ReadonlyConfig): Promise<UserConfig> => {\n const configFilePath = getConfigFile(config);\n\n if (existsSync(configFilePath)) {\n const {config: userConfig} = await loadConfig<UserConfig>({\n configFile: configFilePath,\n dotenv: true,\n });\n\n if (config.debug) {\n console.log(\"Loaded user config:\", configFilePath);\n }\n\n return userConfig || {};\n } else if (config.debug) {\n console.warn(\"Config file not found:\", configFilePath);\n }\n\n return {};\n};\n\nconst validateConfig = (config: ReadonlyConfig): ReadonlyConfig => {\n const {\n outDir,\n srcDir,\n sharedDir,\n appsDir,\n appSrcDir,\n jsDir,\n cssDir,\n assetsDir,\n htmlDir,\n publicDir,\n localeDir,\n iconSrcDir,\n iconOutDir,\n } = config;\n\n if (\n [\n outDir,\n srcDir,\n sharedDir,\n appsDir,\n appSrcDir,\n jsDir,\n cssDir,\n assetsDir,\n htmlDir,\n publicDir,\n localeDir,\n iconSrcDir,\n iconOutDir,\n ]\n .filter(dir => _.isString(dir))\n .some(dir => dir.includes(\"..\"))\n ) {\n throw new Error('Directory paths cannot contain relative paths (\"..\") for security reasons.');\n }\n\n if (appsDir === sharedDir) {\n throw new Error(\"Apps directory (appsDir) and shared directory (sharedDir) cannot be the same.\");\n }\n\n if (srcDir === outDir) {\n throw new Error(\"Source directory (srcDir) and destination directory (outputDir) cannot be the same.\");\n }\n\n if (srcDir === \".\") {\n throw new Error('Source directory cannot be the root directory (\".\") for security reasons.');\n }\n\n if (publicDir === \".\" || [srcDir, outDir, appSrcDir].includes(publicDir)) {\n throw new Error(\n 'Public directory cannot be the root directory (\".\") or intersect with other root directories for security reasons.'\n );\n }\n\n return config;\n};\n\nconst updateLocalDotenv = (config: ReadonlyConfig): DotenvParseOutput => {\n const {mode, app, browser, manifestVersion} = config;\n\n const localVars: DotenvParseOutput = {\n APP: app,\n BROWSER: browser,\n MODE: mode,\n MANIFEST_VERSION: String(manifestVersion),\n };\n\n Object.assign(process.env, localVars);\n\n return localVars;\n};\n\nconst loadDotenv = (config: ReadonlyConfig): DotenvParseOutput => {\n const {mode, browser} = config;\n\n const preset = [\n `.env.${mode}.${browser}.local`,\n `.env.${mode}.${browser}`,\n `.env.${browser}.local`,\n `.env.${browser}`,\n `.env.${mode}.local`,\n `.env.${mode}`,\n `.env.local`,\n `.env`,\n ];\n\n const appSourcePaths = preset.map(file => getAppSourcePath(config, file));\n const appPaths = preset.map(file => getAppPath(config, file));\n const rootPaths = preset.map(file => fromRootPath(config, file));\n\n const paths = [...appSourcePaths, ...appPaths, ...rootPaths];\n\n const {parsed: fileVars = {}} = dotenv.config({path: paths});\n\n return {...fileVars, ...updateLocalDotenv(config)};\n};\n\nexport default async (config: OptionalConfig): Promise<Config> => {\n let {\n command = Command.Build,\n debug = false,\n configFile = \"adnbn.config.ts\",\n browser = Browser.Chrome,\n app = \"myapp\",\n name = app,\n description,\n shortName,\n version = \"VERSION\",\n minimumVersion = \"MINIMUM_VERSION\",\n author = undefined,\n email = \"EMAIL\",\n homepage = \"HOMEPAGE\",\n icon = DefaultIconGroupName,\n lang = Language.English,\n incognito,\n rootDir = \".\",\n outDir = \"dist\",\n srcDir = \"src\",\n sharedDir = \"shared\",\n appsDir = \"apps\",\n appSrcDir = \".\",\n localeDir = \"locales\",\n iconSrcDir = \"icons\",\n iconOutDir = \"icons\",\n jsDir = \"js\",\n cssDir = \"css\",\n assetsDir = \"assets\",\n publicDir = \"public\",\n htmlDir = \".\",\n html = [],\n bundler = {},\n env = {},\n manifestVersion = (new Set<Browser>([Browser.Safari]).has(browser) ? 2 : 3) as ManifestVersion,\n mode = Mode.Development,\n analyze = false,\n plugins = [],\n mergeBackground = false,\n mergeCommands = false,\n mergeContentScripts = false,\n concatContentScripts = true,\n mergeStyles = true,\n mergeIcons = false,\n mergeLocales = true,\n mergePages = false,\n mergePopup = false,\n mergePublic = false,\n multiplePopup = false,\n mergeSidebar = false,\n multipleSidebar = false,\n mergeRelay = false,\n mergeService = false,\n mergeOffscreen = false,\n commonChunks = true,\n artifactName = \"[name]-[browser]-[mv]\",\n assetsFilename = mode === Mode.Production && command === Command.Build && !debug\n ? \"[contenthash:4][ext]\"\n : \"[name]-[contenthash:4][ext]\",\n jsFilename = mode === Mode.Production && command === Command.Build && !debug\n ? \"[contenthash:5].js\"\n : \"[name].js\",\n cssFilename = mode === Mode.Production && command === Command.Build && !debug\n ? \"[contenthash:5].css\"\n : \"[name].css\",\n cssIdentName = mode === Mode.Production && command === Command.Build && !debug\n ? \"[app]-[hash:base64:5]\"\n : \"[local]-[hash:base64:5]\",\n } = config;\n\n let resolvedConfig: Config = {\n command,\n debug,\n mode,\n browser,\n app,\n name,\n description,\n shortName,\n version,\n minimumVersion,\n email,\n author,\n homepage,\n lang,\n icon,\n incognito,\n manifestVersion,\n rootDir,\n outDir,\n srcDir,\n sharedDir,\n appsDir,\n appSrcDir,\n jsDir,\n cssDir,\n assetsDir,\n publicDir,\n htmlDir,\n localeDir,\n iconSrcDir,\n iconOutDir,\n html,\n bundler,\n env,\n plugins,\n analyze,\n configFile,\n mergeBackground,\n mergeCommands,\n mergeContentScripts,\n concatContentScripts,\n mergeStyles,\n mergeIcons,\n mergeLocales,\n mergePages,\n mergePopup,\n mergePublic,\n multiplePopup,\n mergeSidebar,\n multipleSidebar,\n mergeRelay,\n mergeService,\n mergeOffscreen,\n commonChunks,\n artifactName,\n assetsFilename,\n jsFilename,\n cssFilename,\n cssIdentName,\n };\n\n let vars = loadDotenv(resolvedConfig);\n\n const {plugins: userPlugins = [], ...userConfig} = await getUserConfig(resolvedConfig);\n\n resolvedConfig = validateConfig({...resolvedConfig, ...userConfig});\n\n vars = {...vars, ...loadDotenv(resolvedConfig)};\n\n /**\n * IMPORTANT: the order of plugins matters. Early plugins prepare the environment and artifacts for the following ones\n * (e.g., environment variables/output/transpilation/assets → page/version generation → bundling).\n * Reordering may result in missing artifacts, incorrect configuration, or build failures.\n */\n const corePlugins: Plugin[] = [\n dotenvPlugin(vars),\n outputPlugin(),\n optimizationPlugin(),\n typescriptPlugin(),\n reactPlugin(),\n iconPlugin(),\n assetPlugin(),\n stylePlugin(),\n localePlugin(),\n metaPlugin(),\n contentPlugin(),\n backgroundPlugin(),\n popupPlugin(),\n publicPlugin(),\n sidebarPlugin(),\n offscreenPlugin(),\n pagePlugin(),\n viewPlugin(),\n htmlPlugin(),\n versionPlugin(),\n bundlerPlugin(),\n ];\n\n return {\n ...resolvedConfig,\n plugins: [...plugins, ...userPlugins, ...corePlugins],\n };\n};\n"],"mappings":"AAAA,SAAQ,kBAAiB;AACzB,OAAO,YAAsC;AAC7C,SAAQ,kBAAiB;AACzB,OAAO,OAAO;AAEd;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,SAAQ,cAAc,YAAY,kBAAkB,qBAAoB;AAGxE,SAAQ,SAAS,YAAW;AAC5B,SAAQ,eAAc;AAGtB,SAAQ,gBAAe;AACvB,SAAQ,4BAA2B;AAEnC,MAAM,gBAAgB,OAAO,WAAgD;AACzE,QAAM,iBAAiB,cAAc,MAAM;AAE3C,MAAI,WAAW,cAAc,GAAG;AAC5B,UAAM,EAAC,QAAQ,WAAU,IAAI,MAAM,WAAuB;AAAA,MACtD,YAAY;AAAA,MACZ,QAAQ;AAAA,IACZ,CAAC;AAED,QAAI,OAAO,OAAO;AACd,cAAQ,IAAI,uBAAuB,cAAc;AAAA,IACrD;AAEA,W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A;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AAEA,MAAI,OAAO,WAAW,cAAc;AAEpC,QAAM,EAAC,SAAS,cAAc,CAAC,GAAG,GAAG,WAAU,IAAI,MAAM,cAAc,cAAc;AAErF,mBAAiB,eAAe,EAAC,GAAG,gBAAgB,GAAG,WAAU,CAAC;AAElE,SAAO,EAAC,GAAG,MAAM,GAAG,WAAW,cAAc,EAAC;AAO9C,QAAM,cAAwB;AAAA,IAC1B,aAAa,IAAI;AAAA,IACjB,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,WAAW;AAAA,IACX,cAAc;AAAA,IACd,iBAAiB;AAAA,IACjB,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,IACX,cAAc;AAAA,IACd,cAAc;AAAA,EAClB;AAEA,SAAO;AAAA,IACH,GAAG;AAAA,IACH,SAAS,CAAC,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW;AAAA,EACxD;AACJ;","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,14 +12,16 @@ 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
- declare const getRootPath: (to: string) => string;
17
- declare const getInputPath: (config: ReadonlyConfig, to?: string) => string;
17
+ declare const getResolvePath: (to: string) => string;
18
+ declare const fromRootPath: (config: ReadonlyConfig, to?: string) => string;
18
19
  declare const getSourcePath: (config: ReadonlyConfig, to?: string) => string;
19
20
  declare const getSharedPath: (config: ReadonlyConfig, to?: string) => string;
20
21
  declare const getAppPath: (config: ReadonlyConfig, to?: string) => string;
21
22
  declare const getAppSourcePath: (config: ReadonlyConfig, to?: string) => string;
22
23
  declare const getOutputPath: (config: ReadonlyConfig) => string;
23
24
  declare const getConfigFile: (config: ReadonlyConfig) => string;
25
+ declare const getArtifactName: (config: ReadonlyConfig) => string;
24
26
 
25
- export { getAppPath, getAppSourcePath, getConfigFile, getInputPath, getOutputPath, getRootPath, getSharedPath, getSourcePath };
27
+ export { fromRootPath, getAppPath, getAppSourcePath, getArtifactName, getConfigFile, getOutputPath, getResolvePath, getSharedPath, getSourcePath };
@@ -1,39 +1,49 @@
1
1
  import path from "path";
2
2
  import _ from "lodash";
3
- const getRootPath = (to) => {
3
+ const getResolvePath = (to) => {
4
4
  return path.resolve(process.cwd(), to);
5
5
  };
6
- const getInputPath = (config, to) => {
7
- return path.join(config.inputDir, to ?? "");
6
+ const fromRootPath = (config, to) => {
7
+ return path.join(config.rootDir, to ?? "");
8
8
  };
9
9
  const getSourcePath = (config, to) => {
10
- return getInputPath(config, path.join(config.sourceDir, to ?? ""));
10
+ return fromRootPath(config, path.join(config.srcDir, to ?? ""));
11
11
  };
12
12
  const getSharedPath = (config, to) => {
13
- return getInputPath(config, path.join(config.sourceDir, config.sharedDir, to ?? ""));
13
+ return fromRootPath(config, path.join(config.srcDir, config.sharedDir, to ?? ""));
14
14
  };
15
15
  const getAppPath = (config, to) => {
16
- return getInputPath(config, path.join(config.sourceDir, config.appsDir, config.app, to ?? ""));
16
+ return fromRootPath(config, path.join(config.srcDir, config.appsDir, config.app, to ?? ""));
17
17
  };
18
18
  const getAppSourcePath = (config, to) => {
19
- return getAppPath(config, path.join(config.appSourceDir, to ?? ""));
19
+ return getAppPath(config, path.join(config.appSrcDir, to ?? ""));
20
20
  };
21
21
  const getOutputPath = (config) => {
22
- return getInputPath(
23
- config,
24
- path.join(config.outputDir, `${_.kebabCase(config.app)}-${config.browser}-mv${config.manifestVersion}`)
25
- );
22
+ return fromRootPath(config, path.join(config.outDir, getArtifactName(config)));
26
23
  };
27
24
  const getConfigFile = (config) => {
28
- return getInputPath(config, config.configFile);
25
+ return fromRootPath(config, config.configFile);
26
+ };
27
+ const getArtifactName = (config) => {
28
+ const app = _.kebabCase(config.app);
29
+ const replacements = {
30
+ "[app]": app,
31
+ "[name]": app,
32
+ "[mode]": config.mode,
33
+ "[browser]": config.browser,
34
+ "[mv]": "mv" + config.manifestVersion.toString()
35
+ };
36
+ const name = _.reduce(replacements, (result, value, key) => result.replaceAll(key, value), config.artifactName);
37
+ return _.kebabCase(name).replace(/\bmv-(\d+)/gi, "mv$1");
29
38
  };
30
39
  export {
40
+ fromRootPath,
31
41
  getAppPath,
32
42
  getAppSourcePath,
43
+ getArtifactName,
33
44
  getConfigFile,
34
- getInputPath,
35
45
  getOutputPath,
36
- getRootPath,
46
+ getResolvePath,
37
47
  getSharedPath,
38
48
  getSourcePath
39
49
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/resolvers/path.ts"],"sourcesContent":["import path from \"path\";\nimport _ from \"lodash\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport const getRootPath = (to: string): string => {\n return path.resolve(process.cwd(), to);\n};\n\nexport const getInputPath = (config: ReadonlyConfig, to?: string): string => {\n return path.join(config.inputDir, to ?? \"\");\n};\n\nexport const getSourcePath = (config: ReadonlyConfig, to?: string): string => {\n return getInputPath(config, path.join(config.sourceDir, to ?? \"\"));\n};\n\nexport const getSharedPath = (config: ReadonlyConfig, to?: string): string => {\n return getInputPath(config, path.join(config.sourceDir, config.sharedDir, to ?? \"\"));\n};\n\nexport const getAppPath = (config: ReadonlyConfig, to?: string): string => {\n return getInputPath(config, path.join(config.sourceDir, config.appsDir, config.app, to ?? \"\"));\n};\n\nexport const getAppSourcePath = (config: ReadonlyConfig, to?: string): string => {\n return getAppPath(config, path.join(config.appSourceDir, to ?? \"\"));\n};\n\nexport const getOutputPath = (config: ReadonlyConfig): string => {\n return getInputPath(\n config,\n path.join(config.outputDir, `${_.kebabCase(config.app)}-${config.browser}-mv${config.manifestVersion}`)\n );\n};\n\nexport const getConfigFile = (config: ReadonlyConfig): string => {\n return getInputPath(config, config.configFile);\n};\n"],"mappings":"AAAA,OAAO,UAAU;AACjB,OAAO,OAAO;AAIP,MAAM,cAAc,CAAC,OAAuB;AAC/C,SAAO,KAAK,QAAQ,QAAQ,IAAI,GAAG,EAAE;AACzC;AAEO,MAAM,eAAe,CAAC,QAAwB,OAAwB;AACzE,SAAO,KAAK,KAAK,OAAO,UAAU,MAAM,EAAE;AAC9C;AAEO,MAAM,gBAAgB,CAAC,QAAwB,OAAwB;AAC1E,SAAO,aAAa,QAAQ,KAAK,KAAK,OAAO,WAAW,MAAM,EAAE,CAAC;AACrE;AAEO,MAAM,gBAAgB,CAAC,QAAwB,OAAwB;AAC1E,SAAO,aAAa,QAAQ,KAAK,KAAK,OAAO,WAAW,OAAO,WAAW,MAAM,EAAE,CAAC;AACvF;AAEO,MAAM,aAAa,CAAC,QAAwB,OAAwB;AACvE,SAAO,aAAa,QAAQ,KAAK,KAAK,OAAO,WAAW,OAAO,SAAS,OAAO,KAAK,MAAM,EAAE,CAAC;AACjG;AAEO,MAAM,mBAAmB,CAAC,QAAwB,OAAwB;AAC7E,SAAO,WAAW,QAAQ,KAAK,KAAK,OAAO,cAAc,MAAM,EAAE,CAAC;AACtE;AAEO,MAAM,gBAAgB,CAAC,WAAmC;AAC7D,SAAO;AAAA,IACH;AAAA,IACA,KAAK,KAAK,OAAO,WAAW,GAAG,EAAE,UAAU,OAAO,GAAG,CAAC,IAAI,OAAO,OAAO,MAAM,OAAO,eAAe,EAAE;AAAA,EAC1G;AACJ;AAEO,MAAM,gBAAgB,CAAC,WAAmC;AAC7D,SAAO,aAAa,QAAQ,OAAO,UAAU;AACjD;","names":[]}
1
+ {"version":3,"sources":["../../../src/cli/resolvers/path.ts"],"sourcesContent":["import path from \"path\";\nimport _ from \"lodash\";\n\nimport {ReadonlyConfig} from \"@typing/config\";\n\nexport const getResolvePath = (to: string): string => {\n return path.resolve(process.cwd(), to);\n};\n\nexport const fromRootPath = (config: ReadonlyConfig, to?: string): string => {\n return path.join(config.rootDir, to ?? \"\");\n};\n\nexport const getSourcePath = (config: ReadonlyConfig, to?: string): string => {\n return fromRootPath(config, path.join(config.srcDir, to ?? \"\"));\n};\n\nexport const getSharedPath = (config: ReadonlyConfig, to?: string): string => {\n return fromRootPath(config, path.join(config.srcDir, config.sharedDir, to ?? \"\"));\n};\n\nexport const getAppPath = (config: ReadonlyConfig, to?: string): string => {\n return fromRootPath(config, path.join(config.srcDir, config.appsDir, config.app, to ?? \"\"));\n};\n\nexport const getAppSourcePath = (config: ReadonlyConfig, to?: string): string => {\n return getAppPath(config, path.join(config.appSrcDir, to ?? \"\"));\n};\n\nexport const getOutputPath = (config: ReadonlyConfig): string => {\n return fromRootPath(config, path.join(config.outDir, getArtifactName(config)));\n};\n\nexport const getConfigFile = (config: ReadonlyConfig): string => {\n return fromRootPath(config, config.configFile);\n};\n\nexport const getArtifactName = (config: ReadonlyConfig): string => {\n const app = _.kebabCase(config.app);\n\n const replacements: Record<string, string> = {\n \"[app]\": app,\n \"[name]\": app,\n \"[mode]\": config.mode,\n \"[browser]\": config.browser,\n \"[mv]\": \"mv\" + config.manifestVersion.toString(),\n };\n\n const name = _.reduce(replacements, (result, value, key) => result.replaceAll(key, value), config.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AAM,OAAO,EAAE,OAAO,cAAc,CAAC,QAAQ,OAAO,QAAQ,OAAO,WAAW,KAAK,KAAK,GAAG,OAAO,YAAY;AAE9G,SAAO,EAAE,UAAU,IAAI,EAAE,QAAQ,gBAAgB,MAAM;AAC3D;","names":[]}
@@ -1,4 +1,4 @@
1
- import { e as PluginHandler, c as PluginHandlerKeys, P as Plugin, f as PluginHandlerOptions, g as PluginNameHandlerResult } from '../../config-DzmiK3GH.js';
1
+ import { e as PluginHandler, c as PluginHandlerKeys, P as Plugin, f as PluginHandlerOptions, g as PluginNameHandlerResult } 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 resolvePluginHandler: <O extends object, T>(handler: PluginHandler<O, T> | undefined, options: O) => Promise<T | undefined>;
17
18
  declare const processPluginHandler: <K extends PluginHandlerKeys>(plugins: Plugin[], key: K, options: PluginHandlerOptions<K> | {
@@ -5,6 +5,7 @@ import { Browser } from './types/browser.js';
5
5
  import { ManifestBuilder, ManifestIncognitoValue, ManifestVersion } from './types/manifest.js';
6
6
  import { Language } from './types/locale.js';
7
7
  import { Awaiter } from './types/helpers.js';
8
+ import { EnvFilterVariant, EnvFilterOptions } from './types/env.js';
8
9
  import { EntrypointFile } from './types/entrypoint.js';
9
10
 
10
11
  /**
@@ -104,8 +105,8 @@ interface PluginNameHandlerResult<K extends PluginHandlerKeys> extends PluginNam
104
105
  type PluginDefinition<T extends any[] = []> = (...args: T) => Plugin;
105
106
 
106
107
  /**
107
- * Configuration interface defining all the configurable options
108
- * needed to build, manage, and deploy browser extensions.
108
+ * Configuration object for defining various settings and build parameters
109
+ * for an extension application.
109
110
  */
110
111
  interface Config {
111
112
  /**
@@ -217,6 +218,20 @@ interface Config {
217
218
  * @default HOMEPAGE
218
219
  */
219
220
  homepage: string | (() => string | undefined);
221
+ /**
222
+ * Name of the icon group to use in the manifest as the primary extension icon (manifest.icons).
223
+ *
224
+ * An icon group is a named set of icons by sizes (e.g., 16, 32, 48, 128, ...).
225
+ * The value must match one of the available icon groups.
226
+ *
227
+ * @default: "default"
228
+ *
229
+ * Examples:
230
+ * - "default"
231
+ * - "active"
232
+ * - "disable"
233
+ */
234
+ icon: string;
220
235
  /**
221
236
  * Used for Firefox under `browser_specific_settings.gecko.id`,
222
237
  * but only if the "storage" permission is declared.
@@ -248,7 +263,7 @@ interface Config {
248
263
  * This is the base directory relative to which other paths are defined.
249
264
  * @example "addon"
250
265
  */
251
- inputDir: string;
266
+ rootDir: string;
252
267
  /**
253
268
  * Directory where the built extensions will be placed.
254
269
  * Final extension files will be located here.
@@ -257,7 +272,7 @@ interface Config {
257
272
  *
258
273
  * @default "dist"
259
274
  */
260
- outputDir: string;
275
+ outDir: string;
261
276
  /**
262
277
  * Directory where the application and shared directory are located.
263
278
  * Main directory with source code.
@@ -266,7 +281,7 @@ interface Config {
266
281
  *
267
282
  * @default "src"
268
283
  */
269
- sourceDir: string;
284
+ srcDir: string;
270
285
  /**
271
286
  * Directory with common modules, content scripts, and background scripts.
272
287
  * Contains code used by multiple extensions.
@@ -293,7 +308,27 @@ interface Config {
293
308
  *
294
309
  * @default "."
295
310
  */
296
- appSourceDir: string;
311
+ appSrcDir: string;
312
+ /**
313
+ * Directory for icons and logos. Can be located in the Shared directory,
314
+ * in the project root, or in a folder for a specific App.
315
+ *
316
+ * @example "icons"
317
+ *
318
+ * @path Full paths can be:
319
+ *
320
+ * - `{{inputDir}}/{{srcDir}}/{{icon.sourceDir}}`
321
+ * - `{{inputDir}}/{{sharedDir}}/{{icon.sourceDir}}`
322
+ * - `{{inputDir}}/{{appsDir}}/{{appDir}}/{{icon.sourceDir}}`
323
+ */
324
+ iconSrcDir: string;
325
+ /**
326
+ * Directory for image files in outputDir.
327
+ *
328
+ * @example "icons"
329
+ * @path Full path: `{{inputDir}}/{{outputDir}}/{{appDir}}/{{icon.outputDir}}`
330
+ */
331
+ iconOutDir: string;
297
332
  /**
298
333
  * Directory for output JavaScript files in outputDir.
299
334
  * All compiled JS files will be placed here.
@@ -350,9 +385,7 @@ interface Config {
350
385
  * - { (): HtmlOptions | HtmlOptions[] }: A function that dynamically generates and
351
386
  * returns either an HtmlOptions object or an array of HtmlOptions objects.
352
387
  */
353
- html: Options | Options[] | {
354
- (): Options | Options[];
355
- };
388
+ html: Options | Options[] | (() => Options | Options[]);
356
389
  /**
357
390
  * Rspack bundler configuration.
358
391
  *
@@ -369,56 +402,30 @@ interface Config {
369
402
  * - The function parameter is mainly for inspecting the current config to decide whether
370
403
  * additional adjustments are necessary.
371
404
  */
372
- bundler: Configuration | {
373
- (rspack: Configuration): Awaiter<Configuration>;
374
- };
375
- /**
376
- * Environment configuration for the extension.
377
- */
378
- env: {
379
- /**
380
- * Filter that determines which environment variables should be included.
381
- * Can be a string (interpreted as a prefix) or a function that receives
382
- * the variable name and returns true if it should be included.
383
- */
384
- filter?: ((value: string) => boolean) | string;
385
- /**
386
- * If true, the environment variable values will be obfuscated with simple encryption.
387
- * This is not secure encryption.
388
- *
389
- * @default false
390
- */
391
- crypt?: boolean;
392
- };
393
- /**
394
- * Icon configuration for the extension.
395
- */
396
- icon: {
397
- /**
398
- * Directory for icons and logos. Can be located in the Shared directory,
399
- * in the project root, or in a folder for a specific App.
400
- *
401
- * @example "icons"
402
- *
403
- * @path Full paths can be:
404
- *
405
- * - `{{inputDir}}/{{srcDir}}/{{icon.sourceDir}}`
406
- * - `{{inputDir}}/{{sharedDir}}/{{icon.sourceDir}}`
407
- * - `{{inputDir}}/{{appsDir}}/{{appDir}}/{{icon.sourceDir}}`
408
- */
409
- sourceDir?: string;
410
- /**
411
- * Directory for image files in outputDir.
412
- * @example "icons"
413
- * @path Full path: `{{inputDir}}/{{outputDir}}/{{appDir}}/{{icon.outputDir}}`
414
- */
415
- outputDir?: string;
416
- /**
417
- * Default icon group name. If not specified, the default icons set will be used.
418
- * @example "default"
419
- */
420
- name?: string;
421
- };
405
+ bundler: Configuration | ((rspack: Configuration) => Awaiter<Configuration>);
406
+ /**
407
+ * Environment variables inclusion settings.
408
+ *
409
+ * Supports three forms:
410
+ * - string: treated as a prefix filter. Only variables whose names start with this prefix are included.
411
+ * Equivalent to: { filter: "<PREFIX>" }.
412
+ * - function: a predicate that receives a variable name and returns true to include it.
413
+ * Equivalent to: { filter: (name) => boolean }.
414
+ * - object: advanced settings.
415
+ * - filter?: string | ((name: string) => boolean) a prefix or predicate to select variables.
416
+ * - crypt?: boolean — if true, values will be obfuscated with a simple reversible scheme
417
+ * (for convenience only; not secure).
418
+ *
419
+ * Notes:
420
+ * - If no filter is provided (e.g., empty string or a function that always returns false), no variables are included.
421
+ * - Obfuscation is intended to reduce casual inspection only and should not be considered encryption.
422
+ *
423
+ * Examples:
424
+ * - `"APP_"` - include all variables starting with `APP_`
425
+ * - `(name) => name === "FEATURE_FLAG"` - include a single variable via predicate
426
+ * - `{ filter: "PUBLIC_", crypt: true }` - include by prefix and obfuscate values
427
+ */
428
+ env: EnvFilterVariant | Partial<EnvFilterOptions>;
422
429
  /**
423
430
  * Array of plugins used when building the extension.
424
431
  * Allows extending the builder's functionality.
@@ -569,6 +576,30 @@ interface Config {
569
576
  * @default true
570
577
  */
571
578
  commonChunks: boolean;
579
+ /**
580
+ * Build artifact name.
581
+ *
582
+ * Used as:
583
+ * - the directory name where the built extension will be placed;
584
+ * - the base name of the packaged archive.
585
+ *
586
+ * Supports placeholders that are substituted and then normalized:
587
+ * - `[app]` / `[name]` — application name in kebab-case;
588
+ * - `[mode]` — current build mode (e.g., development, production);
589
+ * - `[browser]` — target browser;
590
+ * - `[mv]` — manifest version in mvN format (e.g., mv3).
591
+ *
592
+ * Notes:
593
+ * - the final name is automatically converted to kebab-case;
594
+ * - sequences like "mv-<number>" are normalized to "mv<number>" (e.g., "mv-3" → "mv3");
595
+ * - it is recommended to specify only a name (no paths or extensions).
596
+ *
597
+ * Examples:
598
+ * - `[app]` → `my-app`
599
+ * - `[app]-[browser]-[mv]` → `my-app-chrome-mv3`
600
+ * - `bundle-[name]-[mode]` → `bundle-my-app-production`
601
+ */
602
+ artifactName: string;
572
603
  /**
573
604
  * Template for generating asset output file names.
574
605
  *
@@ -6,12 +6,12 @@ import { ViewBuilder } from '../../types/view.js';
6
6
  import '../transport/AbstractBuilder.js';
7
7
  import '../../types/entrypoint.js';
8
8
  import '../../types/browser.js';
9
- import 'utility-types';
10
- import '../../types/helpers.js';
11
- import '../../types/message.js';
12
9
  import '../../offscreen/providers/RegisterOffscreen.js';
13
10
  import '../../transport/RegisterTransport.js';
14
11
  import '../../transport/BaseTransport.js';
12
+ import 'utility-types';
13
+ import '../../types/helpers.js';
14
+ import '../../types/message.js';
15
15
  import '../../offscreen/OffscreenMessage.js';
16
16
  import '../../transport/TransportMessage.js';
17
17
  import '../../message/providers/Message.js';
@@ -6,12 +6,12 @@ import { TransportType } from '../../types/transport.js';
6
6
  import '../transport/AbstractBuilder.js';
7
7
  import '../../types/entrypoint.js';
8
8
  import '../../types/browser.js';
9
- import '../../relay/providers/RegisterRelay.js';
10
- import '../../relay/providers/Relay.js';
11
- import '../../transport/BaseTransport.js';
12
9
  import 'utility-types';
13
10
  import '../../types/helpers.js';
14
11
  import '../../types/message.js';
12
+ import '../../relay/providers/RegisterRelay.js';
13
+ import '../../relay/providers/Relay.js';
14
+ import '../../transport/BaseTransport.js';
15
15
  import 'react';
16
16
 
17
17
  declare class export_default<T extends TransportType> extends export_default$1 {
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export { SidebarAlias, SidebarMap, changeSidebar, defineSidebar, getSidebars } f
17
17
  export { ViewDefinition, ViewOptions } from './types/view.js';
18
18
  export { BackgroundConfig, BackgroundDefinition, BackgroundMainHandler } from './types/background.js';
19
19
  export { CommandConfig, CommandDefinition, CommandExecute, CommandExecuteActionName, CommandUnresolvedDefinition, ExecuteActionCommandDefinition } from './types/command.js';
20
- export { C as Config, a as ConfigDefinition, P as Plugin, b as PluginDefinition, R as ReadonlyConfig, U as UserConfig } from './config-DzmiK3GH.js';
20
+ export { C as Config, a as ConfigDefinition, P as Plugin, b as PluginDefinition, R as ReadonlyConfig, U as UserConfig } from './config-Ce0Le6r4.js';
21
21
  export { contentScriptMountAppendResolver } from './entry/content/core/resolvers/mount.js';
22
22
  export { isContentScriptDefinition, isValidContentScriptDefinitionRenderValue } from './entry/content/core/resolvers/definition.js';
23
23
  export { ContentScriptAnchor, ContentScriptAnchorGetter, ContentScriptAnchorResolver, ContentScriptAppend, ContentScriptAppendDefinition, ContentScriptBuilder, ContentScriptConfig, ContentScriptContainerCreator, ContentScriptContainerFactory, ContentScriptContainerOptions, ContentScriptContainerTag, ContentScriptContext, ContentScriptDefinition, ContentScriptEntrypointOptions, ContentScriptEvent, ContentScriptEventCallback, ContentScriptEventEmitter, ContentScriptMainFunction, ContentScriptMatches, ContentScriptMount, ContentScriptMountFunction, ContentScriptNode, ContentScriptNodeSet, ContentScriptOptions, ContentScriptProps, ContentScriptRenderHandler, ContentScriptRenderReactComponent, ContentScriptRenderValue, ContentScriptResolvedDefinition, ContentScriptWatchStrategy } from './types/content.js';
@@ -32,6 +32,7 @@ import '@rspack/core';
32
32
  import 'html-rspack-tags-plugin';
33
33
  import 'react';
34
34
  import './types/locale.js';
35
+ import './types/env.js';
35
36
  import './types/transport.js';
36
37
  import './types/message.js';
37
38
  import './types/popup.js';
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ interface LocaleProviderProps {
4
+ storage?: string | false;
5
+ }
6
+ declare const LocaleProvider: ({ children, storage }: PropsWithChildren<LocaleProviderProps>) => any;
7
+
8
+ export { type LocaleProviderProps, LocaleProvider as default };
@@ -0,0 +1,47 @@
1
+ import React, { useCallback, useEffect, useMemo, useState } from "react";
2
+ import { LocaleContext } from "./context.js";
3
+ import { getLocaleDir, isLocaleRtl } from "./../../../locale/utils.js";
4
+ import { DynamicLocale } from "./../../../locale/providers/index.js";
5
+ const LocaleProvider = ({ children, storage }) => {
6
+ const locale = useMemo(() => new DynamicLocale(storage), []);
7
+ const [lang, setLang] = useState(locale.lang());
8
+ const _ = useCallback((key, substitutions) => {
9
+ return locale.trans(key, substitutions);
10
+ }, []);
11
+ const choice = useCallback((key, count, substitutions) => {
12
+ return locale.choice(key, count, substitutions);
13
+ }, []);
14
+ const change = useCallback((lang2) => {
15
+ locale.change(lang2).catch((err) => console.error(`Cannot find locale file for "${lang2}" language`, err));
16
+ }, []);
17
+ useEffect(() => {
18
+ const html = document.querySelector("html");
19
+ html == null ? void 0 : html.setAttribute("lang", lang);
20
+ html == null ? void 0 : html.setAttribute("dir", getLocaleDir(lang));
21
+ }, [lang]);
22
+ useEffect(() => {
23
+ locale.sync().then((lang2) => setLang(lang2));
24
+ }, []);
25
+ useEffect(() => {
26
+ return locale.watch((lang2) => setLang(lang2));
27
+ }, []);
28
+ return /* @__PURE__ */ React.createElement(
29
+ LocaleContext.Provider,
30
+ {
31
+ value: {
32
+ _,
33
+ choice,
34
+ change,
35
+ lang,
36
+ dir: getLocaleDir(lang),
37
+ isRtl: isLocaleRtl(lang)
38
+ }
39
+ },
40
+ children
41
+ );
42
+ };
43
+ var LocaleProvider_default = LocaleProvider;
44
+ export {
45
+ LocaleProvider_default as default
46
+ };
47
+ //# sourceMappingURL=LocaleProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/locale/adapters/react/LocaleProvider.tsx"],"sourcesContent":["import React, {PropsWithChildren, useCallback, useEffect, useMemo, useState} from \"react\";\n\nimport {LocaleContext, LocaleContract} from \"./context\";\n\nimport {getLocaleDir, isLocaleRtl} from \"@locale/utils\";\n\nimport {DynamicLocale} from \"@locale/providers\";\n\nimport {Language} from \"@typing/locale\";\n\nexport interface LocaleProviderProps {\n storage?: string | false;\n}\n\nconst LocaleProvider = ({children, storage}: PropsWithChildren<LocaleProviderProps>) => {\n const locale = useMemo(() => new DynamicLocale(storage), []);\n\n const [lang, setLang] = useState<Language>(locale.lang());\n\n const _: LocaleContract[\"_\"] = useCallback((key, substitutions): string => {\n return locale.trans(key, substitutions);\n }, []);\n\n const choice: LocaleContract[\"choice\"] = useCallback((key, count, substitutions): string => {\n return locale.choice(key, count, substitutions);\n }, []);\n\n const change: LocaleContract[\"change\"] = useCallback((lang): void => {\n locale.change(lang).catch(err => console.error(`Cannot find locale file for \"${lang}\" language`, err));\n }, []);\n\n useEffect(() => {\n const html = document.querySelector(\"html\");\n\n html?.setAttribute(\"lang\", lang);\n html?.setAttribute(\"dir\", getLocaleDir(lang));\n }, [lang]);\n\n useEffect(() => {\n locale.sync().then(lang => setLang(lang));\n }, []);\n\n useEffect(() => {\n return locale.watch(lang => setLang(lang));\n }, []);\n\n return (\n <LocaleContext.Provider\n value={{\n _,\n choice,\n change,\n lang,\n dir: getLocaleDir(lang),\n isRtl: isLocaleRtl(lang),\n }}\n >\n {children}\n </LocaleContext.Provider>\n );\n};\n\nexport default LocaleProvider;\n"],"mappings":"AAAA,OAAO,SAA2B,aAAa,WAAW,SAAS,gBAAe;AAElF,SAAQ,qBAAoC;AAE5C,SAAQ,cAAc,mBAAkB;AAExC,SAAQ,qBAAoB;AAQ5B,MAAM,iBAAiB,CAAC,EAAC,UAAU,QAAO,MAA8C;AACpF,QAAM,SAAS,QAAQ,MAAM,IAAI,cAAc,OAAO,GAAG,CAAC,CAAC;AAE3D,QAAM,CAAC,MAAM,OAAO,IAAI,SAAmB,OAAO,KAAK,CAAC;AAExD,QAAM,IAAyB,YAAY,CAAC,KAAK,kBAA0B;AACvE,WAAO,OAAO,MAAM,KAAK,aAAa;AAAA,EAC1C,GAAG,CAAC,CAAC;AAEL,QAAM,SAAmC,YAAY,CAAC,KAAK,OAAO,kBAA0B;AACxF,WAAO,OAAO,OAAO,KAAK,OAAO,aAAa;AAAA,EAClD,GAAG,CAAC,CAAC;AAEL,QAAM,SAAmC,YAAY,CAACA,UAAe;AACjE,WAAO,OAAOA,KAAI,EAAE,MAAM,SAAO,QAAQ,MAAM,gCAAgCA,KAAI,cAAc,GAAG,CAAC;AAAA,EACzG,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACZ,UAAM,OAAO,SAAS,cAAc,MAAM;AAE1C,iCAAM,aAAa,QAAQ;AAC3B,iCAAM,aAAa,OAAO,aAAa,IAAI;AAAA,EAC/C,GAAG,CAAC,IAAI,CAAC;AAET,YAAU,MAAM;AACZ,WAAO,KAAK,EAAE,KAAK,CAAAA,UAAQ,QAAQA,KAAI,CAAC;AAAA,EAC5C,GAAG,CAAC,CAAC;AAEL,YAAU,MAAM;AACZ,WAAO,OAAO,MAAM,CAAAA,UAAQ,QAAQA,KAAI,CAAC;AAAA,EAC7C,GAAG,CAAC,CAAC;AAEL,SACI;AAAA,IAAC,cAAc;AAAA,IAAd;AAAA,MACG,OAAO;AAAA,QACH;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,aAAa,IAAI;AAAA,QACtB,OAAO,YAAY,IAAI;AAAA,MAC3B;AAAA;AAAA,IAEC;AAAA,EACL;AAER;AAEA,IAAO,yBAAQ;","names":["lang"]}
@@ -1,4 +1,3 @@
1
- import * as react from 'react';
2
1
  import { LocaleStructure, Language, LocaleDir, LocaleNonPluralKeys, LocaleSubstitutionsFor, LocalePluralKeys } from '../../../types/locale.js';
3
2
  import { LocaleNativeStructure } from '../../providers/NativeLocale.js';
4
3
  import '../../providers/AbstractLocale.js';
@@ -12,7 +11,7 @@ interface LocaleContract<S extends LocaleStructure = LocaleNativeStructure> {
12
11
  change(lang: Language): void;
13
12
  }
14
13
  declare const DefaultLocale: LocaleContract;
15
- declare const LocaleContext: react.Context<LocaleContract<LocaleNativeStructure>>;
16
- declare const useLocale: () => LocaleContract<LocaleNativeStructure>;
14
+ declare const LocaleContext: any;
15
+ declare const useLocale: () => any;
17
16
 
18
17
  export { DefaultLocale, LocaleContext, type LocaleContract, useLocale };
@@ -1,12 +1,6 @@
1
- import react__default, { PropsWithChildren } from 'react';
1
+ export { default as LocaleProvider, LocaleProviderProps } from './LocaleProvider.js';
2
2
  export { LocaleContract, useLocale } from './context.js';
3
+ import 'react';
3
4
  import '../../../types/locale.js';
4
5
  import '../../providers/NativeLocale.js';
5
6
  import '../../providers/AbstractLocale.js';
6
-
7
- interface LocaleProviderProps {
8
- storage?: string | false;
9
- }
10
- declare const LocaleProvider: ({ children, storage }: PropsWithChildren<LocaleProviderProps>) => react__default.JSX.Element;
11
-
12
- export { LocaleProvider, type LocaleProviderProps };
@@ -1,5 +1,5 @@
1
- import { a as ConfigDefinition } from '../config-DzmiK3GH.js';
2
- export { C as Config, R as ReadonlyConfig, U as UserConfig } from '../config-DzmiK3GH.js';
1
+ import { a as ConfigDefinition } from '../config-Ce0Le6r4.js';
2
+ export { C as Config, R as ReadonlyConfig, U as UserConfig } 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 const defineConfig: (config: ConfigDefinition) => ConfigDefinition;
18
19
 
package/dist/main/env.js CHANGED
@@ -1,4 +1,4 @@
1
- import { decryptData } from "./../cli/plugins/dotenv/utils.js";
1
+ import { decryptData } from "./../cli/plugins/dotenv/crypt.js";
2
2
  const getEnv = /* @__PURE__ */ (() => {
3
3
  let envCache;
4
4
  return (key, defaults) => {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/main/env.ts"],"sourcesContent":["import {Browser} from \"@typing/browser\";\nimport {ManifestVersion} from \"@typing/manifest\";\nimport {decryptData} from \"@cli/plugins/dotenv/utils\";\n\nexport const getEnv: {\n <T extends string>(key: string): T | undefined;\n <T extends string, D>(key: string, defaults: D): T | D;\n} = (() => {\n let envCache: object;\n\n return (key: string, defaults?: string) => {\n let env: object;\n\n if (typeof process.env === \"object\") {\n env = process.env;\n } else {\n envCache ??= decryptData(process.env);\n env = envCache;\n }\n\n return (env[key] ?? defaults) as any;\n };\n})();\n\nexport const getApp = (): string => {\n const app = getEnv(\"APP\");\n\n if (app === undefined) {\n throw new Error(\"App is not defined\");\n }\n\n return app;\n};\n\nexport const getBrowser = (): Browser => {\n const browser = getEnv<Browser>(\"BROWSER\");\n\n if (browser === undefined) {\n throw new Error(\"Browser is not defined\");\n }\n\n return browser;\n};\n\nexport const isBrowser = (browser: Browser): browser is Browser => {\n return getBrowser() === browser;\n};\n\nexport const getManifestVersion = (): ManifestVersion => {\n const manifestVersion = getEnv(\"MANIFEST_VERSION\", \"3\");\n\n return parseInt(manifestVersion) as ManifestVersion;\n};\n"],"mappings":"AAEA,SAAQ,mBAAkB;AAEnB,MAAM,SAGR,uBAAM;AACP,MAAI;AAEJ,SAAO,CAAC,KAAa,aAAsB;AACvC,QAAI;AAEJ,QAAI,OAAO,QAAQ,QAAQ,UAAU;AACjC,YAAM,QAAQ;AAAA,IAClB,OAAO;AACH,8BAAa,YAAY,QAAQ,GAAG;AACpC,YAAM;AAAA,IACV;AAEA,WAAQ,IAAI,GAAG,KAAK;AAAA,EACxB;AACJ,GAAG;AAEI,MAAM,SAAS,MAAc;AAChC,QAAM,MAAM,OAAO,KAAK;AAExB,MAAI,QAAQ,QAAW;AACnB,UAAM,IAAI,MAAM,oBAAoB;AAAA,EACxC;AAEA,SAAO;AACX;AAEO,MAAM,aAAa,MAAe;AACrC,QAAM,UAAU,OAAgB,SAAS;AAEzC,MAAI,YAAY,QAAW;AACvB,UAAM,IAAI,MAAM,wBAAwB;AAAA,EAC5C;AAEA,SAAO;AACX;AAEO,MAAM,YAAY,CAAC,YAAyC;AAC/D,SAAO,WAAW,MAAM;AAC5B;AAEO,MAAM,qBAAqB,MAAuB;AACrD,QAAM,kBAAkB,OAAO,oBAAoB,GAAG;AAEtD,SAAO,SAAS,eAAe;AACnC;","names":[]}
1
+ {"version":3,"sources":["../../src/main/env.ts"],"sourcesContent":["import {decryptData} from \"@cli/plugins/dotenv/crypt\";\n\nimport {Browser} from \"@typing/browser\";\nimport {ManifestVersion} from \"@typing/manifest\";\n\nexport const getEnv: {\n <T extends string>(key: string): T | undefined;\n <T extends string, D>(key: string, defaults: D): T | D;\n} = (() => {\n let envCache: object;\n\n return (key: string, defaults?: string) => {\n let env: object;\n\n if (typeof process.env === \"object\") {\n env = process.env;\n } else {\n envCache ??= decryptData(process.env);\n env = envCache;\n }\n\n return (env[key] ?? defaults) as any;\n };\n})();\n\nexport const getApp = (): string => {\n const app = getEnv(\"APP\");\n\n if (app === undefined) {\n throw new Error(\"App is not defined\");\n }\n\n return app;\n};\n\nexport const getBrowser = (): Browser => {\n const browser = getEnv<Browser>(\"BROWSER\");\n\n if (browser === undefined) {\n throw new Error(\"Browser is not defined\");\n }\n\n return browser;\n};\n\nexport const isBrowser = (browser: Browser): browser is Browser => {\n return getBrowser() === browser;\n};\n\nexport const getManifestVersion = (): ManifestVersion => {\n const manifestVersion = getEnv(\"MANIFEST_VERSION\", \"3\");\n\n return parseInt(manifestVersion) as ManifestVersion;\n};\n"],"mappings":"AAAA,SAAQ,mBAAkB;AAKnB,MAAM,SAGR,uBAAM;AACP,MAAI;AAEJ,SAAO,CAAC,KAAa,aAAsB;AACvC,QAAI;AAEJ,QAAI,OAAO,QAAQ,QAAQ,UAAU;AACjC,YAAM,QAAQ;AAAA,IAClB,OAAO;AACH,8BAAa,YAAY,QAAQ,GAAG;AACpC,YAAM;AAAA,IACV;AAEA,WAAQ,IAAI,GAAG,KAAK;AAAA,EACxB;AACJ,GAAG;AAEI,MAAM,SAAS,MAAc;AAChC,QAAM,MAAM,OAAO,KAAK;AAExB,MAAI,QAAQ,QAAW;AACnB,UAAM,IAAI,MAAM,oBAAoB;AAAA,EACxC;AAEA,SAAO;AACX;AAEO,MAAM,aAAa,MAAe;AACrC,QAAM,UAAU,OAAgB,SAAS;AAEzC,MAAI,YAAY,QAAW;AACvB,UAAM,IAAI,MAAM,wBAAwB;AAAA,EAC5C;AAEA,SAAO;AACX;AAEO,MAAM,YAAY,CAAC,YAAyC;AAC/D,SAAO,WAAW,MAAM;AAC5B;AAEO,MAAM,qBAAqB,MAAuB;AACrD,QAAM,kBAAkB,OAAO,oBAAoB,GAAG;AAEtD,SAAO,SAAS,eAAe;AACnC;","names":[]}
@@ -17,7 +17,7 @@ export { SidebarAlias, SidebarMap, changeSidebar, defineSidebar, getSidebars } f
17
17
  export { ViewDefinition, ViewOptions } from '../types/view.js';
18
18
  export { BackgroundConfig, BackgroundDefinition, BackgroundMainHandler } from '../types/background.js';
19
19
  export { CommandConfig, CommandDefinition, CommandExecute, CommandExecuteActionName, CommandUnresolvedDefinition, ExecuteActionCommandDefinition } from '../types/command.js';
20
- export { C as Config, a as ConfigDefinition, P as Plugin, b as PluginDefinition, R as ReadonlyConfig, U as UserConfig } from '../config-DzmiK3GH.js';
20
+ export { C as Config, a as ConfigDefinition, P as Plugin, b as PluginDefinition, R as ReadonlyConfig, U as UserConfig } from '../config-Ce0Le6r4.js';
21
21
  export { contentScriptMountAppendResolver } from '../entry/content/core/resolvers/mount.js';
22
22
  export { isContentScriptDefinition, isValidContentScriptDefinitionRenderValue } from '../entry/content/core/resolvers/definition.js';
23
23
  export { ContentScriptAnchor, ContentScriptAnchorGetter, ContentScriptAnchorResolver, ContentScriptAppend, ContentScriptAppendDefinition, ContentScriptBuilder, ContentScriptConfig, ContentScriptContainerCreator, ContentScriptContainerFactory, ContentScriptContainerOptions, ContentScriptContainerTag, ContentScriptContext, ContentScriptDefinition, ContentScriptEntrypointOptions, ContentScriptEvent, ContentScriptEventCallback, ContentScriptEventEmitter, ContentScriptMainFunction, ContentScriptMatches, ContentScriptMount, ContentScriptMountFunction, ContentScriptNode, ContentScriptNodeSet, ContentScriptOptions, ContentScriptProps, ContentScriptRenderHandler, ContentScriptRenderReactComponent, ContentScriptRenderValue, ContentScriptResolvedDefinition, ContentScriptWatchStrategy } from '../types/content.js';
@@ -40,3 +40,4 @@ import '../types/sidebar.js';
40
40
  import 'react';
41
41
  import 'html-rspack-tags-plugin';
42
42
  import '@rspack/core';
43
+ import '../types/env.js';
@@ -1,5 +1,5 @@
1
- import { b as PluginDefinition } from '../config-DzmiK3GH.js';
2
- export { P as Plugin } from '../config-DzmiK3GH.js';
1
+ import { b as PluginDefinition } from '../config-Ce0Le6r4.js';
2
+ export { P as Plugin } 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 function definePlugin<T extends any[] = []>(plugin: PluginDefinition<T>): PluginDefinition<T>;
18
19