extension-develop 3.8.9 → 3.8.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -228,6 +228,7 @@ export default {
228
228
  2. `.env.development`
229
229
  3. `.env.local`
230
230
  4. `.env`
231
+ - In monorepos, if none of the files above exist in the project directory, develop falls back to the nearest workspace root (directory containing `pnpm-workspace.yaml`) and applies the same loading order there.
231
232
  - Only variables you read explicitly in the config are used there; client-side injection still requires the `EXTENSION_PUBLIC_*` prefix.
232
233
  - Example:
233
234
 
package/dist/module.cjs CHANGED
@@ -131453,7 +131453,6 @@ var __webpack_modules__ = {
131453
131453
  var pintor__rspack_import_3_default = /*#__PURE__*/ __webpack_require__.n(pintor__rspack_import_3);
131454
131454
  var _webpack_lib_check_build_dependencies__rspack_import_4 = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
131455
131455
  var _webpack_lib_package_manager__rspack_import_5 = __webpack_require__("./webpack/webpack-lib/package-manager.ts");
131456
- var _webpack_lib_progress__rspack_import_6 = __webpack_require__("./webpack/webpack-lib/progress.ts");
131457
131456
  function parseJsonSafe(text) {
131458
131457
  const s = text && 0xfeff === text.charCodeAt(0) ? text.slice(1) : text;
131459
131458
  return JSON.parse(s || '{}');
@@ -131690,34 +131689,25 @@ var __webpack_modules__ = {
131690
131689
  const setupMessage = setupMessages[0];
131691
131690
  const hasIndex = Boolean(options?.index && options?.total);
131692
131691
  const setupMessageWithIndex = hasIndex ? setupMessage.replace('►►► ', `►►► [${options?.index}/${options?.total}] `) : setupMessage;
131693
- const progressEnabled = !isAuthor && (0, _webpack_lib_progress__rspack_import_6.u)();
131694
- const progress = (0, _webpack_lib_progress__rspack_import_6.J)(setupMessageWithIndex, {
131695
- enabled: progressEnabled,
131696
- persistLabel: true
131697
- });
131698
131692
  if (isAuthor) console.warn(setupMessageWithIndex);
131699
- else if (!progressEnabled) console.log(setupMessageWithIndex);
131700
- try {
131701
- for (const dependency of dependencies){
131702
- const installCommand = getOptionalInstallCommand(pm, [
131703
- dependency
131704
- ], wslContext.installDir || installBaseDir);
131705
- const execCommand = wrapCommandForWsl(installCommand, wslContext);
131706
- const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_5.sX)([
131707
- '--silent',
131708
- 'install',
131709
- dependency,
131710
- '--prefix',
131711
- installBaseDir,
131712
- '--save-optional'
131713
- ]);
131714
- await execInstallWithFallback(execCommand, {
131715
- cwd: wslContext.useWsl ? void 0 : installBaseDir,
131716
- fallbackNpmCommand
131717
- });
131718
- }
131719
- } finally{
131720
- progress.stop();
131693
+ else console.log(setupMessageWithIndex);
131694
+ for (const dependency of dependencies){
131695
+ const installCommand = getOptionalInstallCommand(pm, [
131696
+ dependency
131697
+ ], wslContext.installDir || installBaseDir);
131698
+ const execCommand = wrapCommandForWsl(installCommand, wslContext);
131699
+ const fallbackNpmCommand = wslContext.useWsl ? void 0 : (0, _webpack_lib_package_manager__rspack_import_5.sX)([
131700
+ '--silent',
131701
+ 'install',
131702
+ dependency,
131703
+ '--prefix',
131704
+ installBaseDir,
131705
+ '--save-optional'
131706
+ ]);
131707
+ await execInstallWithFallback(execCommand, {
131708
+ cwd: wslContext.useWsl ? void 0 : installBaseDir,
131709
+ fallbackNpmCommand
131710
+ });
131721
131711
  }
131722
131712
  await new Promise((resolve)=>setTimeout(resolve, 500));
131723
131713
  if (isAuthor) {
@@ -133159,27 +133149,54 @@ var __webpack_modules__ = {
133159
133149
  fn(exports1, requireFn, module, absolutePath, dirname);
133160
133150
  return module.exports?.default || module.exports;
133161
133151
  }
133162
- function preloadEnvFiles(projectDir) {
133152
+ function findNearestWorkspaceRoot(startDir) {
133153
+ let current = external_path_.resolve(startDir);
133154
+ while(true){
133155
+ if (external_fs_.existsSync(external_path_.join(current, 'pnpm-workspace.yaml'))) return current;
133156
+ const parent = external_path_.dirname(current);
133157
+ if (parent === current) return;
133158
+ current = parent;
133159
+ }
133160
+ }
133161
+ function preloadEnvFilesFromDir(envDir, options) {
133162
+ let loadedAny = false;
133163
133163
  try {
133164
- const defaultsPath = external_path_.join(projectDir, '.env.defaults');
133165
- if (external_fs_.existsSync(defaultsPath)) external_dotenv_default().config({
133166
- path: defaultsPath
133167
- });
133164
+ const defaultsPath = external_path_.join(envDir, '.env.defaults');
133165
+ if (external_fs_.existsSync(defaultsPath)) {
133166
+ external_dotenv_default().config({
133167
+ path: defaultsPath,
133168
+ override: Boolean(options?.override)
133169
+ });
133170
+ loadedAny = true;
133171
+ }
133168
133172
  const envCandidates = [
133169
133173
  '.env.development',
133170
133174
  '.env.local',
133171
133175
  '.env'
133172
133176
  ];
133173
133177
  for (const filename of envCandidates){
133174
- const filePath = external_path_.join(projectDir, filename);
133178
+ const filePath = external_path_.join(envDir, filename);
133175
133179
  if (external_fs_.existsSync(filePath)) {
133176
133180
  external_dotenv_default().config({
133177
- path: filePath
133181
+ path: filePath,
133182
+ override: Boolean(options?.override)
133178
133183
  });
133184
+ loadedAny = true;
133179
133185
  break;
133180
133186
  }
133181
133187
  }
133182
133188
  } catch {}
133189
+ return {
133190
+ loadedAny,
133191
+ envDir
133192
+ };
133193
+ }
133194
+ function preloadEnvFiles(projectDir) {
133195
+ const local = preloadEnvFilesFromDir(projectDir);
133196
+ if (local.loadedAny) return local;
133197
+ const workspaceRoot = findNearestWorkspaceRoot(projectDir);
133198
+ if (workspaceRoot && workspaceRoot !== projectDir) return preloadEnvFilesFromDir(workspaceRoot);
133199
+ return local;
133183
133200
  }
133184
133201
  async function loadConfigFile(configPath) {
133185
133202
  const absolutePath = external_path_.resolve(configPath);
@@ -134682,59 +134699,6 @@ var __webpack_modules__ = {
134682
134699
  }
134683
134700
  }
134684
134701
  },
134685
- "./webpack/webpack-lib/progress.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
134686
- "use strict";
134687
- __webpack_require__.d(__webpack_exports__, {
134688
- J: ()=>startProgressBar,
134689
- u: ()=>shouldShowProgress
134690
- });
134691
- function clearLine() {
134692
- if (!process.stdout.isTTY) return;
134693
- process.stdout.write('\r');
134694
- process.stdout.write('\x1b[2K');
134695
- }
134696
- function stripAnsi(input) {
134697
- return input.replace(/\x1b\[[0-9;]*m/g, '');
134698
- }
134699
- function shouldShowProgress() {
134700
- return Boolean(process.stdout.isTTY) && !process.env.CI;
134701
- }
134702
- function startProgressBar(label, options) {
134703
- const enabled = (options?.enabled ?? true) && shouldShowProgress();
134704
- if (!enabled) return {
134705
- stop: ()=>void 0
134706
- };
134707
- const width = Math.max(10, options?.width ?? 24);
134708
- const intervalMs = Math.max(50, options?.intervalMs ?? 90);
134709
- let tick = 0;
134710
- let lastVisibleLength = 0;
134711
- const render = ()=>{
134712
- const filled = tick % (width + 1);
134713
- const empty = width - filled;
134714
- const bar = `[${'='.repeat(filled)}${' '.repeat(empty)}]`;
134715
- const line = `${label} ${bar}`;
134716
- lastVisibleLength = stripAnsi(line).length;
134717
- clearLine();
134718
- process.stdout.write(line);
134719
- tick = (tick + 1) % (width + 1);
134720
- };
134721
- render();
134722
- const timer = setInterval(render, intervalMs);
134723
- return {
134724
- stop: ()=>{
134725
- clearInterval(timer);
134726
- if (process.stdout.isTTY) {
134727
- clearLine();
134728
- if (lastVisibleLength > 0) {
134729
- process.stdout.write(' '.repeat(lastVisibleLength));
134730
- process.stdout.write('\r');
134731
- }
134732
- if (options?.persistLabel) process.stdout.write(`${label}\n`);
134733
- }
134734
- }
134735
- };
134736
- }
134737
- },
134738
134702
  "./webpack/webpack-lib/sanitize.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
134739
134703
  "use strict";
134740
134704
  __webpack_require__.d(__webpack_exports__, {
@@ -134866,7 +134830,7 @@ var __webpack_modules__ = {
134866
134830
  },
134867
134831
  "./package.json" (module) {
134868
134832
  "use strict";
134869
- module.exports = JSON.parse('{"rE":"3.8.9","El":{"@rspack/core":"^1.7.5","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","extension-from-store":"^0.1.1","firefox-location2":"3.0.0","go-git-it":"^5.1.1","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
134833
+ module.exports = JSON.parse('{"rE":"3.8.10","El":{"@rspack/core":"^1.7.5","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","extension-from-store":"^0.1.1","firefox-location2":"3.0.0","go-git-it":"^5.1.1","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
134870
134834
  }
134871
134835
  };
134872
134836
  var __webpack_module_cache__ = {};
@@ -135168,7 +135132,52 @@ var __webpack_exports__ = {};
135168
135132
  var webpack_lib_paths = __webpack_require__("./webpack/webpack-lib/paths.ts");
135169
135133
  var check_build_dependencies = __webpack_require__("./webpack/webpack-lib/check-build-dependencies.ts");
135170
135134
  var package_manager = __webpack_require__("./webpack/webpack-lib/package-manager.ts");
135171
- var webpack_lib_progress = __webpack_require__("./webpack/webpack-lib/progress.ts");
135135
+ function clearLine() {
135136
+ if (!process.stdout.isTTY) return;
135137
+ process.stdout.write('\r');
135138
+ process.stdout.write('\x1b[2K');
135139
+ }
135140
+ function stripAnsi(input) {
135141
+ return input.replace(/\x1b\[[0-9;]*m/g, '');
135142
+ }
135143
+ function shouldShowProgress() {
135144
+ return Boolean(process.stdout.isTTY) && !process.env.CI;
135145
+ }
135146
+ function startProgressBar(label, options) {
135147
+ const enabled = (options?.enabled ?? true) && shouldShowProgress();
135148
+ if (!enabled) return {
135149
+ stop: ()=>void 0
135150
+ };
135151
+ const width = Math.max(10, options?.width ?? 24);
135152
+ const intervalMs = Math.max(50, options?.intervalMs ?? 90);
135153
+ let tick = 0;
135154
+ let lastVisibleLength = 0;
135155
+ const render = ()=>{
135156
+ const filled = tick % (width + 1);
135157
+ const empty = width - filled;
135158
+ const bar = `[${'='.repeat(filled)}${' '.repeat(empty)}]`;
135159
+ const line = `${label} ${bar}`;
135160
+ lastVisibleLength = stripAnsi(line).length;
135161
+ clearLine();
135162
+ process.stdout.write(line);
135163
+ tick = (tick + 1) % (width + 1);
135164
+ };
135165
+ render();
135166
+ const timer = setInterval(render, intervalMs);
135167
+ return {
135168
+ stop: ()=>{
135169
+ clearInterval(timer);
135170
+ if (process.stdout.isTTY) {
135171
+ clearLine();
135172
+ if (lastVisibleLength > 0) {
135173
+ process.stdout.write(' '.repeat(lastVisibleLength));
135174
+ process.stdout.write('\r');
135175
+ }
135176
+ if (options?.persistLabel) process.stdout.write(`${label}\n`);
135177
+ }
135178
+ }
135179
+ };
135180
+ }
135172
135181
  function getInstallArgs(command, dependencies, dependenciesMap) {
135173
135182
  const depsWithVersions = dependencies.map((dep)=>`${dep}@${dependenciesMap[dep]}`);
135174
135183
  if ('pnpm' === command) return [
@@ -135202,9 +135211,9 @@ var __webpack_exports__ = {};
135202
135211
  const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
135203
135212
  const stdio = isAuthor ? 'inherit' : 'ignore';
135204
135213
  const progressLabel = messages.xK(dependencies);
135205
- const progressEnabled = !isAuthor && (0, webpack_lib_progress.u)();
135214
+ const progressEnabled = !isAuthor && shouldShowProgress();
135206
135215
  const persistLabel = 'true' === process.env.EXTENSION_ONE_TIME_INSTALL_HINT;
135207
- const progress = (0, webpack_lib_progress.J)(progressLabel, {
135216
+ const progress = startProgressBar(progressLabel, {
135208
135217
  enabled: progressEnabled,
135209
135218
  persistLabel
135210
135219
  });
package/package.json CHANGED
@@ -24,7 +24,7 @@
24
24
  "webpack/webpack-lib/build-dependencies.json"
25
25
  ],
26
26
  "name": "extension-develop",
27
- "version": "3.8.9",
27
+ "version": "3.8.10",
28
28
  "description": "Develop, build, preview, and package Extension.js projects.",
29
29
  "author": {
30
30
  "name": "Cezar Augusto",