extension-develop 3.0.0-next.35 → 3.0.0-next.37

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 (2) hide show
  1. package/dist/module.js +27 -29
  2. package/package.json +1 -1
package/dist/module.js CHANGED
@@ -5100,7 +5100,7 @@ var __webpack_modules__ = {
5100
5100
  },
5101
5101
  "./package.json": function(module) {
5102
5102
  "use strict";
5103
- module.exports = JSON.parse('{"i8":"3.0.0-next.35","HO":{"@rspack/core":"^1.6.3","@rspack/dev-server":"^1.1.4","@swc/core":"^1.13.2","@swc/helpers":"^0.5.15","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chokidar":"^4.0.1","chrome-location2":"3.2.1","chromium-location":"1.2.3","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^16.4.7","edge-location":"^2.1.1","firefox-location2":"2.1.1","go-git-it":"^5.0.0","ignore":"^6.0.2","loader-utils":"^3.3.1","magic-string":"^0.30.10","package-manager-detector":"^0.2.7","parse5":"^7.2.1","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.2.0","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.18.0"}}');
5103
+ module.exports = JSON.parse('{"i8":"3.0.0-next.37","HO":{"@rspack/core":"^1.6.3","@rspack/dev-server":"^1.1.4","@swc/core":"^1.13.2","@swc/helpers":"^0.5.15","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chokidar":"^4.0.1","chrome-location2":"3.2.1","chromium-location":"1.2.3","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^16.4.7","edge-location":"^2.1.1","firefox-location2":"2.1.1","go-git-it":"^5.0.0","ignore":"^6.0.2","loader-utils":"^3.3.1","magic-string":"^0.30.10","package-manager-detector":"^0.2.7","parse5":"^7.2.1","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.2.0","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.18.0"}}');
5104
5104
  }
5105
5105
  };
5106
5106
  var __webpack_module_cache__ = {};
@@ -6415,7 +6415,7 @@ var __webpack_exports__ = {};
6415
6415
  }
6416
6416
  let tailwind_userMessageDelivered = false;
6417
6417
  function tailwind_isUsingTailwind(projectPath) {
6418
- const isUsingTailwind = (0, css_lib_integrations.S)(projectPath, 'tailwindcss');
6418
+ const isUsingTailwind = (0, css_lib_integrations.S)(projectPath, 'tailwindcss') || (0, css_lib_integrations.S)(projectPath, '@tailwindcss/postcss');
6419
6419
  if (isUsingTailwind) {
6420
6420
  if (!tailwind_userMessageDelivered) {
6421
6421
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(isUsingIntegration('Tailwind'));
@@ -6438,6 +6438,7 @@ var __webpack_exports__ = {};
6438
6438
  '.postcssrc.json',
6439
6439
  '.postcssrc.yaml',
6440
6440
  '.postcssrc.yml',
6441
+ 'postcss.config.mjs',
6441
6442
  '.postcssrc.js',
6442
6443
  '.postcssrc.cjs',
6443
6444
  'postcss.config.js',
@@ -6474,37 +6475,44 @@ var __webpack_exports__ = {};
6474
6475
  return false;
6475
6476
  }
6476
6477
  async function maybeUsePostCss(projectPath, opts) {
6477
- if (!isUsingPostCss(projectPath)) return {};
6478
6478
  const userPostCssConfig = findPostCssConfig(projectPath);
6479
- function getProjectPostcssImpl() {
6479
+ function hasPostCssInPackageJson(p) {
6480
6480
  try {
6481
- const req = (0, external_module_namespaceObject.createRequire)(external_path_.join(projectPath, 'package.json'));
6482
- return req('postcss');
6481
+ const raw = external_fs_.readFileSync(external_path_.join(p, 'package.json'), 'utf8');
6482
+ const pkg = JSON.parse(raw || '{}');
6483
+ return !!(null == pkg ? void 0 : pkg.postcss);
6483
6484
  } catch {
6484
- try {
6485
- return __webpack_require__("../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/postcss.js");
6486
- } catch {
6487
- return;
6488
- }
6485
+ return false;
6489
6486
  }
6490
6487
  }
6488
+ const pkgHasPostCss = hasPostCssInPackageJson(projectPath);
6489
+ const tailwindPresent = tailwind_isUsingTailwind(projectPath);
6490
+ if (!userPostCssConfig && !pkgHasPostCss && !tailwindPresent) return {};
6491
6491
  try {
6492
6492
  require.resolve('postcss-loader');
6493
6493
  } catch (e) {
6494
6494
  if (!isUsingSass(projectPath) && !isUsingLess(projectPath)) {
6495
- const postCssDependencies = userPostCssConfig ? [
6495
+ const postCssDependencies = [
6496
6496
  'postcss',
6497
6497
  'postcss-loader'
6498
- ] : [
6499
- 'postcss',
6500
- 'postcss-loader',
6501
- 'postcss-preset-env'
6502
6498
  ];
6503
6499
  await (0, css_lib_integrations.b)('PostCSS', postCssDependencies);
6504
6500
  }
6505
6501
  console.log(youAreAllSet('PostCSS'));
6506
6502
  process.exit(0);
6507
6503
  }
6504
+ function getProjectPostcssImpl() {
6505
+ try {
6506
+ const req = (0, external_module_namespaceObject.createRequire)(external_path_.join(projectPath, 'package.json'));
6507
+ return req('postcss');
6508
+ } catch {
6509
+ try {
6510
+ return __webpack_require__("../../node_modules/.pnpm/postcss@8.5.6/node_modules/postcss/lib/postcss.js");
6511
+ } catch {
6512
+ return;
6513
+ }
6514
+ }
6515
+ }
6508
6516
  return {
6509
6517
  test: /\.css$/,
6510
6518
  type: 'css',
@@ -6513,18 +6521,8 @@ var __webpack_exports__ = {};
6513
6521
  implementation: getProjectPostcssImpl(),
6514
6522
  postcssOptions: {
6515
6523
  ident: 'postcss',
6516
- config: userPostCssConfig ? userPostCssConfig : false,
6517
- plugins: userPostCssConfig ? [] : [
6518
- [
6519
- 'postcss-preset-env',
6520
- {
6521
- autoprefixer: {
6522
- flexbox: 'no-2009'
6523
- },
6524
- stage: 3
6525
- }
6526
- ]
6527
- ].filter(Boolean)
6524
+ cwd: projectPath,
6525
+ config: projectPath
6528
6526
  },
6529
6527
  sourceMap: 'development' === opts.mode
6530
6528
  }
@@ -6532,7 +6530,7 @@ var __webpack_exports__ = {};
6532
6530
  }
6533
6531
  async function commonStyleLoaders(projectPath, opts) {
6534
6532
  const styleLoaders = [];
6535
- if (tailwind_isUsingTailwind(projectPath) || isUsingSass(projectPath) || isUsingLess(projectPath)) {
6533
+ if (isUsingPostCss(projectPath) || tailwind_isUsingTailwind(projectPath) || isUsingSass(projectPath) || isUsingLess(projectPath)) {
6536
6534
  const maybeInstallPostCss = await maybeUsePostCss(projectPath, opts);
6537
6535
  if (maybeInstallPostCss.loader) styleLoaders.push(maybeInstallPostCss);
6538
6536
  }
package/package.json CHANGED
@@ -21,7 +21,7 @@
21
21
  "dist"
22
22
  ],
23
23
  "name": "extension-develop",
24
- "version": "3.0.0-next.35",
24
+ "version": "3.0.0-next.37",
25
25
  "description": "The develop step of Extension.js",
26
26
  "author": {
27
27
  "name": "Cezar Augusto",