sinto 1.0.2 → 1.0.3
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 +14 -0
- package/generators/genGulpfile.js +3 -3
- package/generators/genHtml.js +3 -3
- package/generators/genPackage.js +3 -3
- package/package.json +2 -2
- package/server.js +3 -4
- package/sin.js +7 -9
package/README.md
CHANGED
|
@@ -8,10 +8,22 @@ npm i -g sinto
|
|
|
8
8
|
|
|
9
9
|
## Using
|
|
10
10
|
|
|
11
|
+
Make a project:
|
|
12
|
+
|
|
11
13
|
```cmd
|
|
12
14
|
mkdir app01
|
|
13
15
|
cd app01
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Generate default directories and files:
|
|
19
|
+
|
|
20
|
+
```cmd
|
|
14
21
|
sin init
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Install default dependecies:
|
|
25
|
+
|
|
26
|
+
```cmd
|
|
15
27
|
npm i
|
|
16
28
|
```
|
|
17
29
|
|
|
@@ -27,6 +39,8 @@ sin serve
|
|
|
27
39
|
sin build
|
|
28
40
|
```
|
|
29
41
|
|
|
42
|
+
This command is generate public directory from src directory.
|
|
43
|
+
|
|
30
44
|
## Commands
|
|
31
45
|
|
|
32
46
|
* sin init - Initilalize the project
|
|
@@ -6,14 +6,14 @@ const cleanCss = require('gulp-clean-css');
|
|
|
6
6
|
const browserSync = require('browser-sync').create();
|
|
7
7
|
|
|
8
8
|
function genHTML(cb) {
|
|
9
|
-
console.log('HTML
|
|
9
|
+
console.log('HTML copying...');
|
|
10
10
|
src('src/**/*.html')
|
|
11
11
|
.pipe(dest('public'))
|
|
12
12
|
cb();
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
function minifyJS(cb) {
|
|
16
|
-
console.log('JavaScript
|
|
16
|
+
console.log('JavaScript minification ...');
|
|
17
17
|
src('src/**/*.js')
|
|
18
18
|
.pipe(uglify())
|
|
19
19
|
.pipe(dest('public'));
|
|
@@ -21,7 +21,7 @@ function minifyJS(cb) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function minifyCSS(cb) {
|
|
24
|
-
console.log('CSS
|
|
24
|
+
console.log('CSS minification ...');
|
|
25
25
|
src('src/**/*.css')
|
|
26
26
|
.pipe(cleanCss())
|
|
27
27
|
.pipe(dest('public'));
|
package/generators/genHtml.js
CHANGED
|
@@ -5,14 +5,14 @@ const htmlContent = `
|
|
|
5
5
|
<html lang="hu">
|
|
6
6
|
<head>
|
|
7
7
|
<meta charset="UTF-8">
|
|
8
|
-
<title>
|
|
8
|
+
<title>Sinto Project</title>
|
|
9
9
|
<link rel="stylesheet" href="bootstrap.css">
|
|
10
10
|
<link rel="stylesheet" href="style.css">
|
|
11
11
|
</head>
|
|
12
12
|
<body>
|
|
13
13
|
<div class="container">
|
|
14
|
-
<h1>
|
|
15
|
-
<p>
|
|
14
|
+
<h1>Sinto Project</h1>
|
|
15
|
+
<p>This is a default index.html file, which was created by the sin command.</p>
|
|
16
16
|
</div>
|
|
17
17
|
<script src="app.js"></script>
|
|
18
18
|
</body>
|
package/generators/genPackage.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
const packageContent =
|
|
3
3
|
{
|
|
4
|
-
name: '
|
|
5
|
-
version: '0.1
|
|
6
|
-
description: 'A
|
|
4
|
+
name: 'sinto-project',
|
|
5
|
+
version: '0.0.1',
|
|
6
|
+
description: 'A project created by the Sinto command',
|
|
7
7
|
scripts: {
|
|
8
8
|
'start': 'browser-sync start --config bs-config.json',
|
|
9
9
|
'build': 'gulp'
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -17,19 +17,18 @@ const readConfigFile = (configFilePath, callback) => {
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
const initializeServer = (argv, config) => {
|
|
21
|
-
console.log("config tartalma: ", config)
|
|
20
|
+
const initializeServer = (argv, config) => {
|
|
22
21
|
if (argv.port != undefined) {
|
|
23
22
|
config.port = argv.port;
|
|
24
23
|
}
|
|
25
24
|
browserSync.init(config);
|
|
26
|
-
console.log(`BrowserSync
|
|
25
|
+
console.log(`BrowserSync listening: localhost:${port}`);
|
|
27
26
|
}
|
|
28
27
|
|
|
29
28
|
const serve = (argv) => {
|
|
30
29
|
readConfigFile(configFilePath, (error, config) => {
|
|
31
30
|
if(error) {
|
|
32
|
-
console.error('
|
|
31
|
+
console.error('Error! The configuration file cannot be read!')
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
34
|
initializeServer(argv, config)
|
package/sin.js
CHANGED
|
@@ -29,28 +29,28 @@ const createPackageJsonFile = (directory) => {
|
|
|
29
29
|
const packageJsonPath = `${directory}/package.json`;
|
|
30
30
|
jsonfile.writeFileSync(packageJsonPath, defaultPackageContent, { spaces: 2 });
|
|
31
31
|
if(DEBUG)
|
|
32
|
-
console.log('package.json
|
|
32
|
+
console.log('package.json file created.');
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
const createIndexHtmlFile = (directory) => {
|
|
36
36
|
const indexHtmlPath = `${directory}/src/index.html`;
|
|
37
37
|
fsExtra.writeFileSync(indexHtmlPath, defaultHtmlContent);
|
|
38
38
|
if(DEBUG)
|
|
39
|
-
console.log('index.html
|
|
39
|
+
console.log('index.html file created');
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
const createGulpfileJsFile = (directory) => {
|
|
43
43
|
const gulpfileJsPath = `${directory}/gulpfile.js`;
|
|
44
44
|
fsExtra.writeFileSync(gulpfileJsPath, defaultGulpfileContent);
|
|
45
45
|
if(DEBUG)
|
|
46
|
-
console.log('gulpfile.js
|
|
46
|
+
console.log('gulpfile.js file created.');
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
const createBsconfigFile = (directory) => {
|
|
50
50
|
const bsconfigPath = `${directory}/bs-config.json`;
|
|
51
51
|
jsonfile.writeFileSync(bsconfigPath, defaultBsconfigContent, { spaces: 2 });
|
|
52
52
|
if(DEBUG)
|
|
53
|
-
console.log('bs-config.json
|
|
53
|
+
console.log('bs-config.json file created.');
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
const init = () => {
|
|
@@ -61,16 +61,14 @@ const init = () => {
|
|
|
61
61
|
|
|
62
62
|
createFile(`${currentDirectory}/src/style.css`, '');
|
|
63
63
|
createFile(`${currentDirectory}/src/app.js`, '');
|
|
64
|
-
createFile(`${currentDirectory}/README.md`, '#
|
|
65
|
-
|
|
66
|
-
createFile(`${currentDirectory}/bs-config.json`, '{}');
|
|
67
|
-
|
|
64
|
+
createFile(`${currentDirectory}/README.md`, '# Sinto Project');
|
|
65
|
+
|
|
68
66
|
createPackageJsonFile(currentDirectory);
|
|
69
67
|
createIndexHtmlFile(currentDirectory);
|
|
70
68
|
createGulpfileJsFile(currentDirectory);
|
|
71
69
|
createBsconfigFile(currentDirectory);
|
|
72
70
|
|
|
73
|
-
console.log('
|
|
71
|
+
console.log('Base directories and files created.');
|
|
74
72
|
};
|
|
75
73
|
|
|
76
74
|
const build = (argv) => {
|