@gesslar/muddy 0.2.0 → 0.4.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/package.json +2 -2
- package/src/Muddy.js +25 -1
- package/src/modules/MudletModule.js +1 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "gesslar",
|
|
6
6
|
"url": "https://gesslar.dev"
|
|
7
7
|
},
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "0.4.0",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/gesslar/muddy.git"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@gesslar/actioneer": "^2.2.0",
|
|
40
40
|
"@gesslar/colours": "^0.8.0",
|
|
41
|
-
"@gesslar/toolkit": "^3.33.
|
|
41
|
+
"@gesslar/toolkit": "^3.33.1",
|
|
42
42
|
"adm-zip": "^0.5.16",
|
|
43
43
|
"commander": "^14.0.3",
|
|
44
44
|
"xmlbuilder2": "^4.0.3"
|
package/src/Muddy.js
CHANGED
|
@@ -128,12 +128,28 @@ export default class Muddy {
|
|
|
128
128
|
const mfile = await mfileObject.loadData()
|
|
129
129
|
|
|
130
130
|
glog.table(mfile)
|
|
131
|
+
|
|
131
132
|
if(mfile.outputFile === true)
|
|
132
133
|
glog.info(
|
|
133
134
|
c`Will write {other}.output{/} file at root of project with json `+
|
|
134
135
|
`object containing package name and file location at build end.`
|
|
135
136
|
)
|
|
136
137
|
|
|
138
|
+
mfile.description = mfile.description ?? ""
|
|
139
|
+
|
|
140
|
+
if(!mfile.description) {
|
|
141
|
+
const readme = projectDirectory.getFile("README.md")
|
|
142
|
+
|
|
143
|
+
if(await readme.exists) {
|
|
144
|
+
const content = await readme.read()
|
|
145
|
+
mfile.description = append(content, "\n")
|
|
146
|
+
|
|
147
|
+
glog.info(`No description in 'mfile', will use content from existing README.md`)
|
|
148
|
+
} else {
|
|
149
|
+
glog.info(`No description in 'mfile' and no README.md`)
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
137
153
|
return Object.assign(ctx, {mfile})
|
|
138
154
|
}
|
|
139
155
|
|
|
@@ -632,7 +648,7 @@ export default class Muddy {
|
|
|
632
648
|
* @returns {Promise<GeneratedContext>} The context object
|
|
633
649
|
*/
|
|
634
650
|
#closeTheBarnDoor = async ctx => {
|
|
635
|
-
const {mfile, projectDirectory, workDirectory} = ctx
|
|
651
|
+
const {mfile, projectDirectory, workDirectory, xmlFile} = ctx
|
|
636
652
|
|
|
637
653
|
const mpackage = new AdmZip()
|
|
638
654
|
|
|
@@ -652,6 +668,14 @@ export default class Muddy {
|
|
|
652
668
|
|
|
653
669
|
glog.info(c`{<B}${mpackageFile.path}{B>} written to disk (${size.toLocaleString()} bytes)`)
|
|
654
670
|
|
|
671
|
+
const destXmlFile = buildDirectory.getFile(xmlFile.name)
|
|
672
|
+
if(await destXmlFile.exists)
|
|
673
|
+
await destXmlFile.delete()
|
|
674
|
+
|
|
675
|
+
await xmlFile.copy(destXmlFile.path)
|
|
676
|
+
const xmlSize = await xmlFile.size()
|
|
677
|
+
glog.info(c`{<B}${destXmlFile.path}{B>} written to disk (${xmlSize.toLocaleString()} bytes)`)
|
|
678
|
+
|
|
655
679
|
return Object.assign(ctx, {mpackageFile})
|
|
656
680
|
}
|
|
657
681
|
|
|
@@ -18,7 +18,7 @@ export default class MudletModule {
|
|
|
18
18
|
* @param {string} [object.script] - Lua script content
|
|
19
19
|
*/
|
|
20
20
|
constructor(object={}) {
|
|
21
|
-
const {name, isFolder, isActive, packageName="", script=""} = (object ?? {})
|
|
21
|
+
const {name, isFolder="no", isActive="yes", packageName="", script=""} = (object ?? {})
|
|
22
22
|
|
|
23
23
|
Valid.type(name, "String", {allowEmpty: false})
|
|
24
24
|
Valid.assert(isFolder === "yes" || isFolder === "no", "isFolder must be 'yes' or 'no'.")
|