publish-flat 1.18.1 → 1.18.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/PublishFlat.js +4 -4
- package/dist/cli-copy.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/copyJson.d.ts +1 -1
- package/dist/copyJson.js +8 -8
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +5 -5
package/dist/PublishFlat.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Arborist from '@npmcli/arborist';
|
|
2
|
+
import logdown from 'logdown';
|
|
2
3
|
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import fs from 'node:fs/promises';
|
|
3
5
|
import os from 'node:os';
|
|
4
6
|
import path from 'node:path';
|
|
5
|
-
import Arborist from '@npmcli/arborist';
|
|
6
|
-
import logdown from 'logdown';
|
|
7
7
|
import packlist from 'npm-packlist';
|
|
8
8
|
export class PublishFlat {
|
|
9
9
|
constructor(options) {
|
|
@@ -29,7 +29,7 @@ export class PublishFlat {
|
|
|
29
29
|
if (!files.includes('package.json')) {
|
|
30
30
|
throw new Error(`Files don't include a "package.json" file`);
|
|
31
31
|
}
|
|
32
|
-
const {
|
|
32
|
+
const { filesInFlattenedDir, normalFiles } = files.reduce((result, fileName) => {
|
|
33
33
|
if (this.dirToFlattenRegex.test(fileName)) {
|
|
34
34
|
const replacedFilename = fileName.replace(this.dirToFlattenRegex, '');
|
|
35
35
|
result.filesInFlattenedDir.push({ fileName, replacedFilename });
|
package/dist/cli-copy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { program as commander } from 'commander';
|
|
2
3
|
import fs from 'node:fs/promises';
|
|
3
4
|
import path from 'node:path';
|
|
4
|
-
import { program as commander } from 'commander';
|
|
5
5
|
import { copyJson } from './copyJson.js';
|
|
6
6
|
const __dirname = import.meta.dirname;
|
|
7
7
|
const packageJsonPath = path.join(__dirname, '../package.json');
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { program as commander } from 'commander';
|
|
2
3
|
import fs from 'node:fs/promises';
|
|
3
4
|
import path from 'node:path';
|
|
4
|
-
import { program as commander } from 'commander';
|
|
5
5
|
import { PublishFlat } from './PublishFlat.js';
|
|
6
6
|
const __dirname = import.meta.dirname;
|
|
7
7
|
const packageJsonPath = path.join(__dirname, '../package.json');
|
package/dist/copyJson.d.ts
CHANGED
package/dist/copyJson.js
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
async function checkFile(filePath) {
|
|
4
|
-
try {
|
|
5
|
-
await fs.access(filePath, fs.constants.F_OK | fs.constants.R_OK);
|
|
6
|
-
}
|
|
7
|
-
catch (_a) {
|
|
8
|
-
throw new Error(`Input file "${filePath} doesn't exist or is not readable.`);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
3
|
export async function copyJson(inputFile, outputFile, values) {
|
|
12
4
|
if (!values.length) {
|
|
13
5
|
return;
|
|
@@ -36,3 +28,11 @@ export async function copyJson(inputFile, outputFile, values) {
|
|
|
36
28
|
}
|
|
37
29
|
await fs.writeFile(outputResolved, JSON.stringify(newJSON, null, spaces));
|
|
38
30
|
}
|
|
31
|
+
async function checkFile(filePath) {
|
|
32
|
+
try {
|
|
33
|
+
await fs.access(filePath, fs.constants.F_OK | fs.constants.R_OK);
|
|
34
|
+
}
|
|
35
|
+
catch (_a) {
|
|
36
|
+
throw new Error(`Input file "${filePath} doesn't exist or is not readable.`);
|
|
37
|
+
}
|
|
38
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
"publish-flat-copy": "dist/cli-copy.js"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@npmcli/arborist": "9.1.
|
|
9
|
-
"commander": "14.0.
|
|
8
|
+
"@npmcli/arborist": "9.1.10",
|
|
9
|
+
"commander": "14.0.3",
|
|
10
10
|
"logdown": "3.3.1",
|
|
11
11
|
"npm-packlist": "10.0.3"
|
|
12
12
|
},
|
|
13
13
|
"description": "Publish your project without the dist directory",
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@types/npm-packlist": "7.0.3",
|
|
16
|
-
"@types/npmcli__arborist": "6.3.
|
|
16
|
+
"@types/npmcli__arborist": "6.3.2",
|
|
17
17
|
"rimraf": "6.1.2",
|
|
18
18
|
"tsx": "4.21.0",
|
|
19
19
|
"typescript": "5.9.3"
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"start": "tsx src/cli.ts"
|
|
41
41
|
},
|
|
42
42
|
"type": "module",
|
|
43
|
-
"version": "1.18.
|
|
44
|
-
"gitHead": "
|
|
43
|
+
"version": "1.18.3",
|
|
44
|
+
"gitHead": "7a18174f4c706e506e8b3aed50a49d54b795206b"
|
|
45
45
|
}
|