nexa-init 0.5.2 → 0.6.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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +60 -227
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/default/index.html +20 -0
- package/templates/default/package.json +19 -0
- package/templates/default/src/App.nexa +118 -0
- package/templates/default/src/env.d.ts +32 -0
- package/templates/default/src/main.ts +7 -0
- package/templates/default/tsconfig.json +40 -0
- package/templates/default/vite.config.ts +6 -0
- package/templates/pro/index.html +20 -0
- package/templates/pro/package.json +22 -0
- package/templates/pro/src/App.nexa +99 -0
- package/templates/pro/src/env.d.ts +32 -0
- package/templates/pro/src/main.ts +11 -0
- package/templates/pro/src/views/DashboardView.nexa +196 -0
- package/templates/pro/src/views/UsersView.nexa +95 -0
- package/templates/pro/tsconfig.json +40 -0
- package/templates/pro/vite.config.ts +6 -0
- package/dist/cli.d.ts +0 -3
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA8BA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAkB,GAAG,IAAI,CA4B/F"}
|
package/dist/index.js
CHANGED
|
@@ -1,237 +1,70 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, mkdirSync, writeFileSync } from 'fs';
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, statSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname } from 'path';
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = dirname(__filename);
|
|
8
|
+
function copyRecursive(src, dest, name) {
|
|
9
|
+
console.log(`Copying ${src} to ${dest}`);
|
|
10
|
+
const stats = statSync(src);
|
|
11
|
+
if (stats.isDirectory()) {
|
|
12
|
+
if (!existsSync(dest))
|
|
13
|
+
mkdirSync(dest, { recursive: true });
|
|
14
|
+
readdirSync(src).forEach(child => {
|
|
15
|
+
copyRecursive(join(src, child), join(dest, child), name);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
try {
|
|
20
|
+
let content = readFileSync(src, 'utf-8');
|
|
21
|
+
content = content.replace(/{{name}}/g, name);
|
|
22
|
+
writeFileSync(dest, content, 'utf-8');
|
|
23
|
+
console.log(`Successfully wrote ${dest}`);
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
console.error(`Failed to write ${dest}: ${err.message}`);
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
|
-
</style>
|
|
28
|
-
</head>
|
|
29
|
-
<body>
|
|
30
|
-
<div id="app"></div>
|
|
31
|
-
<script type="module" src="/src/main.ts"></script>
|
|
32
|
-
</body>
|
|
33
|
-
</html>`,
|
|
34
|
-
'vite.config.ts': () => `import { defineConfig } from 'vite'
|
|
35
|
-
import { nexaPlugin } from 'nexa-vite-plugin'
|
|
36
|
-
|
|
37
|
-
export default defineConfig({
|
|
38
|
-
plugins: [nexaPlugin()],
|
|
39
|
-
})`,
|
|
40
|
-
'src/main.ts': () => `import { mount } from 'nexa-framework'
|
|
41
|
-
import App from './App.nexa'
|
|
42
|
-
|
|
43
|
-
const root = document.getElementById('app')
|
|
44
|
-
if (root) {
|
|
45
|
-
mount(App, root)
|
|
46
|
-
}
|
|
47
|
-
`,
|
|
48
|
-
'src/App.nexa': () => `<script setup>
|
|
49
|
-
import { signal } from 'nexa-framework'
|
|
50
|
-
import Counter from './components/Counter.nexa'
|
|
51
|
-
|
|
52
|
-
const show = signal(true)
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<template>
|
|
56
|
-
<div class="container">
|
|
57
|
-
<header>
|
|
58
|
-
<div class="logo">Nexa</div>
|
|
59
|
-
<nav>
|
|
60
|
-
<a href="https://github.com/nexabase/nexa-framework" target="_blank">GitHub</a>
|
|
61
|
-
</nav>
|
|
62
|
-
</header>
|
|
63
|
-
|
|
64
|
-
<main>
|
|
65
|
-
<h1>Build something <span>amazing</span>.</h1>
|
|
66
|
-
<p class="subtitle">Vue-like simplicity meets Signals performance.</p>
|
|
67
|
-
|
|
68
|
-
<div class="demo">
|
|
69
|
-
<Transition name="fade" mode="out-in">
|
|
70
|
-
<Counter v-if="show.value" />
|
|
71
|
-
</Transition>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<button class="btn-toggle" @click="show.value = !show.value">
|
|
75
|
-
{{ show.value ? 'Destroy Counter' : 'Restore Counter' }}
|
|
76
|
-
</button>
|
|
77
|
-
</main>
|
|
78
|
-
</div>
|
|
79
|
-
</template>
|
|
80
|
-
|
|
81
|
-
<style scoped>
|
|
82
|
-
.container {
|
|
83
|
-
max-width: 1200px;
|
|
84
|
-
margin: 0 auto;
|
|
85
|
-
padding: 0 2rem;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
header {
|
|
89
|
-
display: flex;
|
|
90
|
-
justify-content: space-between;
|
|
91
|
-
align-items: center;
|
|
92
|
-
padding: 2rem 0;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.logo {
|
|
96
|
-
font-size: 1.5rem;
|
|
97
|
-
font-weight: 800;
|
|
98
|
-
letter-spacing: -0.025em;
|
|
99
|
-
background: linear-gradient(to right, #60a5fa, #a855f7);
|
|
100
|
-
-webkit-background-clip: text;
|
|
101
|
-
-webkit-text-fill-color: transparent;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
nav a {
|
|
105
|
-
color: #94a3b8;
|
|
106
|
-
text-decoration: none;
|
|
107
|
-
font-weight: 500;
|
|
108
|
-
transition: color 0.2s;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
nav a:hover {
|
|
112
|
-
color: #f8fafc;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
main {
|
|
116
|
-
text-align: center;
|
|
117
|
-
padding: 4rem 0;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
h1 {
|
|
121
|
-
font-size: 4rem;
|
|
122
|
-
font-weight: 900;
|
|
123
|
-
letter-spacing: -0.05em;
|
|
124
|
-
margin-bottom: 1rem;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
h1 span {
|
|
128
|
-
color: #3b82f6;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
.subtitle {
|
|
132
|
-
font-size: 1.25rem;
|
|
133
|
-
color: #94a3b8;
|
|
134
|
-
margin-bottom: 3rem;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.demo {
|
|
138
|
-
margin-bottom: 2rem;
|
|
139
|
-
min-height: 150px;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.btn-toggle {
|
|
143
|
-
background: transparent;
|
|
144
|
-
color: #64748b;
|
|
145
|
-
border: 1px solid #334155;
|
|
146
|
-
padding: 8px 16px;
|
|
147
|
-
border-radius: 8px;
|
|
148
|
-
cursor: pointer;
|
|
149
|
-
font-size: 0.875rem;
|
|
150
|
-
transition: all 0.2s;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.btn-toggle:hover {
|
|
154
|
-
border-color: #475569;
|
|
155
|
-
color: #f8fafc;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/* Transitions */
|
|
159
|
-
.fade-enter-active, .fade-leave-active {
|
|
160
|
-
transition: opacity 0.3s ease;
|
|
161
|
-
}
|
|
162
|
-
.fade-enter-from, .fade-leave-to {
|
|
163
|
-
opacity: 0;
|
|
164
|
-
}
|
|
165
|
-
</style>`,
|
|
166
|
-
'src/components/Counter.nexa': () => `<script setup>
|
|
167
|
-
import { signal } from 'nexa-framework'
|
|
168
|
-
const count = signal(0)
|
|
169
|
-
</script>
|
|
170
|
-
|
|
171
|
-
<template>
|
|
172
|
-
<div class="counter-card">
|
|
173
|
-
<div class="count-value">{{ count.value }}</div>
|
|
174
|
-
<div class="controls">
|
|
175
|
-
<button @click="count.value--">-</button>
|
|
176
|
-
<button @click="count.value++" class="primary">+</button>
|
|
177
|
-
</div>
|
|
178
|
-
</div>
|
|
179
|
-
</template>
|
|
180
|
-
|
|
181
|
-
<style scoped>
|
|
182
|
-
.counter-card {
|
|
183
|
-
background: #1e293b;
|
|
184
|
-
border: 1px solid #334155;
|
|
185
|
-
padding: 2rem;
|
|
186
|
-
border-radius: 1rem;
|
|
187
|
-
display: inline-block;
|
|
188
|
-
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
.count-value {
|
|
192
|
-
font-size: 3rem;
|
|
193
|
-
font-weight: 700;
|
|
194
|
-
margin-bottom: 1rem;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.controls {
|
|
198
|
-
display: flex;
|
|
199
|
-
gap: 1rem;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
button {
|
|
203
|
-
background: #334155;
|
|
204
|
-
color: white;
|
|
205
|
-
border: none;
|
|
206
|
-
width: 48px;
|
|
207
|
-
height: 48px;
|
|
208
|
-
border-radius: 50%;
|
|
209
|
-
font-size: 1.5rem;
|
|
210
|
-
cursor: pointer;
|
|
211
|
-
transition: transform 0.1s;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
button:active {
|
|
215
|
-
transform: scale(0.9);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
button.primary {
|
|
219
|
-
background: #3b82f6;
|
|
220
29
|
}
|
|
221
|
-
|
|
222
|
-
};
|
|
223
|
-
export function createProject(name, destDir) {
|
|
30
|
+
export function createProject(name, destDir, template = 'default') {
|
|
224
31
|
const projectDir = join(destDir, name);
|
|
225
|
-
|
|
32
|
+
// In monorepo, templates are at ../templates/
|
|
33
|
+
// When installed as package, they should be in the package folder
|
|
34
|
+
let templateDir = join(__dirname, '..', 'templates', template);
|
|
35
|
+
// Fallback for development/monorepo structure
|
|
36
|
+
if (!existsSync(templateDir)) {
|
|
37
|
+
templateDir = join(process.cwd(), 'packages/create-nexa/templates', template);
|
|
38
|
+
}
|
|
39
|
+
if (!existsSync(templateDir)) {
|
|
40
|
+
console.warn(`Template "${template}" not found, falling back to "default"`);
|
|
41
|
+
templateDir = templateDir.replace(template, 'default');
|
|
42
|
+
}
|
|
43
|
+
if (existsSync(projectDir) && name !== '.') {
|
|
226
44
|
throw new Error(`Directory "${name}" already exists.`);
|
|
227
45
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
46
|
+
if (!existsSync(projectDir)) {
|
|
47
|
+
mkdirSync(projectDir, { recursive: true });
|
|
48
|
+
}
|
|
49
|
+
console.log(`Creating Nexa project: ${name} (Template: ${template})...`);
|
|
50
|
+
copyRecursive(templateDir, projectDir, name === '.' ? 'nexa-app' : name);
|
|
51
|
+
console.log(`Success! Run "pnpm install" and "pnpm dev" to start building.`);
|
|
52
|
+
}
|
|
53
|
+
// CLI Handling
|
|
54
|
+
const args = process.argv.slice(2);
|
|
55
|
+
if (args.length > 0) {
|
|
56
|
+
const name = args[0];
|
|
57
|
+
let template = 'default';
|
|
58
|
+
const templateIdx = args.indexOf('--template');
|
|
59
|
+
if (templateIdx !== -1 && args[templateIdx + 1]) {
|
|
60
|
+
template = args[templateIdx + 1];
|
|
61
|
+
}
|
|
62
|
+
try {
|
|
63
|
+
createProject(name, process.cwd(), template);
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
console.error(`Error: ${err.message}`);
|
|
67
|
+
process.exit(1);
|
|
235
68
|
}
|
|
236
69
|
}
|
|
237
70
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>{{name}}</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
margin: 0;
|
|
10
|
+
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
|
11
|
+
background-color: #020617;
|
|
12
|
+
color: #f8fafc;
|
|
13
|
+
}
|
|
14
|
+
</style>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<div id="app"></div>
|
|
18
|
+
<script type="module" src="/src/main.ts"></script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"nexa-framework": "^0.6.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"vite": "^6.0.0",
|
|
16
|
+
"nexa-vite-plugin": "^0.6.0",
|
|
17
|
+
"typescript": "^5.0.0"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { signal } from 'nexa-framework'
|
|
3
|
+
|
|
4
|
+
const show = signal(true)
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<div class="container">
|
|
9
|
+
<header>
|
|
10
|
+
<div class="logo">Nexa</div>
|
|
11
|
+
<nav>
|
|
12
|
+
<a href="https://github.com/nexabase/nexa-framework" target="_blank">GitHub</a>
|
|
13
|
+
</nav>
|
|
14
|
+
</header>
|
|
15
|
+
|
|
16
|
+
<main>
|
|
17
|
+
<h1>Build something <span>amazing</span>.</h1>
|
|
18
|
+
<p class="subtitle">Vue-like simplicity meets Signals performance.</p>
|
|
19
|
+
|
|
20
|
+
<div class="demo">
|
|
21
|
+
<div v-if="show.value" class="counter-card">
|
|
22
|
+
<p>Welcome to your new Nexa project!</p>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<button class="btn-toggle" @click="show.value = !show.value">
|
|
27
|
+
{{ show.value ? 'Hide Message' : 'Show Message' }}
|
|
28
|
+
</button>
|
|
29
|
+
</main>
|
|
30
|
+
</div>
|
|
31
|
+
</template>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
.container {
|
|
35
|
+
max-width: 1200px;
|
|
36
|
+
margin: 0 auto;
|
|
37
|
+
padding: 0 2rem;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
header {
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: space-between;
|
|
43
|
+
align-items: center;
|
|
44
|
+
padding: 2rem 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.logo {
|
|
48
|
+
font-size: 1.5rem;
|
|
49
|
+
font-weight: 800;
|
|
50
|
+
letter-spacing: -0.025em;
|
|
51
|
+
background: linear-gradient(to right, #60a5fa, #a855f7);
|
|
52
|
+
-webkit-background-clip: text;
|
|
53
|
+
-webkit-text-fill-color: transparent;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
nav a {
|
|
57
|
+
color: #94a3b8;
|
|
58
|
+
text-decoration: none;
|
|
59
|
+
font-weight: 500;
|
|
60
|
+
transition: color 0.2s;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
nav a:hover {
|
|
64
|
+
color: #f8fafc;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
main {
|
|
68
|
+
text-align: center;
|
|
69
|
+
padding: 4rem 0;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
h1 {
|
|
73
|
+
font-size: 4rem;
|
|
74
|
+
font-weight: 900;
|
|
75
|
+
letter-spacing: -0.05em;
|
|
76
|
+
margin-bottom: 1rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
h1 span {
|
|
80
|
+
color: #3b82f6;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.subtitle {
|
|
84
|
+
font-size: 1.25rem;
|
|
85
|
+
color: #94a3b8;
|
|
86
|
+
margin-bottom: 3rem;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.demo {
|
|
90
|
+
margin-bottom: 2rem;
|
|
91
|
+
min-height: 150px;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.counter-card {
|
|
95
|
+
background: #1e293b;
|
|
96
|
+
border: 1px solid #334155;
|
|
97
|
+
padding: 2rem;
|
|
98
|
+
border-radius: 1rem;
|
|
99
|
+
display: inline-block;
|
|
100
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.btn-toggle {
|
|
104
|
+
background: transparent;
|
|
105
|
+
color: #64748b;
|
|
106
|
+
border: 1px solid #334155;
|
|
107
|
+
padding: 8px 16px;
|
|
108
|
+
border-radius: 8px;
|
|
109
|
+
cursor: pointer;
|
|
110
|
+
font-size: 0.875rem;
|
|
111
|
+
transition: all 0.2s;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.btn-toggle:hover {
|
|
115
|
+
border-color: #475569;
|
|
116
|
+
color: #f8fafc;
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare module "*.nexa" {
|
|
2
|
+
import { type Component } from "nexa-framework";
|
|
3
|
+
const component: Component;
|
|
4
|
+
export default component;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface ImportMetaHot {
|
|
8
|
+
readonly data: any;
|
|
9
|
+
accept(): void;
|
|
10
|
+
accept(cb: (mod: any) => void): void;
|
|
11
|
+
accept(dep: string, cb: (mod: any) => void): void;
|
|
12
|
+
accept(deps: readonly string[], cb: (mods: any[]) => void): void;
|
|
13
|
+
dispose(cb: (data: any) => void): void;
|
|
14
|
+
decline(): void;
|
|
15
|
+
invalidate(): void;
|
|
16
|
+
on(event: string, cb: (payload: any) => void): void;
|
|
17
|
+
send(event: string, data?: any): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface ImportMeta {
|
|
21
|
+
readonly hot?: ImportMetaHot;
|
|
22
|
+
readonly env: ImportMetaEnv;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface ImportMetaEnv {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
BASE_URL: string;
|
|
28
|
+
MODE: string;
|
|
29
|
+
DEV: boolean;
|
|
30
|
+
PROD: boolean;
|
|
31
|
+
SSR: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "preserve",
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
|
|
23
|
+
"baseUrl": ".",
|
|
24
|
+
"paths": {
|
|
25
|
+
"nexa-framework": ["./node_modules/nexa-framework/dist/index.d.ts", "../../../nexa/src/index.ts"],
|
|
26
|
+
"nexa-vite-plugin": ["./node_modules/nexa-vite-plugin/dist/index.d.ts", "../../../vite-plugin-nexa/src/index.ts"],
|
|
27
|
+
"nexa-reactivity": ["../../../reactivity/src/index.ts"],
|
|
28
|
+
"nexa-runtime": ["../../../runtime/src/index.ts"],
|
|
29
|
+
"nexa-mobile": ["../../../mobile/src/index.ts"],
|
|
30
|
+
"nexa-persistence": ["../../../persistence/src/index.ts"],
|
|
31
|
+
"nexa-compiler": ["../../../compiler/src/index.ts"],
|
|
32
|
+
"nexa-ui": ["../../../ui/src/index.ts"],
|
|
33
|
+
"nexa-devtools": ["../../../devtools/src/index.ts"],
|
|
34
|
+
"nexa-router": ["../../../router/src/index.ts"],
|
|
35
|
+
"vite": ["../../../vite-plugin-nexa/node_modules/vite"],
|
|
36
|
+
"*": ["./node_modules/*", "../../../../node_modules/*"]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.nexa", "vite.config.ts"]
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>{{name}}</title>
|
|
7
|
+
<style>
|
|
8
|
+
body {
|
|
9
|
+
margin: 0;
|
|
10
|
+
font-family: 'Inter', system-ui, -apple-system, sans-serif;
|
|
11
|
+
background-color: #020617;
|
|
12
|
+
color: #f8fafc;
|
|
13
|
+
}
|
|
14
|
+
</style>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<div id="app"></div>
|
|
18
|
+
<script type="module" src="/src/main.ts"></script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{name}}",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"preview": "vite preview"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"nexa-framework": "^0.6.0",
|
|
13
|
+
"nexa-ui": "^0.2.0",
|
|
14
|
+
"nexa-devtools": "^0.6.0",
|
|
15
|
+
"nexa-router": "^0.6.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"vite": "^6.0.0",
|
|
19
|
+
"nexa-vite-plugin": "^0.6.0",
|
|
20
|
+
"typescript": "^5.0.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { createRouter, RouterView, Link } from 'nexa-router'
|
|
3
|
+
import { NToastContainer } from 'nexa-ui'
|
|
4
|
+
import DashboardView from './views/DashboardView.nexa'
|
|
5
|
+
import UsersView from './views/UsersView.nexa'
|
|
6
|
+
|
|
7
|
+
const router = createRouter({
|
|
8
|
+
routes: [
|
|
9
|
+
{ path: '/', component: DashboardView },
|
|
10
|
+
{ path: '/users', component: UsersView }
|
|
11
|
+
]
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="pro-dashboard">
|
|
17
|
+
<NToastContainer />
|
|
18
|
+
|
|
19
|
+
<aside class="sidebar">
|
|
20
|
+
<div class="brand">Nexa<span>Pro</span></div>
|
|
21
|
+
<nav>
|
|
22
|
+
<Link to="/" :router="router" class="nav-item" :class="{ active: router.currentPath.value === '/' }">
|
|
23
|
+
Dashboard
|
|
24
|
+
</Link>
|
|
25
|
+
<Link to="/users" :router="router" class="nav-item" :class="{ active: router.currentPath.value === '/users' }">
|
|
26
|
+
Team
|
|
27
|
+
</Link>
|
|
28
|
+
</nav>
|
|
29
|
+
</aside>
|
|
30
|
+
|
|
31
|
+
<main class="content">
|
|
32
|
+
<RouterView :router="router" />
|
|
33
|
+
</main>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<style scoped>
|
|
38
|
+
.pro-dashboard {
|
|
39
|
+
display: flex;
|
|
40
|
+
min-height: 100vh;
|
|
41
|
+
background: #020617;
|
|
42
|
+
color: #f8fafc;
|
|
43
|
+
font-family: 'Outfit', sans-serif;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sidebar {
|
|
47
|
+
width: 260px;
|
|
48
|
+
background: #0f172a;
|
|
49
|
+
border-right: 1px solid #1e293b;
|
|
50
|
+
padding: 2rem;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: column;
|
|
53
|
+
gap: 2rem;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.brand {
|
|
57
|
+
font-size: 1.5rem;
|
|
58
|
+
font-weight: 900;
|
|
59
|
+
letter-spacing: -0.05em;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.brand span {
|
|
63
|
+
background: linear-gradient(to right, #3b82f6, #a855f7);
|
|
64
|
+
-webkit-background-clip: text;
|
|
65
|
+
-webkit-text-fill-color: transparent;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.nav-item {
|
|
69
|
+
display: block;
|
|
70
|
+
padding: 0.75rem 1rem;
|
|
71
|
+
border-radius: 12px;
|
|
72
|
+
color: #64748b;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
transition: all 0.2s;
|
|
75
|
+
text-decoration: none;
|
|
76
|
+
margin-bottom: 0.5rem;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.nav-item:hover {
|
|
80
|
+
color: #f8fafc;
|
|
81
|
+
background: rgba(255, 255, 255, 0.05);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.nav-item.active {
|
|
85
|
+
color: white;
|
|
86
|
+
background: #3b82f6;
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.content {
|
|
91
|
+
flex: 1;
|
|
92
|
+
padding: 3rem;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@media (max-width: 768px) {
|
|
96
|
+
.pro-dashboard { flex-direction: column; }
|
|
97
|
+
.sidebar { width: 100%; border-right: none; border-bottom: 1px solid #1e293b; }
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare module "*.nexa" {
|
|
2
|
+
import { type Component } from "nexa-framework";
|
|
3
|
+
const component: Component;
|
|
4
|
+
export default component;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface ImportMetaHot {
|
|
8
|
+
readonly data: any;
|
|
9
|
+
accept(): void;
|
|
10
|
+
accept(cb: (mod: any) => void): void;
|
|
11
|
+
accept(dep: string, cb: (mod: any) => void): void;
|
|
12
|
+
accept(deps: readonly string[], cb: (mods: any[]) => void): void;
|
|
13
|
+
dispose(cb: (data: any) => void): void;
|
|
14
|
+
decline(): void;
|
|
15
|
+
invalidate(): void;
|
|
16
|
+
on(event: string, cb: (payload: any) => void): void;
|
|
17
|
+
send(event: string, data?: any): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface ImportMeta {
|
|
21
|
+
readonly hot?: ImportMetaHot;
|
|
22
|
+
readonly env: ImportMetaEnv;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface ImportMetaEnv {
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
BASE_URL: string;
|
|
28
|
+
MODE: string;
|
|
29
|
+
DEV: boolean;
|
|
30
|
+
PROD: boolean;
|
|
31
|
+
SSR: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { signal, computed } from 'nexa-framework'
|
|
3
|
+
import {
|
|
4
|
+
NButton, NCard, NInput, NSelect, NModal,
|
|
5
|
+
NTooltip, useToast
|
|
6
|
+
} from 'nexa-ui'
|
|
7
|
+
|
|
8
|
+
const username = signal('')
|
|
9
|
+
const email = signal('')
|
|
10
|
+
const role = signal('dev')
|
|
11
|
+
const status = signal('idle')
|
|
12
|
+
const showLogs = signal(false)
|
|
13
|
+
|
|
14
|
+
const { success } = useToast()
|
|
15
|
+
|
|
16
|
+
const roles = [
|
|
17
|
+
{ label: 'Developer', value: 'dev' },
|
|
18
|
+
{ label: 'Designer', value: 'design' },
|
|
19
|
+
{ label: 'Manager', value: 'manager' }
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
const isFormValid = computed(() => {
|
|
23
|
+
return username.value.length > 2 && email.value.includes('@')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const handleSubmit = async () => {
|
|
27
|
+
if (!isFormValid.value) return
|
|
28
|
+
|
|
29
|
+
status.value = 'loading'
|
|
30
|
+
await new Promise(resolve => setTimeout(resolve, 1500))
|
|
31
|
+
|
|
32
|
+
status.value = 'success'
|
|
33
|
+
success(`Profile for ${username.value} created successfully!`)
|
|
34
|
+
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
status.value = 'idle'
|
|
37
|
+
}, 3000)
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div class="dashboard-view">
|
|
43
|
+
<header class="content-header">
|
|
44
|
+
<h1>Welcome back, <span>Developer</span></h1>
|
|
45
|
+
<p>This is your premium Nexa dashboard.</p>
|
|
46
|
+
</header>
|
|
47
|
+
|
|
48
|
+
<div class="grid">
|
|
49
|
+
<NCard title="Registration" subtitle="Create a new developer profile" hoverable>
|
|
50
|
+
<div class="form">
|
|
51
|
+
<NInput
|
|
52
|
+
label="Username"
|
|
53
|
+
v-model="username.value"
|
|
54
|
+
placeholder="e.g. nexadeveloper"
|
|
55
|
+
/>
|
|
56
|
+
<NInput
|
|
57
|
+
label="Email Address"
|
|
58
|
+
v-model="email.value"
|
|
59
|
+
type="email"
|
|
60
|
+
placeholder="hello@nexa.dev"
|
|
61
|
+
/>
|
|
62
|
+
<NSelect
|
|
63
|
+
label="Project Role"
|
|
64
|
+
v-model="role.value"
|
|
65
|
+
:options="roles"
|
|
66
|
+
/>
|
|
67
|
+
|
|
68
|
+
<div class="form-actions">
|
|
69
|
+
<NButton
|
|
70
|
+
variant="primary"
|
|
71
|
+
@click="handleSubmit"
|
|
72
|
+
:loading="status.value === 'loading'"
|
|
73
|
+
:disabled="!isFormValid.value"
|
|
74
|
+
>
|
|
75
|
+
{{ status.value === 'success' ? 'Profile Created!' : 'Create Profile' }}
|
|
76
|
+
</NButton>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</NCard>
|
|
80
|
+
|
|
81
|
+
<NCard title="System Status" subtitle="Real-time framework metrics">
|
|
82
|
+
<div class="metrics">
|
|
83
|
+
<div class="metric">
|
|
84
|
+
<span class="label">Reactivity Pulse</span>
|
|
85
|
+
<NTooltip text="Everything is running smoothly" position="right">
|
|
86
|
+
<span class="value success">Stable</span>
|
|
87
|
+
</NTooltip>
|
|
88
|
+
</div>
|
|
89
|
+
<div class="metric">
|
|
90
|
+
<span class="label">Memory Usage</span>
|
|
91
|
+
<span class="value">12.4 MB</span>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="metric">
|
|
94
|
+
<span class="label">Active Signals</span>
|
|
95
|
+
<span class="value">42</span>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<template #footer>
|
|
100
|
+
<NButton variant="glass" size="sm" @click="showLogs.value = true">
|
|
101
|
+
View Full Logs
|
|
102
|
+
</NButton>
|
|
103
|
+
</template>
|
|
104
|
+
</NCard>
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
<!-- Modal for Logs -->
|
|
108
|
+
<NModal
|
|
109
|
+
:show="showLogs.value"
|
|
110
|
+
title="System Logs"
|
|
111
|
+
@close="showLogs.value = false"
|
|
112
|
+
>
|
|
113
|
+
<div class="log-viewer">
|
|
114
|
+
<div class="log-entry">[14:20:01] Reactivity engine initialized...</div>
|
|
115
|
+
<div class="log-entry">[14:20:05] VDOM patch successful (32 nodes)</div>
|
|
116
|
+
<div class="log-entry">[14:21:10] Hot Module Replacement active</div>
|
|
117
|
+
<div class="log-entry info">[14:25:32] DevTools mounted to #nexa-devtools-root</div>
|
|
118
|
+
</div>
|
|
119
|
+
<template #footer>
|
|
120
|
+
<NButton variant="secondary" @click="showLogs.value = false">Close</NButton>
|
|
121
|
+
<NButton variant="primary" @click="success('Logs cleared!')">Clear Logs</NButton>
|
|
122
|
+
</template>
|
|
123
|
+
</NModal>
|
|
124
|
+
</div>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<style scoped>
|
|
128
|
+
.content-header h1 {
|
|
129
|
+
font-size: 2.5rem;
|
|
130
|
+
font-weight: 800;
|
|
131
|
+
margin-bottom: 0.5rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.content-header h1 span {
|
|
135
|
+
color: #3b82f6;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.content-header p {
|
|
139
|
+
color: #64748b;
|
|
140
|
+
margin-bottom: 3rem;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.grid {
|
|
144
|
+
display: grid;
|
|
145
|
+
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
|
146
|
+
gap: 2rem;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.form {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-direction: column;
|
|
152
|
+
gap: 1.5rem;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.form-actions {
|
|
156
|
+
margin-top: 1rem;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.metrics {
|
|
160
|
+
display: flex;
|
|
161
|
+
flex-direction: column;
|
|
162
|
+
gap: 1rem;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.metric {
|
|
166
|
+
display: flex;
|
|
167
|
+
justify-content: space-between;
|
|
168
|
+
align-items: center;
|
|
169
|
+
padding: 0.75rem;
|
|
170
|
+
background: rgba(15, 23, 42, 0.5);
|
|
171
|
+
border-radius: 12px;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.metric .label { color: #94a3b8; }
|
|
175
|
+
.metric .value { font-weight: 700; }
|
|
176
|
+
.metric .value.success { color: #10b981; }
|
|
177
|
+
|
|
178
|
+
.log-viewer {
|
|
179
|
+
background: #020617;
|
|
180
|
+
padding: 1rem;
|
|
181
|
+
border-radius: 12px;
|
|
182
|
+
font-family: 'JetBrains Mono', monospace;
|
|
183
|
+
font-size: 0.8rem;
|
|
184
|
+
max-height: 200px;
|
|
185
|
+
overflow-y: auto;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.log-entry {
|
|
189
|
+
padding: 0.25rem 0;
|
|
190
|
+
color: #94a3b8;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.log-entry.info {
|
|
194
|
+
color: #3b82f6;
|
|
195
|
+
}
|
|
196
|
+
</style>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { NCard, NBadge } from 'nexa-ui'
|
|
3
|
+
|
|
4
|
+
const users = [
|
|
5
|
+
{ id: 1, name: 'Alice Freeman', role: 'Admin', status: 'Online' },
|
|
6
|
+
{ id: 2, name: 'Bob Smith', role: 'Editor', status: 'Offline' },
|
|
7
|
+
{ id: 3, name: 'Charlie Day', role: 'Viewer', status: 'Online' }
|
|
8
|
+
]
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="users-view">
|
|
13
|
+
<header class="content-header">
|
|
14
|
+
<h1>Team <span>Management</span></h1>
|
|
15
|
+
<p>Manage your workspace members and permissions.</p>
|
|
16
|
+
</header>
|
|
17
|
+
|
|
18
|
+
<NCard title="Active Members">
|
|
19
|
+
<div class="user-list">
|
|
20
|
+
<div v-for="user in users" :key="user.id" class="user-row">
|
|
21
|
+
<div class="user-info">
|
|
22
|
+
<div class="user-avatar">{{ user.name[0] }}</div>
|
|
23
|
+
<div>
|
|
24
|
+
<div class="user-name">{{ user.name }}</div>
|
|
25
|
+
<div class="user-role">{{ user.role }}</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<NBadge :variant="user.status === 'Online' ? 'success' : 'secondary'">
|
|
29
|
+
{{ user.status }}
|
|
30
|
+
</NBadge>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</NCard>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<style scoped>
|
|
38
|
+
.content-header h1 {
|
|
39
|
+
font-size: 2.5rem;
|
|
40
|
+
font-weight: 800;
|
|
41
|
+
margin-bottom: 0.5rem;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.content-header h1 span {
|
|
45
|
+
color: #3b82f6;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.content-header p {
|
|
49
|
+
color: #64748b;
|
|
50
|
+
margin-bottom: 3rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.user-list {
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
gap: 1rem;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.user-row {
|
|
60
|
+
display: flex;
|
|
61
|
+
justify-content: space-between;
|
|
62
|
+
align-items: center;
|
|
63
|
+
padding: 1rem;
|
|
64
|
+
background: rgba(255, 255, 255, 0.02);
|
|
65
|
+
border-radius: 12px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.user-info {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 1rem;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.user-avatar {
|
|
75
|
+
width: 40px;
|
|
76
|
+
height: 40px;
|
|
77
|
+
background: #3b82f6;
|
|
78
|
+
border-radius: 10px;
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
font-weight: 700;
|
|
83
|
+
color: white;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.user-name {
|
|
87
|
+
font-weight: 600;
|
|
88
|
+
color: #f8fafc;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.user-role {
|
|
92
|
+
font-size: 0.8rem;
|
|
93
|
+
color: #64748b;
|
|
94
|
+
}
|
|
95
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
|
|
9
|
+
/* Bundler mode */
|
|
10
|
+
"moduleResolution": "bundler",
|
|
11
|
+
"allowImportingTsExtensions": true,
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"isolatedModules": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"jsx": "preserve",
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
|
|
23
|
+
"baseUrl": ".",
|
|
24
|
+
"paths": {
|
|
25
|
+
"nexa-framework": ["./node_modules/nexa-framework/dist/index.d.ts", "../../../nexa/src/index.ts"],
|
|
26
|
+
"nexa-vite-plugin": ["./node_modules/nexa-vite-plugin/dist/index.d.ts", "../../../vite-plugin-nexa/src/index.ts"],
|
|
27
|
+
"nexa-reactivity": ["../../../reactivity/src/index.ts"],
|
|
28
|
+
"nexa-runtime": ["../../../runtime/src/index.ts"],
|
|
29
|
+
"nexa-mobile": ["../../../mobile/src/index.ts"],
|
|
30
|
+
"nexa-persistence": ["../../../persistence/src/index.ts"],
|
|
31
|
+
"nexa-compiler": ["../../../compiler/src/index.ts"],
|
|
32
|
+
"nexa-ui": ["../../../ui/src/index.ts"],
|
|
33
|
+
"nexa-devtools": ["../../../devtools/src/index.ts"],
|
|
34
|
+
"nexa-router": ["../../../router/src/index.ts"],
|
|
35
|
+
"vite": ["../../../vite-plugin-nexa/node_modules/vite"],
|
|
36
|
+
"*": ["./node_modules/*", "../../../../node_modules/*"]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.nexa", "vite.config.ts"]
|
|
40
|
+
}
|
package/dist/cli.d.ts
DELETED