@naturalcycles/dev-lib 19.0.2 → 19.0.3
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/dist/build.util.js +5 -2
- package/dist/lint.util.d.ts +1 -0
- package/dist/lint.util.js +1 -1
- package/package.json +1 -1
package/dist/build.util.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { exec2, fs2, kpySync } from '@naturalcycles/nodejs-lib';
|
|
2
|
+
import { findPackageBinPath } from './lint.util.js';
|
|
2
3
|
export async function buildProd() {
|
|
3
4
|
fs2.emptyDir('./dist'); // it doesn't delete the dir itself, to prevent IDE jumping
|
|
4
5
|
buildCopy();
|
|
@@ -25,14 +26,16 @@ export async function runTSCInFolder(tsconfigPath, args = []) {
|
|
|
25
26
|
// console.log(`Skipping to run tsc for ${tsconfigPath}, as it doesn't exist`)
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
const tscPath = findPackageBinPath('typescript', 'tsc');
|
|
30
|
+
await exec2.spawnAsync(tscPath, {
|
|
29
31
|
args: ['-P', tsconfigPath, ...args],
|
|
30
32
|
shell: false,
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
35
|
export async function runTSCProd(args = []) {
|
|
34
36
|
const tsconfigPath = [`./tsconfig.prod.json`].find(p => fs2.pathExists(p)) || 'tsconfig.json';
|
|
35
|
-
|
|
37
|
+
const tscPath = findPackageBinPath('typescript', 'tsc');
|
|
38
|
+
await exec2.spawnAsync(tscPath, {
|
|
36
39
|
args: ['-P', tsconfigPath, '--noEmit', 'false', '--noCheck', ...args],
|
|
37
40
|
shell: false,
|
|
38
41
|
});
|
package/dist/lint.util.d.ts
CHANGED
|
@@ -18,4 +18,5 @@ export declare function runCommitlintCommand(): void;
|
|
|
18
18
|
export declare function requireActionlintVersion(): void;
|
|
19
19
|
export declare function getActionLintVersion(): SemVerString | undefined;
|
|
20
20
|
export declare function runBiome(fix?: boolean): void;
|
|
21
|
+
export declare function findPackageBinPath(pkg: string, cmd: string): string;
|
|
21
22
|
export {};
|
package/dist/lint.util.js
CHANGED
|
@@ -261,7 +261,7 @@ function gitStatus() {
|
|
|
261
261
|
catch { }
|
|
262
262
|
}
|
|
263
263
|
const require = createRequire(import.meta.url);
|
|
264
|
-
function findPackageBinPath(pkg, cmd) {
|
|
264
|
+
export function findPackageBinPath(pkg, cmd) {
|
|
265
265
|
const packageJsonPath = require.resolve(`${pkg}/package.json`);
|
|
266
266
|
const { bin } = fs2.readJson(packageJsonPath);
|
|
267
267
|
return path.join(path.dirname(packageJsonPath), typeof bin === 'string' ? bin : bin[cmd]);
|