create-tateru-cli 0.1.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/LICENSE +21 -0
- package/README.md +30 -0
- package/lib/cli/cli.js +85 -0
- package/lib/index.js +103 -0
- package/package.json +46 -0
- package/templates/template-gulp-vanilla/.babelrc +12 -0
- package/templates/template-gulp-vanilla/.editorconfig +23 -0
- package/templates/template-gulp-vanilla/.eslintignore +2 -0
- package/templates/template-gulp-vanilla/.eslintrc.js +19 -0
- package/templates/template-gulp-vanilla/.gitattributes +12 -0
- package/templates/template-gulp-vanilla/.gitlab-ci.yml +43 -0
- package/templates/template-gulp-vanilla/LICENSE +21 -0
- package/templates/template-gulp-vanilla/README.md +1 -0
- package/templates/template-gulp-vanilla/gulpfile.js +74 -0
- package/templates/template-gulp-vanilla/package-lock.json +8706 -0
- package/templates/template-gulp-vanilla/package.json +49 -0
- package/templates/template-gulp-vanilla/postcss.config.js +5 -0
- 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/apple-touch-icon.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/public/assets/favicon/favicon.ico +0 -0
- package/templates/template-gulp-vanilla/src/assets/images/content/.gitkeep +0 -0
- package/templates/template-gulp-vanilla/src/assets/images/share/homepage.png +0 -0
- package/templates/template-gulp-vanilla/src/assets/images/theme/.gitkeep +0 -0
- package/templates/template-gulp-vanilla/src/assets/js/homepage.js +1 -0
- package/templates/template-gulp-vanilla/src/assets/js/services/analyticsServices.js +18 -0
- package/templates/template-gulp-vanilla/src/assets/js/utils/asyncForLoop.js +21 -0
- package/templates/template-gulp-vanilla/src/assets/js/utils/sleep.js +7 -0
- package/templates/template-gulp-vanilla/src/assets/scss/main.scss +6 -0
- package/templates/template-gulp-vanilla/src/assets/scss/src/_core.scss +63 -0
- package/templates/template-gulp-vanilla/src/assets/scss/src/_functions.scss +21 -0
- package/templates/template-gulp-vanilla/src/assets/scss/src/_mixins.scss +1 -0
- package/templates/template-gulp-vanilla/src/assets/scss/src/_variables.scss +13 -0
- package/templates/template-gulp-vanilla/src/assets/svg/heart-solid.svg +3 -0
- package/templates/template-gulp-vanilla/src/assets/svg/source.svg +3 -0
- package/templates/template-gulp-vanilla/src/translations/cs.json +8 -0
- package/templates/template-gulp-vanilla/src/twig/layouts/layout.html.twig +150 -0
- package/templates/template-gulp-vanilla/src/twig/views/_error-404.html.twig +16 -0
- package/templates/template-gulp-vanilla/src/twig/views/homepage.html.twig +21 -0
- package/templates/template-gulp-vanilla/src/twig/views/humans.txt.twig +21 -0
- package/templates/template-gulp-vanilla/src/twig/views/robots.txt.twig +4 -0
- package/templates/template-gulp-vanilla/src/twig/views/site.webmanifest.twig +23 -0
- package/templates/template-gulp-vanilla/src/twig/views/sitemap.html.twig +22 -0
- package/templates/template-gulp-vanilla/tasks/browser-sync.js +3 -0
- package/templates/template-gulp-vanilla/tasks/clean.js +10 -0
- package/templates/template-gulp-vanilla/tasks/css.js +20 -0
- package/templates/template-gulp-vanilla/tasks/helpers/config.js +5 -0
- package/templates/template-gulp-vanilla/tasks/helpers/logger.js +79 -0
- package/templates/template-gulp-vanilla/tasks/images.js +12 -0
- package/templates/template-gulp-vanilla/tasks/minify-css.js +21 -0
- package/templates/template-gulp-vanilla/tasks/public-assets.js +11 -0
- package/templates/template-gulp-vanilla/tasks/tateru.js +25 -0
- package/templates/template-gulp-vanilla/tasks/watch.js +45 -0
- package/templates/template-gulp-vanilla/tasks/webpack.js +93 -0
- package/templates/template-gulp-vanilla/tateru.config.json +111 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const { DIST_FOLDER } = require('./helpers/config');
|
|
2
|
+
const { src, dest } = require('gulp');
|
|
3
|
+
const rename = require('gulp-rename');
|
|
4
|
+
const postcss = require('gulp-postcss');
|
|
5
|
+
const cssnano = require('cssnano');
|
|
6
|
+
|
|
7
|
+
module.exports = function minifyCss(cb) {
|
|
8
|
+
return src([
|
|
9
|
+
`*.css`,
|
|
10
|
+
'!*.min.css',
|
|
11
|
+
], {
|
|
12
|
+
cwd: `${DIST_FOLDER}assets/css/`,
|
|
13
|
+
})
|
|
14
|
+
.pipe(postcss([cssnano()]))
|
|
15
|
+
.pipe(
|
|
16
|
+
rename({
|
|
17
|
+
suffix: '.min'
|
|
18
|
+
})
|
|
19
|
+
)
|
|
20
|
+
.pipe(dest(`${DIST_FOLDER}assets/css/`));
|
|
21
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { exec } = require('child_process');
|
|
2
|
+
const Logger = require('./helpers/logger');
|
|
3
|
+
|
|
4
|
+
const log = new Logger({
|
|
5
|
+
namespace: 'tateru',
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
module.exports = function tateru(cb) {
|
|
9
|
+
return new Promise((resolve) => {
|
|
10
|
+
exec('npm run tateru', function (error, stdout, stderr) {
|
|
11
|
+
|
|
12
|
+
if (error && stdout) {
|
|
13
|
+
log.error(stdout);
|
|
14
|
+
} else if (stdout) {
|
|
15
|
+
log.info(stdout);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if (stderr) {
|
|
19
|
+
log.error(stderr);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
resolve(cb);
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const { DIST_FOLDER } = require('./helpers/config');
|
|
2
|
+
const { watch: watchGulp } = require('gulp');
|
|
3
|
+
const browserSync = require('./browser-sync');
|
|
4
|
+
const css = require('./css');
|
|
5
|
+
const images = require('./images');
|
|
6
|
+
const publicAssets = require('./public-assets');
|
|
7
|
+
const tateru = require('./tateru');
|
|
8
|
+
const webpack = require('./webpack');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @link https://gulpjs.com/docs/en/getting-started/watching-files
|
|
12
|
+
*/
|
|
13
|
+
module.exports = function watch () {
|
|
14
|
+
browserSync.init({
|
|
15
|
+
server: DIST_FOLDER,
|
|
16
|
+
open: false,
|
|
17
|
+
reloadDebounce: 1000,
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
watchGulp([
|
|
21
|
+
`src/assets/scss/**/*.scss`,
|
|
22
|
+
], css);
|
|
23
|
+
|
|
24
|
+
watchGulp([
|
|
25
|
+
`src/assets/images/**/*`,
|
|
26
|
+
], images);
|
|
27
|
+
|
|
28
|
+
watchGulp([
|
|
29
|
+
`public/**/*`,
|
|
30
|
+
], publicAssets);
|
|
31
|
+
|
|
32
|
+
watchGulp([
|
|
33
|
+
`src/twig/**/*`,
|
|
34
|
+
`src/translations/**/*`,
|
|
35
|
+
`config.json`,
|
|
36
|
+
], tateru);
|
|
37
|
+
|
|
38
|
+
watchGulp([
|
|
39
|
+
`src/assets/js/**/*`,
|
|
40
|
+
], webpack);
|
|
41
|
+
|
|
42
|
+
watchGulp([
|
|
43
|
+
`${DIST_FOLDER}**/*`,
|
|
44
|
+
]).on('change', browserSync.reload);
|
|
45
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const { ENV_DEVELOPMENT } = require('./helpers/config');
|
|
2
|
+
const bundler = require('webpack');
|
|
3
|
+
const Logger = require('./helpers/logger');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const log = new Logger({
|
|
7
|
+
namespace: 'webpack',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
module.exports = function webpack (cb) {
|
|
11
|
+
log.info(`env: ${process.env.NODE_ENV}`);
|
|
12
|
+
|
|
13
|
+
let isReady = false;
|
|
14
|
+
|
|
15
|
+
const settings = {
|
|
16
|
+
mode: process.env.NODE_ENV || ENV_DEVELOPMENT,
|
|
17
|
+
|
|
18
|
+
entry: {
|
|
19
|
+
homepage: path.resolve(__dirname, '../src/assets/js/homepage.js')
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
output: {
|
|
23
|
+
path: path.resolve(__dirname, '../dist/assets/js'),
|
|
24
|
+
filename: '[name].bundle.js',
|
|
25
|
+
chunkFilename: '[name].chunk.js?v=[contenthash:10]',
|
|
26
|
+
publicPath: '/assets/js/',
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
resolve: {
|
|
30
|
+
alias: {
|
|
31
|
+
'vue$': 'vue/dist/vue.esm.js',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
module: {
|
|
36
|
+
rules: [
|
|
37
|
+
{
|
|
38
|
+
test: /\.js$/,
|
|
39
|
+
include: [path.resolve(__dirname, '../src')],
|
|
40
|
+
use: {
|
|
41
|
+
loader: 'babel-loader',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
test: /\.svg$/,
|
|
46
|
+
include: [path.resolve(__dirname, '../src')],
|
|
47
|
+
use: {
|
|
48
|
+
loader: 'html-loader',
|
|
49
|
+
},
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
if (process.env.NODE_ENV === ENV_DEVELOPMENT) {
|
|
56
|
+
settings.devtool = 'eval-source-map';
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const bundle = bundler(settings, function (error, stats) {
|
|
60
|
+
const jsonStats = stats.toJson();
|
|
61
|
+
const { errors, warnings } = jsonStats;
|
|
62
|
+
|
|
63
|
+
if (error) {
|
|
64
|
+
log.error(error);
|
|
65
|
+
} else if (errors.length > 0) {
|
|
66
|
+
log.error(errors.toString());
|
|
67
|
+
} else if (warnings.length > 0) {
|
|
68
|
+
log.warning(warnings.toString());
|
|
69
|
+
} else {
|
|
70
|
+
log.custom({
|
|
71
|
+
type: 'Stats',
|
|
72
|
+
}, stats.toString({
|
|
73
|
+
colors: true,
|
|
74
|
+
hash: false,
|
|
75
|
+
timings: true,
|
|
76
|
+
assets: true,
|
|
77
|
+
chunks: false,
|
|
78
|
+
chunkModules: false,
|
|
79
|
+
modules: false,
|
|
80
|
+
children: true,
|
|
81
|
+
version: false,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (!isReady) {
|
|
86
|
+
cb();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return isReady = true;
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
return bundle;
|
|
93
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"env": {
|
|
3
|
+
"dev": {
|
|
4
|
+
"data": {
|
|
5
|
+
"app": {
|
|
6
|
+
"environment": "dev"
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"prod": {
|
|
11
|
+
"data": {
|
|
12
|
+
"app": {
|
|
13
|
+
"environment": "prod"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"options": {
|
|
19
|
+
"data": {
|
|
20
|
+
"app": {
|
|
21
|
+
"environment": "dev",
|
|
22
|
+
"root": "/"
|
|
23
|
+
},
|
|
24
|
+
"title": "Tateru CLI Starter",
|
|
25
|
+
"shortTitle": "Tateru CLI Starter",
|
|
26
|
+
"description": "Tateru CLI is simple static site generator using Twig templates for generating html or other files.",
|
|
27
|
+
"keywords": [
|
|
28
|
+
"Tateru CLI",
|
|
29
|
+
"Static Site Generator",
|
|
30
|
+
"Twig JS",
|
|
31
|
+
"cli"
|
|
32
|
+
],
|
|
33
|
+
"owner": "Tateru CLI",
|
|
34
|
+
"domain": "https://example.com/",
|
|
35
|
+
"images": [
|
|
36
|
+
"assets/images/share/homepage.png"
|
|
37
|
+
],
|
|
38
|
+
"sitename": "Tateru CLI - Website Starter",
|
|
39
|
+
"langCode": "cs_CZ",
|
|
40
|
+
"type": "place",
|
|
41
|
+
"facebook": {
|
|
42
|
+
"appID": "",
|
|
43
|
+
"admins": "",
|
|
44
|
+
"image": ""
|
|
45
|
+
},
|
|
46
|
+
"google": {
|
|
47
|
+
"author": "",
|
|
48
|
+
"publisher": "",
|
|
49
|
+
"image": ""
|
|
50
|
+
},
|
|
51
|
+
"twitter": {
|
|
52
|
+
"card": "summary_large_image",
|
|
53
|
+
"site": "",
|
|
54
|
+
"siteID": "",
|
|
55
|
+
"creator": "",
|
|
56
|
+
"creatorID": "",
|
|
57
|
+
"domain": "https://example.com/",
|
|
58
|
+
"image": ""
|
|
59
|
+
},
|
|
60
|
+
"full_locale": "cs_CZ"
|
|
61
|
+
},
|
|
62
|
+
"src": "src/twig",
|
|
63
|
+
"ext": "dist"
|
|
64
|
+
},
|
|
65
|
+
"translations": {
|
|
66
|
+
"cs": {
|
|
67
|
+
"src": "src/translations/cs.json",
|
|
68
|
+
"ext": ""
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"pages": {
|
|
72
|
+
"cs": {
|
|
73
|
+
"index": {
|
|
74
|
+
"data": {
|
|
75
|
+
"page": "index"
|
|
76
|
+
},
|
|
77
|
+
"src": "views/homepage.html.twig",
|
|
78
|
+
"ext": "index.html",
|
|
79
|
+
"minify": ["prod"]
|
|
80
|
+
},
|
|
81
|
+
"humans_txt": {
|
|
82
|
+
"data": {
|
|
83
|
+
"page": "humans_txt"
|
|
84
|
+
},
|
|
85
|
+
"src": "views/humans.txt.twig",
|
|
86
|
+
"ext": "humans.txt"
|
|
87
|
+
},
|
|
88
|
+
"robots_txt": {
|
|
89
|
+
"data": {
|
|
90
|
+
"page": "robots_txt"
|
|
91
|
+
},
|
|
92
|
+
"src": "views/robots.txt.twig",
|
|
93
|
+
"ext": "robots.txt"
|
|
94
|
+
},
|
|
95
|
+
"sitemap_xml": {
|
|
96
|
+
"data": {
|
|
97
|
+
"page": "sitemap_xml"
|
|
98
|
+
},
|
|
99
|
+
"src": "views/sitemap.html.twig",
|
|
100
|
+
"ext": "sitemap.xml"
|
|
101
|
+
},
|
|
102
|
+
"webmanifest_file": {
|
|
103
|
+
"data": {
|
|
104
|
+
"page": "webmanifest_file"
|
|
105
|
+
},
|
|
106
|
+
"src": "views/site.webmanifest.twig",
|
|
107
|
+
"ext": "site.webmanifest"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|