@forsakringskassan/vite-lib-config 5.15.3 → 6.0.1

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
@@ -47,7 +47,7 @@ module.exports = {
47
47
  ```ts
48
48
  import { defineConfig } from "@forsakringskassan/vite-lib-config/vite";
49
49
 
50
- export default defineConfig();
50
+ export default defineConfig(import.meta.dirname);
51
51
  ```
52
52
 
53
53
  In addition to the regular Vite configuration you can also pass the optional `fk` property:
@@ -179,7 +179,7 @@ import {
179
179
  defaultPlugins,
180
180
  } from "@forsakringskassan/vite-lib-config/vite";
181
181
 
182
- export default defineConfig({
182
+ export default defineConfig(import.meta.dirname, {
183
183
  plugins: [...defaultPlugins, myFancyPlugin],
184
184
  });
185
185
  ```
@@ -111,6 +111,11 @@ var require_vendors = __commonJS({
111
111
  ne: "false"
112
112
  }
113
113
  },
114
+ {
115
+ name: "Capawesome Cloud",
116
+ constant: "CAPAWESOME_CLOUD",
117
+ env: "CAPAWESOME_CLOUD"
118
+ },
114
119
  {
115
120
  name: "CircleCI",
116
121
  constant: "CIRCLE",
@@ -293,6 +298,11 @@ var require_vendors = __commonJS({
293
298
  IS_PULL_REQUEST: "true"
294
299
  }
295
300
  },
301
+ {
302
+ name: "RWX",
303
+ constant: "RWX",
304
+ env: "RWX"
305
+ },
296
306
  {
297
307
  name: "Sail CI",
298
308
  constant: "SAIL",
@@ -429,10 +439,10 @@ var require_ci_info = __commonJS({
429
439
  exports.isCI = !!(env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
430
440
  (env.BUILD_ID || // Jenkins, Cloudbees
431
441
  env.BUILD_NUMBER || // Jenkins, TeamCity
432
- env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari, Cloudflare Pages/Workers
433
- env.CI_APP_ID || // Appflow
434
- env.CI_BUILD_ID || // Appflow
435
- env.CI_BUILD_NUMBER || // Appflow
442
+ env.CI || // Appveyor, Capawesome Cloud, CircleCI, Cirrus CI, Cloudflare Pages/Workers, CodeShip, dsari, Gitlab CI, RWX, Travis CI
443
+ env.CI_APP_ID || // Appflow, Capawesome Cloud
444
+ env.CI_BUILD_ID || // Appflow, Capawesome Cloud
445
+ env.CI_BUILD_NUMBER || // Appflow, Capawesome Cloud
436
446
  env.CI_NAME || // Codeship and others
437
447
  env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
438
448
  env.RUN_ID || // TaskCluster, dsari
@@ -4938,7 +4938,7 @@ var import_node_fs = __toESM(require("node:fs"), 1);
4938
4938
  var import_vite = require("vite");
4939
4939
  var import_vue = require("vue");
4940
4940
 
4941
- // node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs
4941
+ // node_modules/@rolldown/pluginutils/dist/filter-p20yeu4b.mjs
4942
4942
  function exactRegex(str, flags) {
4943
4943
  return new RegExp(`^${escapeRegex(str)}$`, flags);
4944
4944
  }
@@ -7125,7 +7125,7 @@ function getLocator(source) {
7125
7125
  return { line, column };
7126
7126
  };
7127
7127
  }
7128
- var wordRegex = /\w/;
7128
+ var wordRegex2 = /\w/;
7129
7129
  var Mappings = class {
7130
7130
  constructor(hires) {
7131
7131
  this.hires = hires;
@@ -7181,7 +7181,7 @@ var Mappings = class {
7181
7181
  if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
7182
7182
  const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
7183
7183
  if (this.hires === "boundary") {
7184
- if (wordRegex.test(original[originalCharIndex])) {
7184
+ if (wordRegex2.test(original[originalCharIndex])) {
7185
7185
  if (!charInHiresBoundary) {
7186
7186
  this.rawSegments.push(segment);
7187
7187
  charInHiresBoundary = true;
@@ -8635,9 +8635,14 @@ var defaultConfig = {
8635
8635
  function overwriteMerge(_a, b) {
8636
8636
  return b;
8637
8637
  }
8638
- function defineConfig(config = {}) {
8638
+ function defineConfig(rootDir2, config = {}) {
8639
+ if (typeof rootDir2 !== "string") {
8640
+ throw new TypeError(
8641
+ `Expected first argument to be a "string", got "${typeof rootDir2}"`
8642
+ );
8643
+ }
8639
8644
  return (0, import_vite2.defineConfig)(({ mode }) => {
8640
- return fkDefineConfig(mode, config);
8645
+ return fkDefineConfig(rootDir2, mode, config);
8641
8646
  });
8642
8647
  }
8643
8648
  function shouldUseCustomEntrypoint(options) {
@@ -8653,7 +8658,7 @@ function shouldUseCustomEntrypoint(options) {
8653
8658
  }
8654
8659
  return !config.fk?.entrypoint;
8655
8660
  }
8656
- async function fkDefineConfig(mode, config = {}) {
8661
+ async function fkDefineConfig(_rootDir, mode, config = {}) {
8657
8662
  const argv = process.argv.slice(2);
8658
8663
  const positional = argv.filter((it) => !it.startsWith("-"));
8659
8664
  config.fk ??= {};
@@ -16,7 +16,7 @@ export declare const defaultPlugins: (Plugin_2<any> | Plugin_3<any>)[];
16
16
  /**
17
17
  * @public
18
18
  */
19
- export declare function defineConfig(config?: UserConfig): UserConfigFn;
19
+ export declare function defineConfig(rootDir: string, config?: UserConfig): UserConfigFn;
20
20
 
21
21
  /**
22
22
  * @public
@@ -4930,7 +4930,7 @@ import fs from "node:fs";
4930
4930
  import { createFilter, formatPostcssSourceMap, isCSSRequest, normalizePath, transformWithEsbuild } from "vite";
4931
4931
  import { computed, shallowRef } from "vue";
4932
4932
 
4933
- // node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs
4933
+ // node_modules/@rolldown/pluginutils/dist/filter-p20yeu4b.mjs
4934
4934
  function exactRegex(str, flags) {
4935
4935
  return new RegExp(`^${escapeRegex(str)}$`, flags);
4936
4936
  }
@@ -7117,7 +7117,7 @@ function getLocator(source) {
7117
7117
  return { line, column };
7118
7118
  };
7119
7119
  }
7120
- var wordRegex = /\w/;
7120
+ var wordRegex2 = /\w/;
7121
7121
  var Mappings = class {
7122
7122
  constructor(hires) {
7123
7123
  this.hires = hires;
@@ -7173,7 +7173,7 @@ var Mappings = class {
7173
7173
  if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
7174
7174
  const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
7175
7175
  if (this.hires === "boundary") {
7176
- if (wordRegex.test(original[originalCharIndex])) {
7176
+ if (wordRegex2.test(original[originalCharIndex])) {
7177
7177
  if (!charInHiresBoundary) {
7178
7178
  this.rawSegments.push(segment);
7179
7179
  charInHiresBoundary = true;
@@ -8629,9 +8629,14 @@ var defaultConfig = {
8629
8629
  function overwriteMerge(_a, b) {
8630
8630
  return b;
8631
8631
  }
8632
- function defineConfig(config = {}) {
8632
+ function defineConfig(rootDir2, config = {}) {
8633
+ if (typeof rootDir2 !== "string") {
8634
+ throw new TypeError(
8635
+ `Expected first argument to be a "string", got "${typeof rootDir2}"`
8636
+ );
8637
+ }
8633
8638
  return viteDefineConfig(({ mode }) => {
8634
- return fkDefineConfig(mode, config);
8639
+ return fkDefineConfig(rootDir2, mode, config);
8635
8640
  });
8636
8641
  }
8637
8642
  function shouldUseCustomEntrypoint(options) {
@@ -8647,7 +8652,7 @@ function shouldUseCustomEntrypoint(options) {
8647
8652
  }
8648
8653
  return !config.fk?.entrypoint;
8649
8654
  }
8650
- async function fkDefineConfig(mode, config = {}) {
8655
+ async function fkDefineConfig(_rootDir, mode, config = {}) {
8651
8656
  const argv = process.argv.slice(2);
8652
8657
  const positional = argv.filter((it) => !it.startsWith("-"));
8653
8658
  config.fk ??= {};
@@ -769,7 +769,7 @@ function generateViteConfig() {
769
769
  `import { defineConfig } from "@forsakringskassan/vite-lib-config/vite";`,
770
770
  `import { defineTestConfig } from "@forsakringskassan/vitest-config-jsdom";`,
771
771
  ``,
772
- `export default defineConfig({`,
772
+ `export default defineConfig(import.meta.dirname, {`,
773
773
  ` test: defineTestConfig(),`,
774
774
  `});`
775
775
  ].map((it) => `${it}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/vite-lib-config",
3
- "version": "5.15.3",
3
+ "version": "6.0.1",
4
4
  "description": "Försäkringskassan toolchain to build libraries with Vite",
5
5
  "keywords": [
6
6
  "vite"