@rollipop/plugin-rozenite 0.0.0 → 0.1.0-alpha.13
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/CHANGELOG.md +10 -0
- package/README.md +11 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +43 -0
- package/package.json +43 -2
- package/.editorconfig +0 -10
- package/.gitattributes +0 -4
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RozeniteConfig } from "@rozenite/middleware";
|
|
2
|
+
import { Plugin } from "rollipop";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin.d.ts
|
|
5
|
+
interface RozenitePluginOptions extends Omit<RozeniteConfig, 'projectRoot' | 'projectType'> {
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function rozenitePlugin(options?: RozenitePluginOptions): Plugin;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { type RozenitePluginOptions, rozenitePlugin as rozenite };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import module from "node:module";
|
|
2
|
+
import { initializeRozenite } from "@rozenite/middleware";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
//#region src/patch.ts
|
|
6
|
+
const require = module.createRequire(import.meta.url);
|
|
7
|
+
function patchDevtoolsFrontendUrl(projectRoot) {
|
|
8
|
+
const rollipopModulePath = path.dirname(getRollipopPath(projectRoot));
|
|
9
|
+
const getDevToolsFrontendUrlModulePath = path.dirname(getDevMiddlewarePath(rollipopModulePath));
|
|
10
|
+
const getDevToolsFrontendUrlModule = require(path.join(getDevToolsFrontendUrlModulePath, "/utils/getDevToolsFrontendUrl"));
|
|
11
|
+
const getDevToolsFrontendUrl = getDevToolsFrontendUrlModule.default;
|
|
12
|
+
getDevToolsFrontendUrlModule.default = (experiments, webSocketDebuggerUrl, devServerUrl, options) => {
|
|
13
|
+
return getDevToolsFrontendUrl(experiments, webSocketDebuggerUrl, devServerUrl, options).replace("/debugger-frontend/", "/rozenite/");
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function getRollipopPath(projectRoot) {
|
|
17
|
+
return require.resolve("rollipop", { paths: [projectRoot] });
|
|
18
|
+
}
|
|
19
|
+
function getDevMiddlewarePath(rollipopPath) {
|
|
20
|
+
return require.resolve("@react-native/dev-middleware", { paths: [rollipopPath] });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/plugin.ts
|
|
25
|
+
function rozenitePlugin(options = {}) {
|
|
26
|
+
const { enabled = false, ...rozeniteConfig } = options;
|
|
27
|
+
return {
|
|
28
|
+
name: "rollipop:rozenite",
|
|
29
|
+
configureServer(server) {
|
|
30
|
+
if (!enabled) return;
|
|
31
|
+
const rozenite = initializeRozenite({
|
|
32
|
+
projectType: "react-native-cli",
|
|
33
|
+
projectRoot: server.config.root,
|
|
34
|
+
...rozeniteConfig
|
|
35
|
+
});
|
|
36
|
+
patchDevtoolsFrontendUrl(server.config.root);
|
|
37
|
+
server.middlewares.use(rozenite.middleware);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { rozenitePlugin as rozenite };
|
package/package.json
CHANGED
|
@@ -1,4 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rollipop/plugin-rozenite",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
|
|
3
|
+
"version": "0.1.0-alpha.13",
|
|
4
|
+
"homepage": "https://github.com/leegeunhyeok/rollipop#readme",
|
|
5
|
+
"bugs": {
|
|
6
|
+
"url": "https://github.com/leegeunhyeok/rollipop/issues"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "leegeunhyeok <dev.ghlee@gmail.com> (https://github.com/leegeunhyeok)",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "git+https://github.com/leegeunhyeok/rollipop.git",
|
|
13
|
+
"directory": "packages/plugin-rozenite"
|
|
14
|
+
},
|
|
15
|
+
"bin": "./bin/index.js",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"prepack": "yarn build",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"build": "tsdown"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@rozenite/middleware": "1.2.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"rollipop": "0.1.0-alpha.13",
|
|
39
|
+
"tsdown": "0.20.3",
|
|
40
|
+
"typescript": "5.9.3"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"rollipop": "0.1.0-alpha.13"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/.editorconfig
DELETED
package/.gitattributes
DELETED