jizy-packer 2.1.19 → 2.1.21

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.
@@ -0,0 +1,6 @@
1
+ build/*
2
+ node_modules/
3
+ composer.lock
4
+ package-lock.json
5
+ test/
6
+ vendor/
@@ -0,0 +1,7 @@
1
+ cli/
2
+ node_modules/
3
+ src/
4
+ vendor/
5
+ composer.json
6
+ composer.lock
7
+ package-lock.json
@@ -4,9 +4,9 @@
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "JDZ",
7
- "%MODULE_NAME"
7
+ "%MODULE_NAME%"
8
8
  ],
9
- "homepage": "https://jdz.joffreydemetz.com/%MODULE_ALIAS%",
9
+ "homepage": "https://jdz.joffreydemetz.com/%MODULE_ALIAS%/",
10
10
  "license": "MIT",
11
11
  "authors": [
12
12
  {
@@ -27,7 +27,7 @@
27
27
  "license": "MIT",
28
28
  "description": "",
29
29
  "dependencies": {
30
- "jizy-packer": "^2.1",
30
+ "jizy-packer": "^2.1.0",
31
31
  "less": "^4.4.1"
32
32
  }
33
33
  }
package/cli/init.js CHANGED
@@ -5,28 +5,29 @@ import { fileURLToPath } from "url";
5
5
 
6
6
  async function copyAndReplace(srcDir, destDir, replacements) {
7
7
  const entries = fs.readdirSync(srcDir, { withFileTypes: true });
8
+ console.table(entries);
8
9
  for (const entry of entries) {
9
10
  const srcPath = path.join(srcDir, entry.name);
10
11
  const destName = entry.name.replace(/\.skel$/, "");
11
12
  const destPath = path.join(destDir, destName);
12
13
 
14
+ if (entry.isDirectory()) {
15
+ if (!fs.existsSync(destPath)) fs.mkdirSync(destPath);
16
+ await copyAndReplace(srcPath, destPath, replacements);
17
+ continue;
18
+ }
19
+
13
20
  if (fs.existsSync(destPath)) {
14
- if (entry.name === 'package.json') {
15
- // read json file and check if the name of the package is set
16
- const pkg = JSON.parse(fs.readFileSync(srcPath, "utf8"));
17
- if (pkg.name) {
18
- continue; // skip existing package.json with name set
19
- }
20
- }
21
- else {
21
+ const filename = path.basename(destPath);
22
+ if (filename !== 'package.json') {
22
23
  continue; // Skip existing files & folders
23
24
  }
24
- }
25
25
 
26
- if (entry.isDirectory()) {
27
- if (!fs.existsSync(destPath)) fs.mkdirSync(destPath);
28
- await copyAndReplace(srcPath, destPath, replacements);
29
- return;
26
+ // read json file and check if the name of the package is set
27
+ const pkg = JSON.parse(fs.readFileSync(srcPath, "utf8"));
28
+ if (pkg.name) {
29
+ continue; // skip existing package.json with name set
30
+ }
30
31
  }
31
32
 
32
33
  let content = fs.readFileSync(srcPath, "utf8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jizy-packer",
3
- "version": "2.1.19",
3
+ "version": "2.1.21",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "_example",