create-velto 1.0.0
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/LICENSE +21 -0
- package/README.md +2 -0
- package/dist/index.mjs +83 -0
- package/package.json +33 -0
- package/templates/velto/assets/logo.jpg +0 -0
- package/templates/velto/index.html +13 -0
- package/templates/velto/package.json +22 -0
- package/templates/velto/pnpm-lock.yaml +1135 -0
- package/templates/velto/src/App.jsx +12 -0
- package/templates/velto/src/components/HelloWorld/index.jsx +22 -0
- package/templates/velto/src/components/HelloWorld/styles.module.scss +5 -0
- package/templates/velto/src/index.js +4 -0
- package/templates/velto/src/styles.module.scss +8 -0
- package/templates/velto/vite.config.js +37 -0
- package/templates/velto-ts/assets/logo.jpg +0 -0
- package/templates/velto-ts/index.html +13 -0
- package/templates/velto-ts/package.json +25 -0
- package/templates/velto-ts/pnpm-lock.yaml +1300 -0
- package/templates/velto-ts/src/App.tsx +12 -0
- package/templates/velto-ts/src/components/HelloWorld/index.tsx +22 -0
- package/templates/velto-ts/src/components/HelloWorld/styles.module.scss +5 -0
- package/templates/velto-ts/src/index.ts +4 -0
- package/templates/velto-ts/src/styles.module.scss +8 -0
- package/templates/velto-ts/src/types/global.d.ts +1 -0
- package/templates/velto-ts/tsconfig.json +109 -0
- package/templates/velto-ts/vite.config.ts +37 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
import HelloWorld from './components/HelloWorld';
|
2
|
+
import styles from './styles.module.scss';
|
3
|
+
|
4
|
+
export default function App() {
|
5
|
+
|
6
|
+
return (
|
7
|
+
<div class={styles.app}>
|
8
|
+
<img alt="Velto logo" src="./assets/logo.jpg" />
|
9
|
+
<HelloWorld msg="Hello Velto + Vite" />
|
10
|
+
</div>
|
11
|
+
)
|
12
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { ref } from "@velto/runtime"
|
2
|
+
|
3
|
+
import styles from "./styles.module.scss";
|
4
|
+
|
5
|
+
export default function Test(props = {}) {
|
6
|
+
const count = ref(0);
|
7
|
+
return (
|
8
|
+
<div class={styles.helloworld}>
|
9
|
+
<h1>{ props.msg }</h1>
|
10
|
+
|
11
|
+
<p>
|
12
|
+
<a href="https://vitejs.dev/guide/features.html" target="_blank">
|
13
|
+
Vite Docs
|
14
|
+
</a>
|
15
|
+
|
|
16
|
+
<a href="https://github.com/zebing/velto" target="_blank">Velto Docs</a>
|
17
|
+
</p>
|
18
|
+
|
19
|
+
<button type="button" onClick={() => count.setValue(count.value + 1)}>count is: {count.value}</button>
|
20
|
+
</div>
|
21
|
+
)
|
22
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { transformAsync, BabelFileResult } from '@babel/core';
|
2
|
+
import velto from '@velto/babel-plugin-velto';
|
3
|
+
import { defineConfig } from 'vite';
|
4
|
+
|
5
|
+
export default defineConfig({
|
6
|
+
plugins: [vitePluginLite()],
|
7
|
+
})
|
8
|
+
|
9
|
+
function vitePluginLite() {
|
10
|
+
|
11
|
+
let projectRoot = process.cwd();
|
12
|
+
|
13
|
+
return {
|
14
|
+
name: 'vite-plugin-velto',
|
15
|
+
enforce: 'pre',
|
16
|
+
|
17
|
+
async transform(source, id) {
|
18
|
+
if (!(/\.js[x]?$/i.test(id))) {
|
19
|
+
return null;
|
20
|
+
}
|
21
|
+
|
22
|
+
id = id.replace(/\?.+$/, '');
|
23
|
+
|
24
|
+
const { code, map } = await transformAsync(source, {
|
25
|
+
root: projectRoot,
|
26
|
+
filename: id,
|
27
|
+
sourceFileName: id,
|
28
|
+
presets: [],
|
29
|
+
plugins: [velto],
|
30
|
+
ast: false,
|
31
|
+
sourceMaps: true,
|
32
|
+
});
|
33
|
+
|
34
|
+
return { code: code ?? undefined, map };
|
35
|
+
},
|
36
|
+
};
|
37
|
+
}
|
Binary file
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8" />
|
5
|
+
<link rel="icon" href="/favicon.ico" />
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7
|
+
<title>Velto App</title>
|
8
|
+
<script type="module" src="/src/index.ts"></script>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<div id="app"></div>
|
12
|
+
</body>
|
13
|
+
</html>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{
|
2
|
+
"name": "velto",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"dev": "vite",
|
8
|
+
"build": "vite build",
|
9
|
+
"preview": "vite preview"
|
10
|
+
},
|
11
|
+
"keywords": [],
|
12
|
+
"author": "",
|
13
|
+
"license": "ISC",
|
14
|
+
"dependencies": {
|
15
|
+
"@velto/runtime": "1.0.0-beta.0"
|
16
|
+
},
|
17
|
+
"devDependencies": {
|
18
|
+
"@babel/preset-typescript": "^7.27.0",
|
19
|
+
"@types/babel__core": "^7.20.5",
|
20
|
+
"@velto/babel-plugin-velto": "1.0.0-beta.0",
|
21
|
+
"sass": "^1.86.3",
|
22
|
+
"typescript": "^5.8.3",
|
23
|
+
"vite": "^6.2.6"
|
24
|
+
}
|
25
|
+
}
|