@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.
Files changed (2) hide show
  1. package/cli/build.task.js +15 -10
  2. 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
- function stubFileNameFor (kind, sourcePath, srcDir) {
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
- const flat = rel.replace(/\//g, '__')
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 flat.replace(/\.(jsx?|tsx?|mjs|cjs)$/, '') + ext
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 stubFileName = stubFileNameFor(kind, sourcePath, srcDir)
152
- const stubAbs = path.join(stubDir, stubFileName)
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.1",
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.1",
37
- "@ossy/design-system": "^1.16.1",
38
- "@ossy/pages": "^1.16.1",
39
- "@ossy/platform": "^1.15.1",
40
- "@ossy/router": "^1.16.1",
41
- "@ossy/router-react": "^1.16.1",
42
- "@ossy/sdk": "^1.16.1",
43
- "@ossy/sdk-react": "^1.16.1",
44
- "@ossy/themes": "^1.16.1",
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": "031e2329e267a3e0cebc2ec0d484fa11b53082d9"
78
+ "gitHead": "00aca40bd8fcf8510c4a854cb388a780ddb751f7"
79
79
  }