@forsakringskassan/vite-lib-config 5.1.6 → 5.1.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.
package/README.md CHANGED
@@ -138,7 +138,11 @@ When running in dev mode an optional filename (or part of filename) can be given
138
138
  vite -- MyAwesomeExample
139
139
  ```
140
140
 
141
- would search for any `.vue` file matching the given pattern (fuzzy).
141
+ would search for `.vue` files matching the given pattern (fuzzy) in these folders:
142
+
143
+ - `**/docs`
144
+ - `**/examples`
145
+ - `**/test`
142
146
 
143
147
  ### Appending Plugins
144
148
 
@@ -5840,7 +5840,7 @@ ${indent}`);
5840
5840
  // src/utils/extract-augmentations.ts
5841
5841
  function extractAugmentations(content) {
5842
5842
  const matches = content.matchAll(
5843
- /^declare (?:module\s*"([^"]+)"|global)\s*{([^]+?)^}/gm
5843
+ /^declare (?:module\s*"([^"]+)"|global)\s*\{([\s\S]+?)^\}/gm
5844
5844
  );
5845
5845
  return Array.from(matches).map((it2) => {
5846
5846
  const [withDeclaration, name = "", withoutDeclaration] = it2;
@@ -10857,7 +10857,7 @@ function isMatched(name, patterns) {
10857
10857
 
10858
10858
  // src/plugins/babel-plugin.ts
10859
10859
  var babel = __toESM(require("@babel/core"));
10860
- var filter = /\.(js|ts|vue)$/;
10860
+ var filter = /\.(?:js|ts|vue)$/;
10861
10861
  function babelPlugin() {
10862
10862
  return {
10863
10863
  name: "fk:babel",
@@ -10982,8 +10982,7 @@ function indexHtmlPlugin() {
10982
10982
  async handler() {
10983
10983
  const content = await import_promises2.default.readFile(templateFile, "utf8");
10984
10984
  return content.replaceAll(
10985
- /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
10986
- /{{([^}]+)}}/g,
10985
+ /\{\{([^}]+)\}\}/g,
10987
10986
  (match, key) => {
10988
10987
  return templateData[key.trim()] ?? match;
10989
10988
  }
@@ -11227,7 +11226,10 @@ async function findEntrypoint(pattern) {
11227
11226
  return defaultEntrypoint;
11228
11227
  }
11229
11228
  const uf = new import_ufuzzy.default({ intraIns: Infinity });
11230
- const files = await Ze("**/*.vue", { posix: true, nodir: true });
11229
+ const files = await Ze("**/{examples,docs,tests}/**/*.vue", {
11230
+ posix: true,
11231
+ nodir: true
11232
+ });
11231
11233
  const idxs = uf.filter(files, pattern);
11232
11234
  if (!idxs || idxs.length === 0) {
11233
11235
  throw new Error(`No files matching "${pattern}"`);
@@ -10849,7 +10849,7 @@ function isMatched(name, patterns) {
10849
10849
 
10850
10850
  // src/plugins/babel-plugin.ts
10851
10851
  import * as babel from "@babel/core";
10852
- var filter = /\.(js|ts|vue)$/;
10852
+ var filter = /\.(?:js|ts|vue)$/;
10853
10853
  function babelPlugin() {
10854
10854
  return {
10855
10855
  name: "fk:babel",
@@ -10974,8 +10974,7 @@ function indexHtmlPlugin() {
10974
10974
  async handler() {
10975
10975
  const content = await fs4.readFile(templateFile, "utf8");
10976
10976
  return content.replaceAll(
10977
- /* eslint-disable-next-line sonarjs/slow-regex -- technical debt */
10978
- /{{([^}]+)}}/g,
10977
+ /\{\{([^}]+)\}\}/g,
10979
10978
  (match, key) => {
10980
10979
  return templateData[key.trim()] ?? match;
10981
10980
  }
@@ -11221,7 +11220,10 @@ async function findEntrypoint(pattern) {
11221
11220
  return defaultEntrypoint;
11222
11221
  }
11223
11222
  const uf = new import_ufuzzy.default({ intraIns: Infinity });
11224
- const files = await Ze("**/*.vue", { posix: true, nodir: true });
11223
+ const files = await Ze("**/{examples,docs,tests}/**/*.vue", {
11224
+ posix: true,
11225
+ nodir: true
11226
+ });
11225
11227
  const idxs = uf.filter(files, pattern);
11226
11228
  if (!idxs || idxs.length === 0) {
11227
11229
  throw new Error(`No files matching "${pattern}"`);
@@ -622,6 +622,13 @@ async function run(cwd, argv) {
622
622
  return;
623
623
  }
624
624
  const pkg = await readJsonFile(path3.join(cwd, "package.json"));
625
+ if (!pkg.devDependencies?.["@forsakringskassan/vite-lib-config"]) {
626
+ console.error(
627
+ `The "${pkg.name}" does not use "@forsakringskassan/vite-lib-config".`
628
+ );
629
+ console.error(`Skipping writing configuration.`);
630
+ return;
631
+ }
625
632
  const cypressConfigPath = await findCypressConfigPath(cwd);
626
633
  const testRunner = detectTestRunner(flags);
627
634
  const options = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/vite-lib-config",
3
- "version": "5.1.6",
3
+ "version": "5.1.8",
4
4
  "description": "Försäkringskassan toolchain to build libraries with Vite",
5
5
  "keywords": [
6
6
  "vite"