jiek 2.0.2-alpha.7 → 2.0.2-alpha.9
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/cli-only-build.cjs +1 -1
- package/cli-only-build.js +1 -1
- package/cli.cjs +29 -2
- package/cli.js +29 -2
- package/package.json +1 -1
package/cli-only-build.cjs
CHANGED
@@ -116,7 +116,7 @@ async function getSelectedProjectsGraph(filter = commander.program.getOptionValu
|
|
116
116
|
|
117
117
|
var name = "jiek";
|
118
118
|
var type = "module";
|
119
|
-
var version = "2.0.2-alpha.
|
119
|
+
var version = "2.0.2-alpha.8";
|
120
120
|
var description$1 = "A lightweight toolkit for compiling and managing libraries based on `package.json` metadata and suitable for `Monorepo`.";
|
121
121
|
var author = "YiJie <yijie4188@gmail.com>";
|
122
122
|
var repository = {
|
package/cli-only-build.js
CHANGED
@@ -108,7 +108,7 @@ async function getSelectedProjectsGraph(filter = program.getOptionValue("filter"
|
|
108
108
|
|
109
109
|
var name = "jiek";
|
110
110
|
var type = "module";
|
111
|
-
var version = "2.0.2-alpha.
|
111
|
+
var version = "2.0.2-alpha.8";
|
112
112
|
var description$1 = "A lightweight toolkit for compiling and managing libraries based on `package.json` metadata and suitable for `Monorepo`.";
|
113
113
|
var author = "YiJie <yijie4188@gmail.com>";
|
114
114
|
var repository = {
|
package/cli.cjs
CHANGED
@@ -4667,6 +4667,34 @@ async function prepublish() {
|
|
4667
4667
|
modifyVersionPackageJSON,
|
4668
4668
|
jsoncParser.modify(modifyVersionPackageJSON, ["publishConfig", "directory"], resolvedOutdir, { formattingOptions })
|
4669
4669
|
);
|
4670
|
+
if (oldJSON.files) {
|
4671
|
+
if (!Array.isArray(oldJSON.files)) {
|
4672
|
+
throw new Error(`${dir}/package.json files field must be an array`);
|
4673
|
+
}
|
4674
|
+
if (Array.isArray(oldJSON.files) && oldJSON.files.every((file) => typeof file !== "string")) {
|
4675
|
+
throw new Error(`${dir}/package.json files field must be an array of string`);
|
4676
|
+
}
|
4677
|
+
}
|
4678
|
+
console.log({ resolvedOutdir });
|
4679
|
+
const files = oldJSON.files ?? fs__default.default.readdirSync(resolveByDir(".")).filter((file) => file !== "node_modules" && file !== resolvedOutdir);
|
4680
|
+
for (const file of files) {
|
4681
|
+
const path2 = resolveByDir(file);
|
4682
|
+
try {
|
4683
|
+
const stat = fs__default.default.statSync(path2);
|
4684
|
+
if (stat.isDirectory()) {
|
4685
|
+
fs__default.default.symlinkSync(path2, resolveByDir(resolvedOutdir, file), "dir");
|
4686
|
+
continue;
|
4687
|
+
}
|
4688
|
+
if (stat.isFile()) {
|
4689
|
+
fs__default.default.symlinkSync(path2, resolveByDir(resolvedOutdir, file), "file");
|
4690
|
+
continue;
|
4691
|
+
}
|
4692
|
+
} catch (e) {
|
4693
|
+
console.warn(String(e));
|
4694
|
+
continue;
|
4695
|
+
}
|
4696
|
+
throw new Error(`file type of ${path2} is not supported`);
|
4697
|
+
}
|
4670
4698
|
if (!fs__default.default.existsSync(resolveByDir(resolvedOutdir))) {
|
4671
4699
|
fs__default.default.mkdirSync(resolveByDir(resolvedOutdir));
|
4672
4700
|
}
|
@@ -4687,8 +4715,7 @@ async function postpublish() {
|
|
4687
4715
|
if (fs__default.default.existsSync(jiekTempPackageJSON)) {
|
4688
4716
|
fs__default.default.copyFileSync(jiekTempPackageJSON, packageJSON);
|
4689
4717
|
fs__default.default.rmSync(jiekTempPackageJSON);
|
4690
|
-
console.log(`
|
4691
|
-
${dir}/package.json has been restored`);
|
4718
|
+
console.log(`${dir}/package.json has been restored`);
|
4692
4719
|
} else {
|
4693
4720
|
throw new Error(
|
4694
4721
|
`jiek temp \`${dir}/package.json\` not found, please confirm the jiek pre-publish command has been executed`
|
package/cli.js
CHANGED
@@ -4637,6 +4637,34 @@ async function prepublish() {
|
|
4637
4637
|
modifyVersionPackageJSON,
|
4638
4638
|
modify(modifyVersionPackageJSON, ["publishConfig", "directory"], resolvedOutdir, { formattingOptions })
|
4639
4639
|
);
|
4640
|
+
if (oldJSON.files) {
|
4641
|
+
if (!Array.isArray(oldJSON.files)) {
|
4642
|
+
throw new Error(`${dir}/package.json files field must be an array`);
|
4643
|
+
}
|
4644
|
+
if (Array.isArray(oldJSON.files) && oldJSON.files.every((file) => typeof file !== "string")) {
|
4645
|
+
throw new Error(`${dir}/package.json files field must be an array of string`);
|
4646
|
+
}
|
4647
|
+
}
|
4648
|
+
console.log({ resolvedOutdir });
|
4649
|
+
const files = oldJSON.files ?? fs.readdirSync(resolveByDir(".")).filter((file) => file !== "node_modules" && file !== resolvedOutdir);
|
4650
|
+
for (const file of files) {
|
4651
|
+
const path2 = resolveByDir(file);
|
4652
|
+
try {
|
4653
|
+
const stat = fs.statSync(path2);
|
4654
|
+
if (stat.isDirectory()) {
|
4655
|
+
fs.symlinkSync(path2, resolveByDir(resolvedOutdir, file), "dir");
|
4656
|
+
continue;
|
4657
|
+
}
|
4658
|
+
if (stat.isFile()) {
|
4659
|
+
fs.symlinkSync(path2, resolveByDir(resolvedOutdir, file), "file");
|
4660
|
+
continue;
|
4661
|
+
}
|
4662
|
+
} catch (e) {
|
4663
|
+
console.warn(String(e));
|
4664
|
+
continue;
|
4665
|
+
}
|
4666
|
+
throw new Error(`file type of ${path2} is not supported`);
|
4667
|
+
}
|
4640
4668
|
if (!fs.existsSync(resolveByDir(resolvedOutdir))) {
|
4641
4669
|
fs.mkdirSync(resolveByDir(resolvedOutdir));
|
4642
4670
|
}
|
@@ -4657,8 +4685,7 @@ async function postpublish() {
|
|
4657
4685
|
if (fs.existsSync(jiekTempPackageJSON)) {
|
4658
4686
|
fs.copyFileSync(jiekTempPackageJSON, packageJSON);
|
4659
4687
|
fs.rmSync(jiekTempPackageJSON);
|
4660
|
-
console.log(`
|
4661
|
-
${dir}/package.json has been restored`);
|
4688
|
+
console.log(`${dir}/package.json has been restored`);
|
4662
4689
|
} else {
|
4663
4690
|
throw new Error(
|
4664
4691
|
`jiek temp \`${dir}/package.json\` not found, please confirm the jiek pre-publish command has been executed`
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "jiek",
|
3
3
|
"type": "module",
|
4
|
-
"version": "2.0.2-alpha.
|
4
|
+
"version": "2.0.2-alpha.9",
|
5
5
|
"description": "A lightweight toolkit for compiling and managing libraries based on `package.json` metadata and suitable for `Monorepo`.",
|
6
6
|
"author": "YiJie <yijie4188@gmail.com>",
|
7
7
|
"repository": {
|