create-berna-stencil 1.0.30 → 1.0.32

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/bin/create.js CHANGED
@@ -2,32 +2,28 @@
2
2
 
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
- const { writeSync } = require('fs');
6
5
 
7
6
  const targetDir = process.argv[2] ? path.resolve(process.argv[2]) : process.cwd();
8
7
  const templateDir = path.join(__dirname, '..');
9
8
 
10
- // I file e le cartelle da copiare. Notare 'gitignore' senza il punto.
11
9
  const COPY_TARGETS = [
12
10
  'src',
13
11
  '_tools',
14
12
  '.eleventy.js',
15
13
  '.eleventyignore',
16
- 'gitignore',
17
- 'README.md',
18
14
  ];
19
15
 
20
16
  const PROJECT_PACKAGE = {
21
17
  name: path.basename(targetDir),
22
- version: '1.0.30',
18
+ version: '1.0.32',
23
19
  private: true,
24
20
  scripts: {
25
- "build:css": "sass src/scss:c:/laragon/www/Berna-Stencil-out/css --no-source-map --style=compressed --quiet",
26
- "build:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=c:/laragon/www/Berna-Stencil-out/js/pages --minify",
21
+ "build:css": "sass src/scss:out/css --no-source-map --style=compressed --quiet",
22
+ "build:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=out/js/pages --minify",
27
23
  "build:11ty": "eleventy",
28
24
  "build": "npm run build:css && npm run build:js && npm run build:11ty",
29
- "serve:css": "sass --watch src/scss:c:/laragon/www/Berna-Stencil-out/css --no-source-map --quiet",
30
- "serve:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=c:/laragon/www/Berna-Stencil-out/js/pages --watch",
25
+ "serve:css": "sass --watch src/scss:out/css --no-source-map --quiet",
26
+ "serve:js": "esbuild \"src/js/pages/*.js\" --bundle --outdir=out/js/pages --watch",
31
27
  "serve:11ty": "eleventy --serve --quiet",
32
28
  "clean": "node _tools/cleanOutput.js",
33
29
  "serve": "npm run clean && concurrently \"npm run serve:11ty\" \"npm run serve:css\" \"npm run serve:js\"",
@@ -51,6 +47,15 @@ const PROJECT_PACKAGE = {
51
47
  },
52
48
  };
53
49
 
50
+ const GITIGNORE_CONTENT = `node_modules/
51
+ node_modules/
52
+ src/api/core/vendor/
53
+ out/
54
+ src/api/config.php
55
+ `;
56
+
57
+ const { writeSync } = require('fs');
58
+
54
59
  function log(msg) {
55
60
  writeSync(1, msg + '\n');
56
61
  }
@@ -68,14 +73,12 @@ function copyRecursive(src, dest) {
68
73
  }
69
74
  }
70
75
 
71
- // 1. Crea la cartella di destinazione se non esiste
72
76
  if (!fs.existsSync(targetDir)) {
73
77
  fs.mkdirSync(targetDir, { recursive: true });
74
78
  }
75
79
 
76
80
  log(`\n>> Creating berna-stencil project in ${targetDir}\n`);
77
81
 
78
- // 2. Copia tutti i file e le cartelle specificati in COPY_TARGETS
79
82
  for (const target of COPY_TARGETS) {
80
83
  const src = path.join(templateDir, target);
81
84
  const dest = path.join(targetDir, target);
@@ -85,27 +88,22 @@ for (const target of COPY_TARGETS) {
85
88
  }
86
89
  }
87
90
 
88
- // 3. Rinomina gitignore in .gitignore nella cartella di destinazione
89
- const gitignoreSrc = path.join(targetDir, 'gitignore');
90
- const gitignoreDest = path.join(targetDir, '.gitignore');
91
-
92
- if (fs.existsSync(gitignoreSrc)) {
93
- fs.renameSync(gitignoreSrc, gitignoreDest);
94
- log('~ Rinominato gitignore in .gitignore');
95
- }
96
-
97
- // 4. Genera e scrivi il file package.json
98
91
  fs.writeFileSync(
99
92
  path.join(targetDir, 'package.json'),
100
93
  JSON.stringify(PROJECT_PACKAGE, null, 2)
101
94
  );
102
95
  log('+ package.json');
103
96
 
104
- // 5. Mostra i messaggi finali all'utente
97
+ fs.writeFileSync(
98
+ path.join(targetDir, '.gitignore'),
99
+ GITIGNORE_CONTENT
100
+ );
101
+ log('+ .gitignore');
102
+
105
103
  log(`\n>> Done! Now run:\n`);
106
104
  if (process.argv[2]) {
107
105
  log(`cd ${process.argv[2]}`);
108
106
  }
109
107
  log('npm install');
110
108
  log('npm run serve\n');
111
- log("Don't forget to check the documentation at https://bernastencil.com\n");
109
+ log("\nDon't forget to check the documentation at https://bernastencil.com");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-berna-stencil",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "Eleventy boilerplate with per-page SCSS/JS pipeline, esbuild bundling, multi-framework CSS support and a built-in page management CLI",
5
5
  "keywords": [
6
6
  "eleventy",
@@ -34,9 +34,7 @@
34
34
  "src/",
35
35
  "_tools/",
36
36
  ".eleventy.js",
37
- ".eleventyignore",
38
- ".gitignore",
39
- "README.md"
37
+ ".eleventyignore"
40
38
  ],
41
39
  "engines": {
42
40
  "node": ">=18.0.0"
package/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- node_modules/
2
- src/api/core/vendor/
3
- out/
4
- src/api/config.php