cordova-react-vite 3.0.2 → 3.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/execute.js +4 -3
- package/package.json +1 -1
package/execute.js
CHANGED
|
@@ -45,7 +45,7 @@ function main() {
|
|
|
45
45
|
|
|
46
46
|
// ---- React Vite ----
|
|
47
47
|
console.log("📦 create project React (Vite)...");
|
|
48
|
-
run(`npm create vite@latest react -- --template react`, rootPath);
|
|
48
|
+
run(`npm create vite@latest react -- --template react-ts`, rootPath);
|
|
49
49
|
run(`npm install`, path.join(rootPath, "react"));
|
|
50
50
|
// install aio-cordova
|
|
51
51
|
console.log("📦 install aio-cordova in React...");
|
|
@@ -63,13 +63,14 @@ function main() {
|
|
|
63
63
|
// ---- overwrite App.tsx ----
|
|
64
64
|
const appTsxPath = path.join(rootPath, "react", "src", "App.tsx");
|
|
65
65
|
const appTsxContent = `import { FC } from "react";
|
|
66
|
+
import { FC } from "react";
|
|
66
67
|
import { AIOCordovaComponent, AIOCordova } from "aio-cordova";
|
|
67
68
|
|
|
68
69
|
const App: FC = () => {
|
|
69
70
|
return (
|
|
70
71
|
<AIOCordovaComponent
|
|
71
72
|
startWindows={() => <WindowsApp />}
|
|
72
|
-
startAndroid={(aioCordova) => <AndroidApp
|
|
73
|
+
startAndroid={(aioCordova) => <AndroidApp cordova={aioCordova} />}
|
|
73
74
|
/>
|
|
74
75
|
)
|
|
75
76
|
}
|
|
@@ -78,7 +79,7 @@ export default App;
|
|
|
78
79
|
const WindowsApp: FC = () => {
|
|
79
80
|
return null;
|
|
80
81
|
}
|
|
81
|
-
const AndroidApp: FC = (
|
|
82
|
+
const AndroidApp: FC<{cordova:AIOCordova}> = ({cordova}) => {
|
|
82
83
|
return null;
|
|
83
84
|
}
|
|
84
85
|
`;
|