@reactful/create 0.1.12 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
package/index.js
CHANGED
@@ -7,15 +7,23 @@ import path from 'path'
|
|
7
7
|
import * as tar from 'tar'
|
8
8
|
import fs from 'fs'
|
9
9
|
|
10
|
+
const CIANO = '\x1b[36m'
|
10
11
|
const GREEN = '\x1b[32m'
|
11
12
|
const RESET = '\x1b[0m'
|
12
13
|
const prefix = `${GREEN}+${RESET}`
|
13
|
-
const
|
14
|
+
const char = '─'
|
15
|
+
const line = char.repeat(51)
|
14
16
|
const decor = '-'.repeat(18)
|
15
17
|
|
18
|
+
|
19
|
+
console.log('___________________________________________________')
|
20
|
+
console.log('')
|
21
|
+
console.log(` ${GREEN}REACTful${RESET} scaffold `)
|
22
|
+
console.log(` ${CIANO}version 1.0${RESET} `)
|
23
|
+
//console.log(`${decor}( ${GREEN}reactful${RESET}.js )${decor}`)
|
24
|
+
console.log('___________________________________________________')
|
16
25
|
// console.log(line)
|
17
|
-
console.log(
|
18
|
-
// console.log(line)
|
26
|
+
console.log('')
|
19
27
|
|
20
28
|
const templates = ['empty', 'minimal', 'sampling']
|
21
29
|
const questions = [{
|
@@ -45,7 +53,7 @@ async function prompting(answers) {
|
|
45
53
|
console.log('- loading NPM...')
|
46
54
|
await download('@reactful/create', downloadPath)
|
47
55
|
|
48
|
-
console.log('- creating
|
56
|
+
console.log('- creating env...')
|
49
57
|
const env = `PORT=333\nMINIFY=FALSE`
|
50
58
|
fs.writeFileSync(`${destination}/.env`, env)
|
51
59
|
|
@@ -68,7 +76,7 @@ async function prompting(answers) {
|
|
68
76
|
await copyPath(`${downloadPath}/vscode`, pathVSCode)
|
69
77
|
}
|
70
78
|
|
71
|
-
await removeDirectory(downloadPath)
|
79
|
+
// await removeDirectory(downloadPath)
|
72
80
|
}
|
73
81
|
|
74
82
|
function renamingJSON(directory, projectName) {
|
@@ -125,14 +133,17 @@ function removeDirectory(directory) {
|
|
125
133
|
|
126
134
|
function copyPath(source, target) {
|
127
135
|
if (!fs.existsSync(target)) fs.mkdirSync(target)
|
136
|
+
console.log('=', source)
|
128
137
|
|
129
|
-
fs.readdirSync(source).forEach(function
|
130
|
-
const
|
138
|
+
fs.readdirSync(source).forEach(function(file) {
|
139
|
+
const sourcePath = path.join(source, file)
|
131
140
|
const targetPath = path.join(target, file)
|
141
|
+
const statusPath = fs.lstatSync(sourcePath)
|
142
|
+
const folderPath = statusPath.isDirectory()
|
132
143
|
|
133
|
-
|
134
|
-
copyPath(currentPath, targetPath)
|
144
|
+
console.log('=>', file)
|
135
145
|
|
136
|
-
|
146
|
+
if (folderPath) copyPath(sourcePath, targetPath)
|
147
|
+
else fs.copyFileSync(sourcePath, targetPath)
|
137
148
|
})
|
138
149
|
}
|
package/package.json
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
{
|
2
2
|
"name": "@reactful/create",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.14",
|
4
4
|
"main": "index.js",
|
5
5
|
"type": "module",
|
6
6
|
"description": "reactful scafold tool",
|
7
7
|
"author": "jonathan de sena ribeiro <jsenaribeiro@gmail.com>",
|
8
|
-
"bin": {
|
9
|
-
"@reactful/create": "index.js"
|
10
|
-
},
|
8
|
+
"bin": { "@reactful/create": "index.js" },
|
11
9
|
"files": [
|
12
10
|
"index.js",
|
13
11
|
"package.json",
|
Binary file
|
@@ -12659,7 +12659,7 @@ var init__server = __esm(() => {
|
|
12659
12659
|
var IS_CLIENT_SIDE4;
|
12660
12660
|
var init__route = __esm(() => {
|
12661
12661
|
init_npm2();
|
12662
|
-
IS_CLIENT_SIDE4 = !!
|
12662
|
+
IS_CLIENT_SIDE4 = !!globalThis.document;
|
12663
12663
|
});
|
12664
12664
|
|
12665
12665
|
// node_modules/@reactful/extensions/npm/types/seo
|