vaderjs-native 1.0.1 → 1.0.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/README.MD +7 -7
- package/cli.ts +5 -5
- package/main.js +10 -3
- package/package.json +2 -2
- package/plugins/tailwind.ts +2 -2
package/README.MD
CHANGED
|
@@ -21,17 +21,17 @@ A modern, reactive framework for building ultra-fast android applications — bu
|
|
|
21
21
|
import * as Vader from "vader-native"
|
|
22
22
|
|
|
23
23
|
export default function() {
|
|
24
|
-
const [count, setCount] = useState(0)
|
|
24
|
+
const [count, setCount] = Vader.useState(0)
|
|
25
25
|
return (
|
|
26
26
|
<div>
|
|
27
|
-
<Switch>
|
|
28
|
-
<Match when={count > 10}>
|
|
27
|
+
<Vader.Switch>
|
|
28
|
+
<Vader.Match when={count > 10}>
|
|
29
29
|
<h1>Count is greater than 10</h1>
|
|
30
|
-
</Match>
|
|
31
|
-
<Match when={count <= 10}>
|
|
30
|
+
</Vader.Match>
|
|
31
|
+
<Vader.Match when={count <= 10}>
|
|
32
32
|
<h1>Count is less than or equal to 10</h1>
|
|
33
|
-
</Match>
|
|
34
|
-
</Switch>
|
|
33
|
+
</Vader.Match>
|
|
34
|
+
</Vader.Switch>
|
|
35
35
|
</div>
|
|
36
36
|
)
|
|
37
37
|
}
|
package/cli.ts
CHANGED
|
@@ -72,7 +72,7 @@ export async function init() {
|
|
|
72
72
|
|
|
73
73
|
// Create example app/index.jsx with counter
|
|
74
74
|
const counterCode = wantsTailwind
|
|
75
|
-
? `import * as Vader from "
|
|
75
|
+
? `import * as Vader from "vaderjs-native";
|
|
76
76
|
|
|
77
77
|
function Counter() {
|
|
78
78
|
let [count, setCount] = Vader.useState(0);
|
|
@@ -92,7 +92,7 @@ function Counter() {
|
|
|
92
92
|
|
|
93
93
|
Vader.render(Vader.createElement(Counter, null), document.getElementById("app"));
|
|
94
94
|
`
|
|
95
|
-
: `import * as Vader from "
|
|
95
|
+
: `import * as Vader from "vaderjs-native";
|
|
96
96
|
|
|
97
97
|
function Counter() {
|
|
98
98
|
let [count, setCount] = Vader.useState(0);
|
|
@@ -154,12 +154,12 @@ Vader.render(Vader.createElement(Counter, null), document.getElementById("app"))
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
// Create vaderjs.config.ts regardless, add Tailwind plugin if needed
|
|
157
|
-
const vaderConfig = `import defineConfig from "
|
|
158
|
-
|
|
157
|
+
const vaderConfig = `import defineConfig from "vaderjs-native/config";
|
|
158
|
+
import tailwind from "vaderjs-native/plugins/tailwind";
|
|
159
159
|
|
|
160
160
|
export default defineConfig({
|
|
161
161
|
port: 3000,
|
|
162
|
-
plugins: [
|
|
162
|
+
plugins: [tailwind],
|
|
163
163
|
});`;
|
|
164
164
|
|
|
165
165
|
await fs.writeFile(path.join(projectDir, "vaderjs.config.ts"), vaderConfig);
|
package/main.js
CHANGED
|
@@ -11,7 +11,7 @@ import { execSync } from "child_process";
|
|
|
11
11
|
import { existsSync, writeFileSync } from "fs";
|
|
12
12
|
// --- UTILITIES for a Sleek CLI ---
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
async function ensureLocalProperties() {
|
|
15
15
|
const ROOT = path.join(
|
|
16
16
|
PROJECT_ROOT,
|
|
17
17
|
"node_modules",
|
|
@@ -503,6 +503,11 @@ async function buildAppEntrypoints(isDev = false) {
|
|
|
503
503
|
plugins: [
|
|
504
504
|
publicAssetPlugin(),
|
|
505
505
|
],
|
|
506
|
+
loader: {
|
|
507
|
+
'.js': 'jsx',
|
|
508
|
+
'.ts': 'tsx',
|
|
509
|
+
'.css': 'text',
|
|
510
|
+
}
|
|
506
511
|
});
|
|
507
512
|
|
|
508
513
|
// --- FIX IMPORT PATHS IN JS ---
|
|
@@ -544,8 +549,10 @@ async function buildAll(isDev = false) {
|
|
|
544
549
|
await timedStep("Building App Source (/src)", buildSrc);
|
|
545
550
|
await timedStep("Copying Public Assets", copyPublicAssets);
|
|
546
551
|
await timedStep("Building App Entrypoints (/app)", () => buildAppEntrypoints(isDev));
|
|
547
|
-
|
|
548
|
-
|
|
552
|
+
if (!isDev) {
|
|
553
|
+
await timedStep("Copy Compiled Javascript to Java", () => copyCompiledJavascriptToJava(isDev));
|
|
554
|
+
await timedStep("Building APK", buildAPK);
|
|
555
|
+
}
|
|
549
556
|
|
|
550
557
|
await runPluginHook("onBuildFinish");
|
|
551
558
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vaderjs-native",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Build Android Applications using Vaderjs framework.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"vaderjs": "./main.js"
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"ansi-colors": "latest",
|
|
16
16
|
"autoprefixer": "^10.4.23",
|
|
17
17
|
"postcss-cli": "^11.0.1",
|
|
18
|
-
"tailwindcss": "
|
|
18
|
+
"tailwindcss": "latest"
|
|
19
19
|
}
|
|
20
20
|
}
|
package/plugins/tailwind.ts
CHANGED
|
@@ -40,7 +40,7 @@ export default {
|
|
|
40
40
|
initTailwind()
|
|
41
41
|
console.log('Building TailwindCSS...')
|
|
42
42
|
await vader.runCommand(['bun', 'run', 'postcss', './public/styles.css', '-o', 'dist/public/tailwind.css'])
|
|
43
|
-
vader.injectHTML(`<link rel="stylesheet" href="
|
|
43
|
+
vader.injectHTML(`<link rel="stylesheet" href="./styles.css">`)
|
|
44
44
|
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -50,4 +50,4 @@ export default {
|
|
|
50
50
|
console.log('TailwindCSS plugin finished building')
|
|
51
51
|
},
|
|
52
52
|
|
|
53
|
-
}
|
|
53
|
+
} as VaderPlugin;
|