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.
- package/README.md +5 -0
- package/lib/index.js +21 -3
- package/package.json +3 -2
- package/templates/template-gulp-vanilla/.editorconfig +1 -1
- package/templates/template-gulp-vanilla/.prettierrc +4 -0
- package/templates/template-gulp-vanilla/.vscode/launch.json +10 -0
- package/templates/template-gulp-vanilla/.vscode/settings.json +3 -0
- package/templates/template-gulp-vanilla/README.md +57 -1
- package/templates/template-gulp-vanilla/_gitignore +3 -0
- package/templates/template-gulp-vanilla/package-lock.json +6143 -6178
- package/templates/template-gulp-vanilla/package.json +18 -29
- package/templates/template-gulp-vanilla/public/assets/favicon/apple-touch-icon.png +0 -0
- package/templates/template-gulp-vanilla/public/assets/favicon/favicon-96x96.png +0 -0
- package/templates/template-gulp-vanilla/public/assets/favicon/favicon.ico +0 -0
- package/templates/template-gulp-vanilla/public/assets/favicon/favicon.svg +9 -0
- package/templates/template-gulp-vanilla/public/assets/favicon/web-app-manifest-192x192.png +0 -0
- package/templates/template-gulp-vanilla/public/assets/favicon/web-app-manifest-512x512.png +0 -0
- package/templates/template-gulp-vanilla/src/assets/css/main.css +4 -0
- package/templates/template-gulp-vanilla/src/assets/css/src/core.css +57 -0
- package/templates/template-gulp-vanilla/src/assets/css/src/variables.css +18 -0
- package/templates/template-gulp-vanilla/src/assets/images/share/homepage.png +0 -0
- package/templates/template-gulp-vanilla/src/twig/layouts/layout.html.twig +5 -5
- package/templates/template-gulp-vanilla/src/twig/views/site.webmanifest.twig +2 -2
- package/templates/template-gulp-vanilla/tasks/css.js +3 -5
- package/templates/template-gulp-vanilla/tasks/images.js +1 -0
- package/templates/template-gulp-vanilla/tasks/public-assets.js +1 -0
- package/templates/template-gulp-vanilla/tasks/tateru.js +18 -21
- package/templates/template-gulp-vanilla/tasks/watch.js +1 -1
- package/templates/template-gulp-vanilla/tateru.config.json +5 -3
- package/templates/template-gulp-vanilla/public/assets/favicon/android-chrome-192x192.png +0 -0
- package/templates/template-gulp-vanilla/public/assets/favicon/android-chrome-512x512.png +0 -0
- package/templates/template-gulp-vanilla/public/assets/favicon/favicon-16x16.png +0 -0
- package/templates/template-gulp-vanilla/public/assets/favicon/favicon-32x32.png +0 -0
- package/templates/template-gulp-vanilla/src/assets/scss/main.scss +0 -6
- package/templates/template-gulp-vanilla/src/assets/scss/src/_core.scss +0 -63
- package/templates/template-gulp-vanilla/src/assets/scss/src/_functions.scss +0 -21
- package/templates/template-gulp-vanilla/src/assets/scss/src/_mixins.scss +0 -1
- 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
|
+
[](https://www.npmjs.com/package/create-tateru-cli)
|
|
4
|
+
[](https://github.com/danielsitek/tateru-create-tateru-cli/releases)
|
|
5
|
+
[](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 (
|
|
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
|
|
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.
|
|
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",
|
|
@@ -1 +1,57 @@
|
|
|
1
|
-
# tateru-
|
|
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.
|