smartbundle 0.4.0-alpha.0 → 0.4.0-alpha.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/__do_not_import_directly__/copyStaticFiles.cjs +0 -3
- package/__do_not_import_directly__/copyStaticFiles.js +0 -3
- package/__do_not_import_directly__/index.cjs +2 -8
- package/__do_not_import_directly__/index.js +2 -8
- package/__do_not_import_directly__/writePackageJson.cjs +1 -4
- package/__do_not_import_directly__/writePackageJson.js +1 -4
- package/package.json +1 -2
- package/src/copyStaticFiles.d.ts +1 -1
@@ -7,7 +7,6 @@ async function copyStaticFiles({
|
|
7
7
|
outDir,
|
8
8
|
relativeFiles
|
9
9
|
}) {
|
10
|
-
const copiedFiles = new Array();
|
11
10
|
const dirFiles = new Map(
|
12
11
|
(await fs.readdir(sourceDir, { recursive: true })).map(
|
13
12
|
(f) => [f.toLowerCase(), f]
|
@@ -20,11 +19,9 @@ async function copyStaticFiles({
|
|
20
19
|
const outFilePath = path.join(outDir, matchingFile);
|
21
20
|
const filePath = path.join(sourceDir, matchingFile);
|
22
21
|
await fs.copyFile(filePath, outFilePath);
|
23
|
-
copiedFiles.push(matchingFile);
|
24
22
|
}
|
25
23
|
} catch {
|
26
24
|
}
|
27
25
|
}
|
28
|
-
return copiedFiles;
|
29
26
|
}
|
30
27
|
exports.copyStaticFiles = copyStaticFiles;
|
@@ -5,7 +5,6 @@ async function copyStaticFiles({
|
|
5
5
|
outDir,
|
6
6
|
relativeFiles
|
7
7
|
}) {
|
8
|
-
const copiedFiles = new Array();
|
9
8
|
const dirFiles = new Map(
|
10
9
|
(await readdir(sourceDir, { recursive: true })).map(
|
11
10
|
(f) => [f.toLowerCase(), f]
|
@@ -18,12 +17,10 @@ async function copyStaticFiles({
|
|
18
17
|
const outFilePath = join(outDir, matchingFile);
|
19
18
|
const filePath = join(sourceDir, matchingFile);
|
20
19
|
await copyFile(filePath, outFilePath);
|
21
|
-
copiedFiles.push(matchingFile);
|
22
20
|
}
|
23
21
|
} catch {
|
24
22
|
}
|
25
23
|
}
|
26
|
-
return copiedFiles;
|
27
24
|
}
|
28
25
|
export {
|
29
26
|
copyStaticFiles
|
@@ -128,17 +128,11 @@ async function run(args) {
|
|
128
128
|
});
|
129
129
|
}
|
130
130
|
}
|
131
|
-
|
132
|
-
relativeFiles: /* @__PURE__ */ new Set(["readme.md"
|
131
|
+
await copyStaticFiles.copyStaticFiles({
|
132
|
+
relativeFiles: /* @__PURE__ */ new Set(["readme.md"]),
|
133
133
|
sourceDir,
|
134
134
|
outDir
|
135
135
|
});
|
136
|
-
for (const copiedFile of copiedFiles) {
|
137
|
-
setExports(exportsMap, "./" + copiedFile, (entry) => {
|
138
|
-
entry.raw = "./" + copiedFile;
|
139
|
-
return entry;
|
140
|
-
});
|
141
|
-
}
|
142
136
|
await writePackageJson.writePackageJson(outDir, packageJson$1, {
|
143
137
|
exportsMap
|
144
138
|
});
|
@@ -104,17 +104,11 @@ async function run(args) {
|
|
104
104
|
});
|
105
105
|
}
|
106
106
|
}
|
107
|
-
|
108
|
-
relativeFiles: /* @__PURE__ */ new Set(["readme.md"
|
107
|
+
await copyStaticFiles({
|
108
|
+
relativeFiles: /* @__PURE__ */ new Set(["readme.md"]),
|
109
109
|
sourceDir,
|
110
110
|
outDir
|
111
111
|
});
|
112
|
-
for (const copiedFile of copiedFiles) {
|
113
|
-
setExports(exportsMap, "./" + copiedFile, (entry) => {
|
114
|
-
entry.raw = "./" + copiedFile;
|
115
|
-
return entry;
|
116
|
-
});
|
117
|
-
}
|
118
112
|
await writePackageJson(outDir, packageJson, {
|
119
113
|
exportsMap
|
120
114
|
});
|
@@ -8,10 +8,6 @@ async function writePackageJson(outDir, parsed, { exportsMap }) {
|
|
8
8
|
if (key === "__bin__") {
|
9
9
|
continue;
|
10
10
|
}
|
11
|
-
if (value.raw) {
|
12
|
-
allExports[key] = value.raw;
|
13
|
-
continue;
|
14
|
-
}
|
15
11
|
const anExport = {};
|
16
12
|
if (value.dts) {
|
17
13
|
anExport.types = value.dts;
|
@@ -33,6 +29,7 @@ async function writePackageJson(outDir, parsed, { exportsMap }) {
|
|
33
29
|
anExport.default = value.mjs;
|
34
30
|
allExports[key] = anExport;
|
35
31
|
}
|
32
|
+
allExports["./package.json"] = "./package.json";
|
36
33
|
const rootExport = typeof allExports["."] === "object" ? allExports["."] : void 0;
|
37
34
|
const res = {
|
38
35
|
name: parsed.name,
|
@@ -6,10 +6,6 @@ async function writePackageJson(outDir, parsed, { exportsMap }) {
|
|
6
6
|
if (key === "__bin__") {
|
7
7
|
continue;
|
8
8
|
}
|
9
|
-
if (value.raw) {
|
10
|
-
allExports[key] = value.raw;
|
11
|
-
continue;
|
12
|
-
}
|
13
9
|
const anExport = {};
|
14
10
|
if (value.dts) {
|
15
11
|
anExport.types = value.dts;
|
@@ -31,6 +27,7 @@ async function writePackageJson(outDir, parsed, { exportsMap }) {
|
|
31
27
|
anExport.default = value.mjs;
|
32
28
|
allExports[key] = anExport;
|
33
29
|
}
|
30
|
+
allExports["./package.json"] = "./package.json";
|
34
31
|
const rootExport = typeof allExports["."] === "object" ? allExports["."] : void 0;
|
35
32
|
const res = {
|
36
33
|
name: parsed.name,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "smartbundle",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.4.0-alpha.
|
4
|
+
"version": "0.4.0-alpha.1",
|
5
5
|
"bin": "./src/bin.js",
|
6
6
|
"types": "./src/run.d.ts",
|
7
7
|
"module": "./src/run.js",
|
@@ -19,7 +19,6 @@
|
|
19
19
|
},
|
20
20
|
"default": "./src/run.js"
|
21
21
|
},
|
22
|
-
"./README.md": "./README.md",
|
23
22
|
"./package.json": "./package.json"
|
24
23
|
},
|
25
24
|
"dependencies": {
|
package/src/copyStaticFiles.d.ts
CHANGED
@@ -3,5 +3,5 @@ type CopyStaticFilesOptions = {
|
|
3
3
|
sourceDir: string;
|
4
4
|
outDir: string;
|
5
5
|
};
|
6
|
-
export declare function copyStaticFiles({ sourceDir, outDir, relativeFiles, }: CopyStaticFilesOptions): Promise<
|
6
|
+
export declare function copyStaticFiles({ sourceDir, outDir, relativeFiles, }: CopyStaticFilesOptions): Promise<void>;
|
7
7
|
export {};
|