@fullstackunicorn/create-root 1.0.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/assets/root.config.app.js +36 -0
- package/assets/root.config.backend.js +0 -0
- package/assets/root.config.frontend.js +43 -0
- package/assets/root.config.server.js +0 -0
- package/assets/root.readme.md +0 -0
- package/index.cmd.js +15 -0
- package/index.dep.js +6 -0
- package/index.js +1 -0
- package/modules/root.init.js +61 -0
- package/package.json +36 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const config = {}
|
|
2
|
+
|
|
3
|
+
// frontend
|
|
4
|
+
config.frontend = {}
|
|
5
|
+
// frontend.env
|
|
6
|
+
config.frontend.env = {}
|
|
7
|
+
config.frontend.env.port = 9000
|
|
8
|
+
config.frontend.env.name = 'root.fullstackunicorn.dev'
|
|
9
|
+
config.frontend.env.type = 'frontend'
|
|
10
|
+
// frontend.package
|
|
11
|
+
config.frontend.package = {}
|
|
12
|
+
config.frontend.package.homepage = config.frontend.env.name
|
|
13
|
+
config.frontend.package.homepage = 'https://root.fullstackunicorn.dev'
|
|
14
|
+
config.frontend.package.author = 'lucanigido'
|
|
15
|
+
// frontend.manifest
|
|
16
|
+
config.frontend.manifest = {}
|
|
17
|
+
config.frontend.manifest.name = "ROOT"
|
|
18
|
+
config.frontend.manifest.short_name = "ROOT"
|
|
19
|
+
config.frontend.manifest.theme_color = "#ffffff"
|
|
20
|
+
config.frontend.manifest.background_color = "#ffffff"
|
|
21
|
+
|
|
22
|
+
// backend
|
|
23
|
+
config.backend = {}
|
|
24
|
+
config.backend.env = {}
|
|
25
|
+
config.backend.env.port = 9001
|
|
26
|
+
config.backend.env.name = 'carloprete.it'
|
|
27
|
+
config.backend.env.type = 'backend'
|
|
28
|
+
|
|
29
|
+
config.server = {}
|
|
30
|
+
config.server.env = {}
|
|
31
|
+
config.server.env.port = 9002
|
|
32
|
+
config.server.env.name = 'api.carloprete.it'
|
|
33
|
+
config.server.env.name = 'server'
|
|
34
|
+
|
|
35
|
+
export { config }
|
|
36
|
+
export default config
|
|
File without changes
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const config = {}
|
|
2
|
+
|
|
3
|
+
// LOGO: XY → min 32 max 48 SIZE → 64x64 EXT → .svg or .png
|
|
4
|
+
config.logo = {}
|
|
5
|
+
config.logo.XY = 32
|
|
6
|
+
config.logo.canonical = 'logo.png'
|
|
7
|
+
config.logo.inverse = 'logo.png'
|
|
8
|
+
|
|
9
|
+
// TRADEMARK: Xmax → max 300 Y → min 10 max 32 SIZE → x min 10 max EXT → .svg or .png
|
|
10
|
+
config.trademark = {}
|
|
11
|
+
config.trademark.Xmax = 260
|
|
12
|
+
config.trademark.Y = 18
|
|
13
|
+
config.trademark.canonical = 'trademark.png'
|
|
14
|
+
config.trademark.inverse = 'trademark.png'
|
|
15
|
+
|
|
16
|
+
// CACHE: STALE → 5 * 60 (5min) MAX → 5 * 365 * 24 * 60 * 60 (5years)
|
|
17
|
+
config.cache.STALE = 1 // 5 * 60
|
|
18
|
+
config.cache.MAX = 5 * 365 * 24 * 60 * 60
|
|
19
|
+
|
|
20
|
+
// SERVICES
|
|
21
|
+
config.constants.IS_DEFAULT_THEME_DARK = false
|
|
22
|
+
config.constants.IS_BUTTON_USER_OFF = true
|
|
23
|
+
config.constants.IS_CARD_ACCOUNT_OFF = true
|
|
24
|
+
config.constants.IS_CARD_LANGUAGE_OFF = true
|
|
25
|
+
config.constants.IS_CARD_THEME_OFF = true
|
|
26
|
+
config.constants.IS_CARD_COOKIES_OFF = true
|
|
27
|
+
config.constants.IS_CARD_LEGALS_OFF = true
|
|
28
|
+
config.constants.IS_BAND_CALLOUT_ON = false
|
|
29
|
+
|
|
30
|
+
export { config }
|
|
31
|
+
export default config
|
|
32
|
+
|
|
33
|
+
// generate codebase
|
|
34
|
+
// +
|
|
35
|
+
// generate .env
|
|
36
|
+
// generate package.json
|
|
37
|
+
// generate index.html
|
|
38
|
+
// generate assets (including manifest)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
// generate config/cache
|
|
42
|
+
// generate config/constants
|
|
43
|
+
// generate config/trademarks (paths+dimensions)
|
|
File without changes
|
|
File without changes
|
package/index.cmd.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import '@fullstackunicorn/initialize'
|
|
3
|
+
F3.service = '@fullstackunicorn/root-init'
|
|
4
|
+
|
|
5
|
+
import { init } from '#@/index.js'
|
|
6
|
+
|
|
7
|
+
const [nodePath, nodeScriptPath, foldername] = process.argv
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
await init.run(foldername ?? null)
|
|
11
|
+
process.exit(0)
|
|
12
|
+
} catch (err) {
|
|
13
|
+
console.error('Error:', F3.err.toStr(err))
|
|
14
|
+
process.exit(1)
|
|
15
|
+
}
|
package/index.dep.js
ADDED
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { init } from '#@/modules/root.init.js'
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { path, fileURLToPath, fsa } from '#@/index.dep.js'
|
|
2
|
+
|
|
3
|
+
class Init {
|
|
4
|
+
|
|
5
|
+
async run(foldername = null) {
|
|
6
|
+
|
|
7
|
+
const base = process.cwd()
|
|
8
|
+
|
|
9
|
+
const targetDir = foldername
|
|
10
|
+
? path.resolve(base, foldername)
|
|
11
|
+
: base
|
|
12
|
+
|
|
13
|
+
await fsa.ensureDir(targetDir)
|
|
14
|
+
|
|
15
|
+
// 1) write package.json with @fullstackunicorn/root as devDependency
|
|
16
|
+
const pkgPath = path.join(targetDir, 'package.json')
|
|
17
|
+
|
|
18
|
+
if (!await fsa.exists(pkgPath)) {
|
|
19
|
+
|
|
20
|
+
const pkg = {
|
|
21
|
+
name: foldername ? String(foldername) : 'root-project',
|
|
22
|
+
private: true,
|
|
23
|
+
version: '0.0.0',
|
|
24
|
+
type: 'module',
|
|
25
|
+
devDependencies: {
|
|
26
|
+
'@fullstackunicorn/root': '^1.0.0'
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
await fsa.writeText(pkgPath, JSON.stringify(pkg, null, 4) + '\n')
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 2) copy assets from THIS npm package into targetDir (same name, same content)
|
|
34
|
+
const assetsDir = fileURLToPath(new URL('../assets/', import.meta.url))
|
|
35
|
+
|
|
36
|
+
// list them explicitly (simple + stable)
|
|
37
|
+
const files = [
|
|
38
|
+
'root.config.app.js',
|
|
39
|
+
'root.config.backend.js',
|
|
40
|
+
'root.config.frontend.js',
|
|
41
|
+
'root.config.server.js',
|
|
42
|
+
'root.readme.md'
|
|
43
|
+
]
|
|
44
|
+
|
|
45
|
+
for (const file of files) {
|
|
46
|
+
|
|
47
|
+
const src = path.join(assetsDir, file)
|
|
48
|
+
const dst = path.join(targetDir, file)
|
|
49
|
+
|
|
50
|
+
const content = await fsa.readText(src)
|
|
51
|
+
if (content === null) F3.throw(`missing asset: ${file}`)
|
|
52
|
+
|
|
53
|
+
await fsa.writeText(dst, content)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
F3.logs(`✅ create-root: ${targetDir}`)
|
|
57
|
+
F3.logs(`👉 next: cd ${foldername ?? '.'} && yarn && yarn root generate`)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export const init = new Init()
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"name": "@fullstackunicorn/create-root",
|
|
4
|
+
"author": "lucanigido (https://fullstackunicorn.dev/author/lucanigido)",
|
|
5
|
+
"description": "create-root: bootstrapper that writes config assets and installs @fullstackunicorn/root",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"private": false,
|
|
9
|
+
"readme": "package.readme.md",
|
|
10
|
+
"files": [
|
|
11
|
+
"index.cmd.js",
|
|
12
|
+
"index.js",
|
|
13
|
+
"index.dep.js",
|
|
14
|
+
"modules/",
|
|
15
|
+
"assets/"
|
|
16
|
+
],
|
|
17
|
+
"bin": {
|
|
18
|
+
"create-root": "./index.cmd.js"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://gitlab.com/fullstackunicorn/create-root.git"
|
|
23
|
+
},
|
|
24
|
+
"imports": {
|
|
25
|
+
"#@": "./",
|
|
26
|
+
"#@/*": "./*"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@fullstackunicorn/filesystem": "^1.0.4",
|
|
30
|
+
"@fullstackunicorn/initialize": "^1.0.8"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@fullstackunicorn/cli": "^1.0.3",
|
|
34
|
+
"@fullstackunicorn/reduce": "^1.0.20"
|
|
35
|
+
}
|
|
36
|
+
}
|