@fullstackunicorn/create-root 1.0.6 → 1.0.8
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/assets/package.json +3 -2
- package/assets/root.config.app.js +65 -56
- package/assets/{config.cmd.sh → root.config.cmd.sh} +21 -13
- package/assets/root.readme.md +3 -0
- package/index.cmd.js +1 -2
- package/index.dep.js +6 -10
- package/index.js +1 -1
- package/modules/init.js +30 -0
- package/package.json +5 -1
- package/modules/root.init.js +0 -41
package/assets/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"version": "1.0.0",
|
|
3
3
|
"type": "module",
|
|
4
|
+
"private": true,
|
|
4
5
|
"scripts": {
|
|
5
|
-
"cmd": "chmod +x ./config.cmd.sh && ./config.cmd.sh"
|
|
6
|
+
"cmd": "chmod +x ./root.config.cmd.sh && ./root.config.cmd.sh"
|
|
6
7
|
},
|
|
7
8
|
"dependencies": {},
|
|
8
9
|
"devDependencies": {}
|
|
@@ -1,65 +1,74 @@
|
|
|
1
1
|
const app = {}
|
|
2
2
|
|
|
3
|
+
// dev
|
|
4
|
+
app.dev = {}
|
|
5
|
+
app.dev.port = 9000
|
|
6
|
+
app.dev.token = 'd5ca3630-46f9-4f27-9d19-a7a6186a0f7d'
|
|
7
|
+
app.dev.user = 'xxxxxxxx-xxxx-4xxx-8xxx-xxxxxxxxxxxx'
|
|
3
8
|
|
|
4
|
-
//
|
|
5
|
-
app.
|
|
6
|
-
|
|
7
|
-
app.frontend.env = {}
|
|
8
|
-
app.frontend.env.port = 9000
|
|
9
|
-
app.frontend.env.name = 'root.fullstackunicorn.dev'
|
|
10
|
-
app.frontend.env.type = 'frontend'
|
|
11
|
-
// frontend.package
|
|
12
|
-
app.frontend.package = {}
|
|
13
|
-
app.frontend.package.name = app.frontend.env.name
|
|
14
|
-
app.frontend.package.homepage = 'https://root.fullstackunicorn.dev'
|
|
15
|
-
app.frontend.package.author = 'lucanigido (https://fullstackunicorn.dev/author/lucanigido)'
|
|
16
|
-
// frontend.manifest
|
|
17
|
-
app.frontend.manifest = {}
|
|
18
|
-
app.frontend.manifest.name = "Root"
|
|
19
|
-
app.frontend.manifest.short_name = "Root"
|
|
20
|
-
app.frontend.manifest.theme_color = "#ffffff"
|
|
21
|
-
app.frontend.manifest.background_color = "#ffffff"
|
|
22
|
-
// frontend.configure.logo XY → min 32 max 48 SIZE → 64x64 EXT → .svg or .png
|
|
23
|
-
app.frontend.configure = {}
|
|
24
|
-
app.frontend.configure.logo = {}
|
|
25
|
-
app.frontend.configure.logo.XY = 32
|
|
26
|
-
app.frontend.configure.logo.canonical = 'logo.png'
|
|
27
|
-
app.frontend.configure.logo.inverse = 'logo.inverse.png'
|
|
28
|
-
// frontend.configure.trademark Xmax → max 300 Y → min 10 max 32 SIZE → x min 10 max EXT → .svg or .png
|
|
29
|
-
app.frontend.configure.trademark = {}
|
|
30
|
-
app.frontend.configure.trademark.Xmax = 260
|
|
31
|
-
app.frontend.configure.trademark.Y = 18
|
|
32
|
-
app.frontend.configure.trademark.canonical = 'trademark.png'
|
|
33
|
-
app.frontend.configure.trademark.inverse = 'trademark.inverse.png'
|
|
34
|
-
// frontend.configure.cache STALE → 5 * 60 (5min) MAX → 5 * 365 * 24 * 60 * 60 (5years)
|
|
35
|
-
app.frontend.configure.cache = {}
|
|
36
|
-
app.frontend.configure.cache.STALE = 1 // 5 * 60
|
|
37
|
-
app.frontend.configure.cache.MAX = 5 * 365 * 24 * 60 * 60
|
|
38
|
-
// frontend.configure.constants
|
|
39
|
-
app.frontend.configure.constants = {}
|
|
40
|
-
app.frontend.configure.constants.IS_DEFAULT_THEME_DARK = false
|
|
41
|
-
app.frontend.configure.constants.IS_BUTTON_USER_OFF = true
|
|
42
|
-
app.frontend.configure.constants.IS_CARD_ACCOUNT_OFF = true
|
|
43
|
-
app.frontend.configure.constants.IS_CARD_LANGUAGE_OFF = true
|
|
44
|
-
app.frontend.configure.constants.IS_CARD_THEME_OFF = true
|
|
45
|
-
app.frontend.configure.constants.IS_CARD_COOKIES_OFF = true
|
|
46
|
-
app.frontend.configure.constants.IS_CARD_LEGALS_OFF = true
|
|
47
|
-
app.frontend.configure.constants.IS_BAND_CALLOUT_ON = false
|
|
9
|
+
// domain
|
|
10
|
+
app.domain = {}
|
|
11
|
+
app.domain.name = 'root.fullstackunicorn.dev'
|
|
48
12
|
|
|
13
|
+
// package
|
|
14
|
+
app.package = {}
|
|
15
|
+
app.package.author = 'lucanigido (https://fullstackunicorn.dev/author/lucanigido)'
|
|
49
16
|
|
|
50
|
-
//
|
|
51
|
-
app.
|
|
52
|
-
app.
|
|
53
|
-
app.
|
|
54
|
-
app.backend.env.name = 'root.fullstackunicorn.dev'
|
|
55
|
-
app.backend.env.type = 'backend'
|
|
17
|
+
// languages
|
|
18
|
+
app.languages = {}
|
|
19
|
+
app.languages['@lang'] = 'en-US'
|
|
20
|
+
app.languages['@langs'] = []
|
|
56
21
|
|
|
22
|
+
// devops
|
|
23
|
+
app.devops = {}
|
|
24
|
+
// devops.git
|
|
25
|
+
app.devops.git = {}
|
|
26
|
+
app.devops.git.name = 'name'
|
|
27
|
+
app.devops.git.email = 'name@email.com'
|
|
28
|
+
app.devops.git.namespace = 'fullstackunicorn'
|
|
29
|
+
app.devops.git.project = 'root.fullstackunicorn.dev'
|
|
30
|
+
// devops.gitlab
|
|
31
|
+
app.devops.gitlab = {}
|
|
57
32
|
|
|
58
|
-
//
|
|
59
|
-
app.
|
|
60
|
-
app.
|
|
61
|
-
app.
|
|
62
|
-
app.
|
|
63
|
-
app.
|
|
33
|
+
// index
|
|
34
|
+
app.index = {}
|
|
35
|
+
app.index.author_name = "lucanigido"
|
|
36
|
+
app.index.author_link = "https://fullstackunicorn.dev/author/lucanigido"
|
|
37
|
+
app.index.name = "Root"
|
|
38
|
+
app.index.short_name = "Root"
|
|
39
|
+
app.index.theme_color = "#ffffff"
|
|
40
|
+
app.index.background_color = "#ffffff"
|
|
41
|
+
|
|
42
|
+
// configure
|
|
43
|
+
app.configure = {}
|
|
44
|
+
// logo → svg or png
|
|
45
|
+
app.configure = {}
|
|
46
|
+
app.configure.logo = {}
|
|
47
|
+
app.configure.logo.XY = 32
|
|
48
|
+
app.configure.logo.ext = 'png'
|
|
49
|
+
// trademark → svg or png
|
|
50
|
+
app.configure.trademark = {}
|
|
51
|
+
app.configure.trademark.Xmax = 260
|
|
52
|
+
app.configure.trademark.Y = 18
|
|
53
|
+
app.configure.trademark.ext = 'png'
|
|
54
|
+
// layout
|
|
55
|
+
app.configure.layout = {}
|
|
56
|
+
app.configure.layout.IS_SIDEBAR_ONE_INTERNAL_OFF = false
|
|
57
|
+
app.configure.layout.IS_SIDEBAR_ONE_EXTERNAL_OFF = false
|
|
58
|
+
app.configure.layout.IS_SIDEBAR_TWO_INTERNAL_OFF = false
|
|
59
|
+
app.configure.layout.IS_SIDEBAR_TWO_EXTERNAL_OFF = false
|
|
60
|
+
app.configure.layout.column_1 = 976
|
|
61
|
+
app.configure.layout.column_2 = 1304
|
|
62
|
+
app.configure.layout.column_3 = 1616
|
|
63
|
+
// services
|
|
64
|
+
app.configure.services = {}
|
|
65
|
+
app.configure.services.IS_DEFAULT_THEME_DARK = false
|
|
66
|
+
app.configure.services.IS_BUTTON_USER_OFF = true
|
|
67
|
+
app.configure.services.IS_CARD_ACCOUNT_OFF = true
|
|
68
|
+
app.configure.services.IS_CARD_LANGUAGE_OFF = true
|
|
69
|
+
app.configure.services.IS_CARD_THEME_OFF = true
|
|
70
|
+
app.configure.services.IS_CARD_COOKIES_OFF = true
|
|
71
|
+
app.configure.services.IS_CARD_LEGALS_OFF = true
|
|
72
|
+
app.configure.services.IS_BAND_CALLOUT_ON = false
|
|
64
73
|
|
|
65
74
|
export { app }
|
|
@@ -4,6 +4,9 @@ set -e
|
|
|
4
4
|
add() {
|
|
5
5
|
|
|
6
6
|
# echo "🚀 Adding Dependencies"
|
|
7
|
+
|
|
8
|
+
# yarn add npm-name --latest
|
|
9
|
+
|
|
7
10
|
echo "🚀 Adding Dev Dependencies"
|
|
8
11
|
|
|
9
12
|
yarn add -D @fullstackunicorn/root --latest
|
|
@@ -15,26 +18,31 @@ add() {
|
|
|
15
18
|
# ============================================================
|
|
16
19
|
upgrade() {
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
# echo "🚀 Upgrading Dependency "
|
|
22
|
+
|
|
19
23
|
# yarn upgrade @fullstackunicorn/root --latest
|
|
20
24
|
# yarn upgrade @fullstackunicorn/reduce --latest
|
|
21
25
|
# yarn upgrade @fullstackunicorn/cli --latest
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
echo "🚀 Upgrading Dependencies "
|
|
28
|
+
|
|
24
29
|
yarn upgrade --latest
|
|
25
30
|
|
|
26
31
|
echo "✅ Upgaded!"
|
|
27
32
|
}
|
|
28
33
|
# ============================================================
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
info() {
|
|
35
|
+
echo "❌ Unknown command: $1"
|
|
36
|
+
echo "Available commands:"
|
|
37
|
+
declare -F | awk '{print " " $3}' | grep -v "^info$"
|
|
38
|
+
exit 1
|
|
39
|
+
}
|
|
40
|
+
# ============================================================
|
|
41
|
+
cmd="${1:-}"
|
|
42
|
+
shift || true
|
|
43
|
+
if declare -F "$cmd" >/dev/null && [[ "$cmd" != "info" ]]; then
|
|
44
|
+
"$cmd" "$@"
|
|
45
|
+
else
|
|
46
|
+
info "$cmd"
|
|
47
|
+
fi
|
|
40
48
|
# ============================================================
|
package/assets/root.readme.md
CHANGED
package/index.cmd.js
CHANGED
package/index.dep.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
import { fileURLToPath } from 'url'
|
|
1
|
+
// @FULLSTACKUNICORN
|
|
2
|
+
export { fsa } from '@fullstackunicorn/filesystem'
|
|
4
3
|
|
|
5
4
|
// BASEPATH
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// FULLSTACKUNICORN
|
|
12
|
-
export { fsa } from '@fullstackunicorn/filesystem'
|
|
5
|
+
import { default as path } from 'path'
|
|
6
|
+
import { fileURLToPath } from 'url'
|
|
7
|
+
export const basePath = path.dirname(fileURLToPath(import.meta.url))
|
|
8
|
+
export { path, fileURLToPath }
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { init } from '#@/modules/
|
|
1
|
+
export { init } from '#@/modules/init.js'
|
package/modules/init.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { path, fsa } from '#@/index.dep.js'
|
|
2
|
+
import { Def } from '#@/index.def.js'
|
|
3
|
+
|
|
4
|
+
class Init {
|
|
5
|
+
|
|
6
|
+
constructor () {
|
|
7
|
+
this.def = new Def ()
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async run(foldername) {
|
|
11
|
+
|
|
12
|
+
if (foldername) this.def.folders.target = path.resolve(this.cwd, foldername)
|
|
13
|
+
await fsa.ensureDir(this.def.folders.target)
|
|
14
|
+
|
|
15
|
+
for (const file of this.def.lists.create) {
|
|
16
|
+
|
|
17
|
+
const asset = path.join(this.def.folders.assets, file)
|
|
18
|
+
const target = path.join(this.def.folders.target, file)
|
|
19
|
+
|
|
20
|
+
const content = await fsa.readText(asset)
|
|
21
|
+
if (!content) F3.throw('❌ missing-asset', {file})
|
|
22
|
+
await fsa.writeText(target, content)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
F3.logs('✅ root-created', {folder:this.def.folders.target})
|
|
26
|
+
F3.logs('👉 root.readme.md')
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const init = new Init()
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.8",
|
|
3
3
|
"name": "@fullstackunicorn/create-root",
|
|
4
4
|
"author": "lucanigido (https://fullstackunicorn.dev/author/lucanigido)",
|
|
5
5
|
"description": "create-root: bootstrapper that writes config assets and installs @fullstackunicorn/root",
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"#@": "./",
|
|
26
26
|
"#@/*": "./*"
|
|
27
27
|
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"cmd": "chmod +x ./config.cmd.sh && ./config.cmd.sh",
|
|
30
|
+
"test": "exit 1"
|
|
31
|
+
},
|
|
28
32
|
"dependencies": {
|
|
29
33
|
"@fullstackunicorn/filesystem": "^1.0.4",
|
|
30
34
|
"@fullstackunicorn/initialize": "^1.0.8"
|
package/modules/root.init.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { path, fsa, basePath } from '#@/index.dep.js'
|
|
2
|
-
|
|
3
|
-
class Init {
|
|
4
|
-
|
|
5
|
-
constructor () {
|
|
6
|
-
|
|
7
|
-
this.cwd = process.cwd()
|
|
8
|
-
|
|
9
|
-
this.folders = {}
|
|
10
|
-
this.folders.assets = `${basePath}/assets`
|
|
11
|
-
this.folders.target = this.cwd
|
|
12
|
-
|
|
13
|
-
this.files = [
|
|
14
|
-
'config.cmd.sh',
|
|
15
|
-
'package.json',
|
|
16
|
-
'root.config.app.js',
|
|
17
|
-
'root.readme.md',
|
|
18
|
-
]
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async run(foldername) {
|
|
22
|
-
|
|
23
|
-
if (foldername) this.folders.target = path.resolve(this.cwd, foldername)
|
|
24
|
-
await fsa.ensureDir(this.folders.target)
|
|
25
|
-
|
|
26
|
-
for (const file of this.files) {
|
|
27
|
-
|
|
28
|
-
const asset = path.join(this.folders.assets, file)
|
|
29
|
-
const target = path.join(this.folders.target, file)
|
|
30
|
-
|
|
31
|
-
const content = await fsa.readText(asset)
|
|
32
|
-
if (!content) F3.throw(`missing asset: ${file}`)
|
|
33
|
-
await fsa.writeText(target, content)
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
F3.logs(`✅ root created: ${this.folders.target}`)
|
|
37
|
-
F3.logs(`👉 next:${foldername ? ` cd ${foldername} &&` : ''} yarn && yarn root generate`)
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const init = new Init()
|