@ossy/app 1.16.1 → 1.16.2
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/cli/build.task.js +15 -10
- package/package.json +11 -11
package/cli/build.task.js
CHANGED
|
@@ -46,11 +46,21 @@ function ensureDir (dir) {
|
|
|
46
46
|
fs.mkdirSync(dir, { recursive: true })
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
// One source of truth for the per-entry name. Used both as the Rollup
|
|
50
|
+
// `input` key (which becomes the `[name]` token in `entryFileNames`) and
|
|
51
|
+
// as the basename of the generated stub. Flattening the full relative
|
|
52
|
+
// path with `__` keeps two files with the same basename in different
|
|
53
|
+
// folders (e.g. `apps/home.page.jsx` and `analytics/home.page.jsx`) from
|
|
54
|
+
// colliding on the Rollup input map — which the filesystem already
|
|
55
|
+
// guarantees can't happen at the relative-path level.
|
|
56
|
+
function entryNameFromSource (sourcePath, srcDir) {
|
|
50
57
|
const rel = path.relative(srcDir, sourcePath).replace(/\\/g, '/')
|
|
51
|
-
|
|
58
|
+
return rel.replace(/\//g, '__').replace(/\.(jsx?|tsx?|mjs|cjs)$/, '')
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function stubFileNameFor (kind, sourcePath, srcDir) {
|
|
52
62
|
const ext = kind === 'page' ? '.entry.jsx' : '.entry.js'
|
|
53
|
-
return
|
|
63
|
+
return entryNameFromSource(sourcePath, srcDir) + ext
|
|
54
64
|
}
|
|
55
65
|
|
|
56
66
|
function relImport (fromAbs, toAbs) {
|
|
@@ -148,14 +158,9 @@ export async function build (cliArgs = []) {
|
|
|
148
158
|
|
|
149
159
|
for (const entry of allEntries) {
|
|
150
160
|
const { kind, sourcePath } = entry
|
|
151
|
-
const
|
|
152
|
-
const stubAbs = path.join(stubDir,
|
|
161
|
+
const inputName = entryNameFromSource(sourcePath, srcDir)
|
|
162
|
+
const stubAbs = path.join(stubDir, stubFileNameFor(kind, sourcePath, srcDir))
|
|
153
163
|
fs.writeFileSync(stubAbs, stubFor(kind, { stubAbs, sourceAbs: sourcePath }), 'utf8')
|
|
154
|
-
|
|
155
|
-
const inputName = path.basename(sourcePath).replace(/\.(jsx?|tsx?|mjs|cjs)$/, '')
|
|
156
|
-
if (stubInputMap[inputName]) {
|
|
157
|
-
throw new Error(`[@ossy/app][build] Duplicate entry name "${inputName}" between ${stubInputMap[inputName]} and ${stubAbs}.`)
|
|
158
|
-
}
|
|
159
164
|
stubInputMap[inputName] = stubAbs
|
|
160
165
|
entriesByStub.set(stubAbs, { kind, sourcePath })
|
|
161
166
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/app",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "./src/index.js",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"@babel/eslint-parser": "^7.15.8",
|
|
34
34
|
"@babel/preset-react": "^7.26.3",
|
|
35
35
|
"@babel/register": "^7.25.9",
|
|
36
|
-
"@ossy/connected-components": "^1.16.
|
|
37
|
-
"@ossy/design-system": "^1.16.
|
|
38
|
-
"@ossy/pages": "^1.16.
|
|
39
|
-
"@ossy/platform": "^1.15.
|
|
40
|
-
"@ossy/router": "^1.16.
|
|
41
|
-
"@ossy/router-react": "^1.16.
|
|
42
|
-
"@ossy/sdk": "^1.16.
|
|
43
|
-
"@ossy/sdk-react": "^1.16.
|
|
44
|
-
"@ossy/themes": "^1.16.
|
|
36
|
+
"@ossy/connected-components": "^1.16.2",
|
|
37
|
+
"@ossy/design-system": "^1.16.2",
|
|
38
|
+
"@ossy/pages": "^1.16.2",
|
|
39
|
+
"@ossy/platform": "^1.15.2",
|
|
40
|
+
"@ossy/router": "^1.16.2",
|
|
41
|
+
"@ossy/router-react": "^1.16.2",
|
|
42
|
+
"@ossy/sdk": "^1.16.2",
|
|
43
|
+
"@ossy/sdk-react": "^1.16.2",
|
|
44
|
+
"@ossy/themes": "^1.16.2",
|
|
45
45
|
"@rollup/plugin-alias": "^6.0.0",
|
|
46
46
|
"@rollup/plugin-babel": "6.1.0",
|
|
47
47
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"README.md",
|
|
76
76
|
"tsconfig.json"
|
|
77
77
|
],
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "00aca40bd8fcf8510c4a854cb388a780ddb751f7"
|
|
79
79
|
}
|