jiek 2.0.2-alpha.14 → 2.0.2-alpha.15

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.
@@ -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.13";
119
+ var version = "2.0.2-alpha.14";
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.13";
111
+ var version = "2.0.2-alpha.14";
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
@@ -4677,6 +4677,26 @@ async function prepublish() {
4677
4677
  fs__default.default.writeFileSync(resolveByDir(resolvedOutdir, "package.json"), newJSONString);
4678
4678
  fs__default.default.writeFileSync(resolveByDir(jiekTempDir, "package.json"), modifyVersionPackageJSON);
4679
4679
  fs__default.default.writeFileSync(resolveByDir("package.json"), withPublishConfigDirectoryOldJSONString);
4680
+ const allBuildFiles = fs__default.default.readdirSync(resolveByDir(resolvedOutdir), { recursive: true }).filter((file) => typeof file === "string");
4681
+ for (const file of allBuildFiles) {
4682
+ const filepath = resolveByDir(resolvedOutdir, file);
4683
+ const stat = fs__default.default.statSync(filepath);
4684
+ if (stat.isDirectory()) {
4685
+ const existsIndexFile = allBuildFiles.some(
4686
+ (f) => [
4687
+ path__default.default.join(file, "index.js"),
4688
+ path__default.default.join(file, "index.mjs"),
4689
+ path__default.default.join(file, "index.cjs")
4690
+ ].includes(f)
4691
+ );
4692
+ if (existsIndexFile) {
4693
+ fs__default.default.writeFileSync(
4694
+ resolveByDir(resolvedOutdir, file, "package.json"),
4695
+ JSON.stringify({ type: oldJSON["type"] })
4696
+ );
4697
+ }
4698
+ }
4699
+ }
4680
4700
  if (oldJSON.files) {
4681
4701
  if (!Array.isArray(oldJSON.files)) {
4682
4702
  throw new Error(`${dir}/package.json files field must be an array`);
package/cli.js CHANGED
@@ -4647,6 +4647,26 @@ async function prepublish() {
4647
4647
  fs.writeFileSync(resolveByDir(resolvedOutdir, "package.json"), newJSONString);
4648
4648
  fs.writeFileSync(resolveByDir(jiekTempDir, "package.json"), modifyVersionPackageJSON);
4649
4649
  fs.writeFileSync(resolveByDir("package.json"), withPublishConfigDirectoryOldJSONString);
4650
+ const allBuildFiles = fs.readdirSync(resolveByDir(resolvedOutdir), { recursive: true }).filter((file) => typeof file === "string");
4651
+ for (const file of allBuildFiles) {
4652
+ const filepath = resolveByDir(resolvedOutdir, file);
4653
+ const stat = fs.statSync(filepath);
4654
+ if (stat.isDirectory()) {
4655
+ const existsIndexFile = allBuildFiles.some(
4656
+ (f) => [
4657
+ path.join(file, "index.js"),
4658
+ path.join(file, "index.mjs"),
4659
+ path.join(file, "index.cjs")
4660
+ ].includes(f)
4661
+ );
4662
+ if (existsIndexFile) {
4663
+ fs.writeFileSync(
4664
+ resolveByDir(resolvedOutdir, file, "package.json"),
4665
+ JSON.stringify({ type: oldJSON["type"] })
4666
+ );
4667
+ }
4668
+ }
4669
+ }
4650
4670
  if (oldJSON.files) {
4651
4671
  if (!Array.isArray(oldJSON.files)) {
4652
4672
  throw new Error(`${dir}/package.json files field must be an array`);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jiek",
3
3
  "type": "module",
4
- "version": "2.0.2-alpha.14",
4
+ "version": "2.0.2-alpha.15",
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": {
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -298,6 +298,30 @@ async function prepublish() {
298
298
  fs.writeFileSync(resolveByDir(jiekTempDir, 'package.json'), modifyVersionPackageJSON)
299
299
  fs.writeFileSync(resolveByDir('package.json'), withPublishConfigDirectoryOldJSONString)
300
300
 
301
+ const allBuildFiles = fs
302
+ .readdirSync(resolveByDir(resolvedOutdir), { recursive: true })
303
+ .filter(file => typeof file === 'string')
304
+ for (const file of allBuildFiles) {
305
+ const filepath = resolveByDir(resolvedOutdir, file)
306
+ const stat = fs.statSync(filepath)
307
+ if (stat.isDirectory()) {
308
+ const existsIndexFile = allBuildFiles
309
+ .some(f =>
310
+ [
311
+ path.join(file, 'index.js'),
312
+ path.join(file, 'index.mjs'),
313
+ path.join(file, 'index.cjs')
314
+ ].includes(f)
315
+ )
316
+ if (existsIndexFile) {
317
+ fs.writeFileSync(
318
+ resolveByDir(resolvedOutdir, file, 'package.json'),
319
+ JSON.stringify({ type: oldJSON['type'] })
320
+ )
321
+ }
322
+ }
323
+ }
324
+
301
325
  if (oldJSON.files) {
302
326
  if (!Array.isArray(oldJSON.files)) {
303
327
  throw new Error(`${dir}/package.json files field must be an array`)