create-tateru-cli 0.1.0 → 0.3.0

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.
Files changed (38) hide show
  1. package/README.md +5 -0
  2. package/lib/index.js +21 -3
  3. package/package.json +3 -2
  4. package/templates/template-gulp-vanilla/.editorconfig +1 -1
  5. package/templates/template-gulp-vanilla/.prettierrc +4 -0
  6. package/templates/template-gulp-vanilla/.vscode/launch.json +10 -0
  7. package/templates/template-gulp-vanilla/.vscode/settings.json +3 -0
  8. package/templates/template-gulp-vanilla/README.md +57 -1
  9. package/templates/template-gulp-vanilla/_gitignore +3 -0
  10. package/templates/template-gulp-vanilla/package-lock.json +6143 -6178
  11. package/templates/template-gulp-vanilla/package.json +18 -29
  12. package/templates/template-gulp-vanilla/public/assets/favicon/apple-touch-icon.png +0 -0
  13. package/templates/template-gulp-vanilla/public/assets/favicon/favicon-96x96.png +0 -0
  14. package/templates/template-gulp-vanilla/public/assets/favicon/favicon.ico +0 -0
  15. package/templates/template-gulp-vanilla/public/assets/favicon/favicon.svg +9 -0
  16. package/templates/template-gulp-vanilla/public/assets/favicon/web-app-manifest-192x192.png +0 -0
  17. package/templates/template-gulp-vanilla/public/assets/favicon/web-app-manifest-512x512.png +0 -0
  18. package/templates/template-gulp-vanilla/src/assets/css/main.css +4 -0
  19. package/templates/template-gulp-vanilla/src/assets/css/src/core.css +57 -0
  20. package/templates/template-gulp-vanilla/src/assets/css/src/variables.css +18 -0
  21. package/templates/template-gulp-vanilla/src/assets/images/share/homepage.png +0 -0
  22. package/templates/template-gulp-vanilla/src/twig/layouts/layout.html.twig +5 -5
  23. package/templates/template-gulp-vanilla/src/twig/views/site.webmanifest.twig +2 -2
  24. package/templates/template-gulp-vanilla/tasks/css.js +3 -5
  25. package/templates/template-gulp-vanilla/tasks/images.js +1 -0
  26. package/templates/template-gulp-vanilla/tasks/public-assets.js +1 -0
  27. package/templates/template-gulp-vanilla/tasks/tateru.js +18 -21
  28. package/templates/template-gulp-vanilla/tasks/watch.js +1 -1
  29. package/templates/template-gulp-vanilla/tateru.config.json +5 -3
  30. package/templates/template-gulp-vanilla/public/assets/favicon/android-chrome-192x192.png +0 -0
  31. package/templates/template-gulp-vanilla/public/assets/favicon/android-chrome-512x512.png +0 -0
  32. package/templates/template-gulp-vanilla/public/assets/favicon/favicon-16x16.png +0 -0
  33. package/templates/template-gulp-vanilla/public/assets/favicon/favicon-32x32.png +0 -0
  34. package/templates/template-gulp-vanilla/src/assets/scss/main.scss +0 -6
  35. package/templates/template-gulp-vanilla/src/assets/scss/src/_core.scss +0 -63
  36. package/templates/template-gulp-vanilla/src/assets/scss/src/_functions.scss +0 -21
  37. package/templates/template-gulp-vanilla/src/assets/scss/src/_mixins.scss +0 -1
  38. package/templates/template-gulp-vanilla/src/assets/scss/src/_variables.scss +0 -13
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Create Tateru CLI project
2
2
 
3
+ [![NPM Version](https://img.shields.io/npm/v/create-tateru-cli)](https://www.npmjs.com/package/create-tateru-cli)
4
+ [![GitHub Release](https://img.shields.io/github/v/release/danielsitek/tateru-create-tateru-cli)](https://github.com/danielsitek/tateru-create-tateru-cli/releases)
5
+ [![Codacy Badge](https://app.codacy.com/project/badge/Grade/5b3efe68fa4d4b69b2bd00c9436954cb)](https://app.codacy.com/gh/danielsitek/tateru-create-tateru-cli/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
6
+
3
7
  Simplest way to create a new project using [tateru-cli](https://github.com/danielsitek/tateru-cli).
4
8
 
5
9
  ## Usage
@@ -28,3 +32,4 @@ Currently supported templates include:
28
32
 
29
33
  - If the destination directory is not empty, the script will exit with an error.
30
34
  - Ensure the template name is valid; otherwise, the script will notify you.
35
+ - Templates should use `_gitignore` instead of `.gitignore`. The script will automatically rename `_gitignore` to `.gitignore` during the copy process.
package/lib/index.js CHANGED
@@ -16,8 +16,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
16
16
  const node_path_1 = __importDefault(require("node:path"));
17
17
  const promises_1 = require("node:fs/promises");
18
18
  const node_fs_1 = require("node:fs");
19
- const cli_1 = require("./cli/cli");
20
19
  const promises_2 = __importDefault(require("node:readline/promises"));
20
+ const cli_1 = require("./cli/cli");
21
+ const renameFiles = {
22
+ _gitignore: '.gitignore',
23
+ };
21
24
  const getTemplatePath = (template) => {
22
25
  return node_path_1.default.resolve(__dirname, '..', 'templates', `template-${template}`);
23
26
  };
@@ -51,9 +54,24 @@ const ensureDirectoryEmpty = (directory) => __awaiter(void 0, void 0, void 0, fu
51
54
  yield (0, promises_1.mkdir)(directory, { recursive: true });
52
55
  }
53
56
  });
57
+ const copyTemplateFiltered = (src, dest) => __awaiter(void 0, void 0, void 0, function* () {
58
+ const stats = yield (0, promises_1.stat)(src);
59
+ if (stats.isDirectory()) {
60
+ yield (0, promises_1.mkdir)(dest, { recursive: true });
61
+ const entries = yield (0, promises_1.readdir)(src);
62
+ for (const entry of entries) {
63
+ const srcPath = node_path_1.default.join(src, entry);
64
+ const destPath = node_path_1.default.join(dest, renameFiles[entry] || entry);
65
+ yield copyTemplateFiltered(srcPath, destPath);
66
+ }
67
+ }
68
+ else {
69
+ yield (0, promises_1.copyFile)(src, dest);
70
+ }
71
+ });
54
72
  const copyTemplate = (templatePath, destinationPath) => __awaiter(void 0, void 0, void 0, function* () {
55
73
  try {
56
- yield (0, promises_1.cp)(templatePath, destinationPath, { recursive: true });
74
+ yield copyTemplateFiltered(templatePath, destinationPath);
57
75
  }
58
76
  catch (error) {
59
77
  throw new Error([
@@ -73,7 +91,7 @@ Done. Template successfully copied. Now run:
73
91
 
74
92
  cd ${directory}
75
93
  npm install
76
- npm start
94
+ npm run dev
77
95
  `;
78
96
  };
79
97
  const init = () => __awaiter(void 0, void 0, void 0, function* () {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-tateru-cli",
3
3
  "description": "Create basic Tateru CLI project from template files",
4
- "version": "0.1.0",
4
+ "version": "0.3.0",
5
5
  "bin": {
6
6
  "create-tateru-cli": "./lib/index.js"
7
7
  },
@@ -13,8 +13,9 @@
13
13
  "scripts": {
14
14
  "build": "tsc",
15
15
  "clean": "rm -rf lib",
16
+ "clean:templates": "rm -rf templates/**/node_modules && rm -rf templates/**/dist",
16
17
  "typecheck": "tsc --noEmit",
17
- "prepack": "npm run clean && npm run build"
18
+ "prepack": "npm run clean && npm run clean:templates && npm run build"
18
19
  },
19
20
  "keywords": [
20
21
  "tateru-cli",
@@ -9,7 +9,7 @@ indent_style = space
9
9
  trim_trailing_whitespace = true
10
10
  insert_final_newline = true
11
11
 
12
- [*.{js,jsx,ts,tsx,vue}]
12
+ [*.{js,jsx,ts,tsx,vue,mjs}]
13
13
  indent_size = 2
14
14
  quote_type = single
15
15
 
@@ -0,0 +1,4 @@
1
+ {
2
+ "tabWidth": 2,
3
+ "useTabs": false
4
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "configurations": [
3
+ {
4
+ "name": "Tateru-CLI: watch",
5
+ "type": "chrome",
6
+ "request": "launch",
7
+ "url": "http://localhost:3000"
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "cSpell.words": ["tateru"]
3
+ }
@@ -1 +1,57 @@
1
- # tateru-starter
1
+ # tateru-cli-gulp-vanilla
2
+
3
+ Basic template for static site generation using Tateru CLI.
4
+
5
+ ## Usage
6
+
7
+ ### 1. Install dependencies:
8
+
9
+ ```sh
10
+ npm install
11
+ ```
12
+
13
+ ### 2. Start development:
14
+
15
+ ```sh
16
+ npm run dev
17
+ ```
18
+
19
+ ### 3. Build for production:
20
+
21
+ ```sh
22
+ npm run build:prod
23
+ ```
24
+
25
+ ## Development
26
+
27
+ ### Commands
28
+
29
+ ```sh
30
+ npm run dev
31
+ ```
32
+
33
+ Starts the development environment with file watching and live reload.
34
+
35
+ ```sh
36
+ npm run build
37
+ ```
38
+
39
+ Builds the project for development.
40
+
41
+ ```sh
42
+ npm run build:prod
43
+ ```
44
+
45
+ Builds the project for production with optimizations.
46
+
47
+ ```sh
48
+ npm run lint
49
+ ```
50
+
51
+ Runs ESLint to check and fix code style issues.
52
+
53
+ ```sh
54
+ npm run clean:dist
55
+ ```
56
+
57
+ Cleans the `dist/` folder by removing all its contents.
@@ -0,0 +1,3 @@
1
+ node_modules
2
+
3
+ dist/