onejs-core 2.0.21 → 2.0.22
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/bin/oj.js +12 -5
- package/dist/index.d.ts +3 -0
- package/index.ts +1 -0
- package/package.json +1 -1
package/bin/oj.js
CHANGED
|
@@ -36,7 +36,7 @@ function findAssetsDir(startDir, explicit) {
|
|
|
36
36
|
if (fs.existsSync(explicit) && fs.statSync(explicit).isDirectory()) return explicit
|
|
37
37
|
return null
|
|
38
38
|
}
|
|
39
|
-
let dir = startDir
|
|
39
|
+
let dir = path.dirname(startDir) // Up a level, preventing `App/assets` getting returned
|
|
40
40
|
const { root } = path.parse(dir)
|
|
41
41
|
while (dir !== root) {
|
|
42
42
|
const probe = path.join(dir, "Assets")
|
|
@@ -80,10 +80,17 @@ async function scanComponents(tarPath) {
|
|
|
80
80
|
await tar.t({
|
|
81
81
|
file: tarPath,
|
|
82
82
|
onentry: (entry) => {
|
|
83
|
-
const p = entry.path
|
|
83
|
+
const p = entry.path.replace(/\\/g, "/")
|
|
84
84
|
if (!p.startsWith("comps/")) return
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
|
|
86
|
+
// Only treat entries inside a top-level folder under comps/
|
|
87
|
+
// e.g. "comps/button/**" → "button"
|
|
88
|
+
const rest = p.slice("comps/".length)
|
|
89
|
+
const firstSlash = rest.indexOf("/")
|
|
90
|
+
if (firstSlash === -1) return // file directly under comps/ → skip
|
|
91
|
+
|
|
92
|
+
const top = rest.slice(0, firstSlash)
|
|
93
|
+
if (top) comps.add(top)
|
|
87
94
|
},
|
|
88
95
|
})
|
|
89
96
|
return comps
|
|
@@ -244,4 +251,4 @@ program
|
|
|
244
251
|
program.parseAsync().catch((err) => {
|
|
245
252
|
console.error(err)
|
|
246
253
|
process.exit(1)
|
|
247
|
-
})
|
|
254
|
+
})
|
package/dist/index.d.ts
CHANGED
package/index.ts
CHANGED
|
@@ -44,6 +44,7 @@ declare global {
|
|
|
44
44
|
}
|
|
45
45
|
const newCsArray: <T>(type: { new(...args: any[]): T }, count: number) => CS.System.Array
|
|
46
46
|
const toJsArray: <T>(csArr: CS.System.Array) => T[]
|
|
47
|
+
const toCsArray: <T>(jsArr: T[], type: { new(...args: any[]): T }) => CS.System.Array
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
if (typeof globalThis.___document != "undefined") {
|
package/package.json
CHANGED