@adbayb/stack 0.0.0-next-fd6185e → 0.0.0-next-c2ead0b

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.
@@ -82,6 +82,7 @@ export const config = [
82
82
  "no-self-assign": "error",
83
83
  "no-shadow-restricted-names": "error",
84
84
  "no-sparse-arrays": "error",
85
+ "no-template-curly-in-string": "error",
85
86
  "no-unexpected-multiline": "error",
86
87
  "no-unsafe-finally": "error",
87
88
  "no-unsafe-optional-chaining": "error",
@@ -192,7 +192,6 @@ export const config = [
192
192
  "sonarjs/sonar-no-empty-character-class": "error",
193
193
  "sonarjs/sonar-no-fallthrough": "error",
194
194
  "sonarjs/sonar-no-invalid-regexp": "error",
195
- "sonarjs/sonar-no-magic-numbers": "error",
196
195
  "sonarjs/sonar-no-misleading-character-class": "error",
197
196
  "sonarjs/sonar-no-regex-spaces": "error",
198
197
  // "sonarjs/sonar-no-unused-class-component-methods": "error", // Disabled since it involves `eslint-plugin-react` activation
@@ -59,6 +59,11 @@ export const config = [
59
59
  prev: ["cjs-export", "export"],
60
60
  },
61
61
  ],
62
+ "@stylistic/quotes": [
63
+ "error",
64
+ "double",
65
+ { allowTemplateLiterals: false, avoidEscape: true },
66
+ ],
62
67
  "@stylistic/spaced-comment": [
63
68
  "error",
64
69
  "always",
@@ -1,3 +1,4 @@
1
+ /* eslint-disable unicorn/string-content */
1
2
  import unicornPlugin from "eslint-plugin-unicorn";
2
3
 
3
4
  import { JAVASCRIPT_LIKE_EXTENSIONS } from "../constants.js";
@@ -111,6 +112,19 @@ export const config = [
111
112
  "unicorn/relative-url-style": ["error", "always"],
112
113
  "unicorn/require-array-join-separator": "error",
113
114
  "unicorn/require-number-to-fixed-digits-argument": "error",
115
+ "unicorn/string-content": [
116
+ "error",
117
+ {
118
+ patterns: {
119
+ "->": "→",
120
+ "\\.\\.\\.": "…",
121
+ "^http:\\/\\/": String.raw`^https:\/\/`,
122
+ },
123
+ },
124
+ ],
125
+ "unicorn/switch-case-braces": "error",
126
+ "unicorn/text-encoding-identifier-case": "error",
127
+ "unicorn/throw-new-error": "error",
114
128
  },
115
129
  },
116
130
  ];
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { helpers, termost } from 'termost';
2
2
  import process from 'node:process';
3
3
  import { resolve, join } from 'node:path';
4
4
  import { createRequire } from 'node:module';
5
- import { writeFile, chmod, mkdir, symlink } from 'node:fs/promises';
5
+ import { writeFile, chmod, mkdir, symlink, rm } from 'node:fs/promises';
6
6
  import { existsSync, cpSync, readFileSync, renameSync, writeFileSync, readdirSync } from 'node:fs';
7
7
  import { fdir } from 'fdir';
8
8
 
@@ -167,7 +167,7 @@ const ESLINT_EXTENSIONS = [
167
167
  "mdx"
168
168
  ];
169
169
 
170
- var version = "0.0.0-next-fd6185e";
170
+ var version = "0.0.0-next-c2ead0b";
171
171
 
172
172
  const createWatchCommand = (program)=>{
173
173
  program.command({
@@ -479,9 +479,9 @@ const label$2 = (message)=>`${message} 🔨`;
479
479
  });
480
480
  /** Template file mutations. */ new fdir().withBasePath().glob(`**/*${templateExtension}`).crawl(projectRootPath).sync().forEach((templateFilePath)=>{
481
481
  const projectFilePath = templateFilePath.slice(0, templateFilePath.lastIndexOf(templateExtension));
482
- const content = evaluate(readFileSync(templateFilePath, "utf-8"));
482
+ const content = evaluate(readFileSync(templateFilePath, "utf8"));
483
483
  renameSync(templateFilePath, projectFilePath);
484
- writeFileSync(projectFilePath, content, "utf-8");
484
+ writeFileSync(projectFilePath, content, "utf8");
485
485
  });
486
486
  /** Template folder mutations. */ new fdir().withBasePath().onlyDirs().filter((path)=>{
487
487
  return templateExpressionRegExp.test(path);
@@ -519,7 +519,8 @@ const createCleanCommand = (program)=>{
519
519
  }
520
520
  }).task({
521
521
  handler ({ files }) {
522
- helpers.message(`Removed assets: ${files.join(", ")}\n`, {
522
+ helpers.message(files.join("\n "), {
523
+ label: "Removed assets",
523
524
  type: "information"
524
525
  });
525
526
  },
@@ -530,15 +531,17 @@ const createCleanCommand = (program)=>{
530
531
  };
531
532
  const label$1 = (message)=>`${message} 🧹`;
532
533
  const cleanFiles = async (files)=>{
533
- return helpers.exec(`rm -rf ${files.join(" ")}`);
534
+ return Promise.all(files.map(async (file)=>rm(file, {
535
+ force: true,
536
+ recursive: true
537
+ })));
534
538
  };
535
539
  const isDirectoryExistAndNotEmpty = (path)=>{
536
540
  return existsSync(path) && readdirSync(path).length > 0;
537
541
  };
538
542
  const retrieveIgnoredFiles = async ()=>{
539
- const excludedFiles = PRESERVE_FILES.join(String.raw`\|`);
540
- const rawFiles = await helpers.exec(`git clean -fdXn | grep -v '${excludedFiles}' | cut -c 14-`);
541
- return rawFiles.split(/\n/).filter(Boolean);
543
+ const rawFiles = await helpers.exec("git clean -fdXn");
544
+ return rawFiles.split(/\n|\r\n/).filter((cleanOutput)=>!PRESERVE_FILES.some((excludedFile)=>cleanOutput.includes(excludedFile))).map((cleanOutput)=>cleanOutput.split(" ").at(-1));
542
545
  };
543
546
  const PRESERVE_FILES = [
544
547
  "node_modules"
@@ -633,7 +636,7 @@ const createPackagesVersionMismatchChecker = ()=>{
633
636
  }
634
637
  const isSameMonorepoVersion = depVersion === storedVersion;
635
638
  if (!isSameMonorepoVersion) {
636
- throw createPackageError(`Mismatched versions: received version \`${depVersion}\` while others use \`${storedVersion}\`. To prevent issues with singleton-like code (React contexts, ...), please make sure to update all packages to use the same \`${dependencyName}\` version (either \`${storedVersion}\` or \`${depVersion}\`.`, {
639
+ throw createPackageError(`Mismatched versions: received version \`${depVersion}\` while others use \`${storedVersion}\`. To prevent issues with singleton-like code (React contexts, ), please make sure to update all packages to use the same \`${dependencyName}\` version (either \`${storedVersion}\` or \`${depVersion}\`.`, {
637
640
  name: dependencyName,
638
641
  consumedBy: packageName
639
642
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adbayb/stack",
3
- "version": "0.0.0-next-fd6185e",
3
+ "version": "0.0.0-next-c2ead0b",
4
4
  "description": "My opinionated JavaScript-based toolchain",
5
5
  "publishConfig": {
6
6
  "access": "public"