fabrique 1.0.21 → 1.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fabrique",
3
- "version": "1.0.21",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "main": "./src/index.js",
6
6
  "bin": "./src/index.js",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "packageManager": "yarn@4.12.0",
23
23
  "devDependencies": {
24
- "@inquirer/prompts": "^8.0.2",
24
+ "@inquirer/prompts": "^8.2.0",
25
25
  "prettier": "^3.7.4",
26
26
  "prettier-plugin-organize-imports": "^4.3.0",
27
27
  "typescript": "^5.9.3"
@@ -3,9 +3,11 @@ import process from 'node:process';
3
3
 
4
4
  /**
5
5
  * Runs "command" into the terminal.
6
+ *
6
7
  * @param {string} command
7
8
  * @param {readonly string[]} args
8
9
  * @param {SpawnOptions | undefined} options
10
+ * @return {Promise<void>} A Promise that resolves when the command exits (ends with code 0) or rejects if the command fails.
9
11
  */
10
12
  export async function cmd(command, args = [], options) {
11
13
  return new Promise((resolve, reject) => {
@@ -4,7 +4,7 @@ This projet is open to everyone. Feel free to test the library, share it, improv
4
4
 
5
5
  ### Getting started
6
6
 
7
- The library requires [Node.js](https://nodejs.org/en) `22+` and [yarn](https://yarnpkg.com/).
7
+ The library requires [Node.js](https://nodejs.org/en) `24+` and [yarn](https://yarnpkg.com/).
8
8
 
9
9
  First, we have to use the correct version of node:
10
10
 
@@ -12,7 +12,7 @@ First, we have to use the correct version of node:
12
12
  nvm use
13
13
  ```
14
14
 
15
- If you don't have [nvm](https://github.com/nvm-sh/nvm), you may manually install and use Node.js 22+.
15
+ If you don't have [nvm](https://github.com/nvm-sh/nvm), you may manually install and use Node.js 24+.
16
16
 
17
17
  Then, we have to use the proper package manager (here `yarn`):
18
18
 
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2025 {{author}}
3
+ Copyright (c) 2026 {{author}}
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -112,7 +112,7 @@ async function buildTypescript(sourcePath) {
112
112
  }
113
113
 
114
114
  function generateExportEsmLine(path) {
115
- return `export * from './${path.replaceAll('\\', '/').slice(0, -3)}.js';\n`;
115
+ return `export * from './${path.replaceAll('\\', '/').slice(0, -3)}.ts';\n`;
116
116
  }
117
117
 
118
118
  /**
@@ -3,9 +3,11 @@ import process from 'node:process';
3
3
 
4
4
  /**
5
5
  * Runs "command" into the terminal.
6
+ *
6
7
  * @param {string} command
7
8
  * @param {readonly string[]} args
8
9
  * @param {SpawnOptions | undefined} options
10
+ * @return {Promise<void>} A Promise that resolves when the command exits (ends with code 0) or rejects if the command fails.
9
11
  */
10
12
  export async function cmd(command, args = [], options) {
11
13
  return new Promise((resolve, reject) => {
@@ -3,10 +3,11 @@ import { join, relative, resolve } from 'node:path';
3
3
  import process from 'node:process';
4
4
 
5
5
  /**
6
- * Runs "command" into the terminal.
6
+ * Recursively explore a directory and yield all files.
7
+ *
7
8
  * @param {string} path
8
9
  * @param {{relativeTo?: string; pick?: (path: string, type: { isFile: boolean; isDirectory: boolean; }) => boolean; }?} options
9
- * @return {AsyncGenerator<string>}
10
+ * @returns {AsyncGenerator<string>} A generator that yields all files (path) in the directory.
10
11
  */
11
12
  export async function* exploreDirectoryFiles(path, options) {
12
13
  const dir = await opendir(resolve(process.cwd(), path));
@@ -26,13 +26,13 @@
26
26
  "url": "{{giturl}}"
27
27
  },
28
28
  "devDependencies": {
29
- "@types/node": "^24.10.1",
30
- "@vitest/coverage-istanbul": "^4.0.15",
29
+ "@types/node": "^25.0.7",
30
+ "@vitest/coverage-istanbul": "^4.0.17",
31
31
  "prettier": "^3.7.4",
32
32
  "prettier-plugin-organize-imports": "^4.3.0",
33
- "typedoc": "^0.28.15",
33
+ "typedoc": "^0.28.16",
34
34
  "typescript": "^5.9.3",
35
- "vitest": "^4.0.15"
35
+ "vitest": "^4.0.17"
36
36
  },
37
37
  "packageManager": "yarn@4.12.0"
38
38
  }
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it } from 'vitest';
2
- import { add } from './add.js';
2
+ import { add } from './add.ts';
3
3
 
4
4
  describe('add', () => {
5
5
  it('should return correct result', () => {
@@ -0,0 +1,3 @@
1
+ import { add } from './add.ts';
2
+
3
+ console.log(add(1, 2));
@@ -26,17 +26,21 @@
26
26
  "resolveJsonModule": true,
27
27
  "sourceMap": true,
28
28
  "stripInternal": false,
29
- "preserveConstEnums": false,
29
+ "preserveConstEnums": true,
30
30
  "alwaysStrict": true,
31
31
 
32
32
  /* Mode */
33
33
  "esModuleInterop": true,
34
34
  "moduleResolution": "NodeNext",
35
- "allowImportingTsExtensions": false,
36
35
  "isolatedModules": false,
37
36
  "moduleDetection": "force",
38
37
  "noEmit": false,
38
+
39
+ /* Import */
40
+ "allowImportingTsExtensions": true,
39
41
  "allowSyntheticDefaultImports": true,
42
+ "rewriteRelativeImportExtensions": true,
43
+ "verbatimModuleSyntax": true,
40
44
 
41
45
  /* Linting */
42
46
  "strict": true,
@@ -57,6 +61,7 @@
57
61
  "strictFunctionTypes": true,
58
62
  "strictNullChecks": true,
59
63
  "strictPropertyInitialization": true,
64
+ "erasableSyntaxOnly": true,
60
65
  },
61
66
  "include": [
62
67
  "src/**/*.ts"