@ossy/app 1.0.3 → 1.0.4
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.js +0 -29
- package/cli/dev.js +0 -2
- package/package.json +2 -2
package/cli/build.js
CHANGED
|
@@ -6,7 +6,6 @@ import babel from '@rollup/plugin-babel';
|
|
|
6
6
|
import { nodeResolve as resolveDependencies } from '@rollup/plugin-node-resolve'
|
|
7
7
|
import resolveCommonJsDependencies from '@rollup/plugin-commonjs'
|
|
8
8
|
import { minify as minifyWithTerser } from 'terser'
|
|
9
|
-
// import typescript from '@rollup/plugin-typescript'
|
|
10
9
|
import json from "@rollup/plugin-json"
|
|
11
10
|
import nodeExternals from 'rollup-plugin-node-externals'
|
|
12
11
|
import copy from 'rollup-plugin-copy';
|
|
@@ -14,39 +13,12 @@ import replace from '@rollup/plugin-replace';
|
|
|
14
13
|
import arg from 'arg'
|
|
15
14
|
import { ensureBuildStubs } from '../scripts/ensure-build-stubs.mjs'
|
|
16
15
|
import { createRequire } from 'node:module'
|
|
17
|
-
// import inject from '@rollup/plugin-inject'
|
|
18
16
|
|
|
19
17
|
const PAGE_FILE_PATTERN = /\.page\.(jsx?|tsx?)$/
|
|
20
18
|
const API_FILE_PATTERN = /\.api\.(mjs|cjs|js)$/
|
|
21
19
|
const TASK_FILE_PATTERN = /\.task\.(mjs|cjs|js)$/
|
|
22
20
|
const RESOURCE_TEMPLATE_FILE_PATTERN = /\.resource\.js$/
|
|
23
21
|
|
|
24
|
-
const NODE_MODULES_SEG = `${path.sep}node_modules${path.sep}`
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Keep third-party code out of the Rollup graph for the server build.
|
|
28
|
-
* `preserveModules` + `@rollup/plugin-commonjs` otherwise emits `_virtual/*` chunks that import
|
|
29
|
-
* `{ __require }` from real `node_modules` paths, which Node ESM cannot execute.
|
|
30
|
-
*
|
|
31
|
-
* Rules:
|
|
32
|
-
* - Resolved absolute path under `node_modules` → external (any npm dep, including transitive).
|
|
33
|
-
* - Unresolved bare specifier → external so Node loads it (covers `react`, `lodash`, customers’
|
|
34
|
-
* `@acme/*`, etc.). Exception: `@ossy/*` is bundled (framework packages; monorepo paths or
|
|
35
|
-
* published tarballs — avoids relying on Node resolving those bare ids from `build/server.js`).
|
|
36
|
-
*
|
|
37
|
-
* React’s main entry is still CJS; there is no separate official ESM prod file for `import 'react'`.
|
|
38
|
-
* Leaving it external is correct: Node applies default export interop when Rollup does not rewrite it.
|
|
39
|
-
*/
|
|
40
|
-
export function ossyServerExternal (id, _importer, _isResolved) {
|
|
41
|
-
if (!id || id[0] === '\0') return false
|
|
42
|
-
if (path.isAbsolute(id)) {
|
|
43
|
-
return id.includes(NODE_MODULES_SEG)
|
|
44
|
-
}
|
|
45
|
-
if (id.startsWith('.')) return false
|
|
46
|
-
if (id.startsWith('@ossy/')) return false
|
|
47
|
-
return true
|
|
48
|
-
}
|
|
49
|
-
|
|
50
22
|
/** Written next to `*.resource.js` under `src/resource-templates/` when that dir exists. */
|
|
51
23
|
export const OSSY_RESOURCE_TEMPLATES_OUT = '.ossy-system-templates.generated.js'
|
|
52
24
|
|
|
@@ -760,7 +732,6 @@ export const build = async (cliArgs) => {
|
|
|
760
732
|
const serverBundle = await rollup({
|
|
761
733
|
input: { server: inputServer },
|
|
762
734
|
plugins: serverPlugins,
|
|
763
|
-
external: ossyServerExternal,
|
|
764
735
|
})
|
|
765
736
|
await serverBundle.write({
|
|
766
737
|
dir: buildPath,
|
package/cli/dev.js
CHANGED
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
writeResourceTemplatesBarrelIfPresent,
|
|
19
19
|
resourceTemplatesDir,
|
|
20
20
|
OSSY_RESOURCE_TEMPLATES_OUT,
|
|
21
|
-
ossyServerExternal,
|
|
22
21
|
} from './build.js';
|
|
23
22
|
import { watch } from 'rollup';
|
|
24
23
|
import arg from 'arg'
|
|
@@ -177,7 +176,6 @@ export const dev = async (cliArgs) => {
|
|
|
177
176
|
input: { server: inputServer },
|
|
178
177
|
output: serverOutput,
|
|
179
178
|
plugins: serverPlugins,
|
|
180
|
-
external: ossyServerExternal,
|
|
181
179
|
watch: { clearScreen: false },
|
|
182
180
|
},
|
|
183
181
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ossy/app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"source": "./src/index.js",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"README.md",
|
|
66
66
|
"tsconfig.json"
|
|
67
67
|
],
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "0f2076f680d1a24c2a5ecb871afb4870e0cd4067"
|
|
69
69
|
}
|