create-nativecore 0.1.1 → 0.2.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/README.md +6 -14
- package/bin/index.mjs +402 -431
- package/package.json +3 -2
- package/template/.env.example +28 -0
- package/template/.htmlhintrc +14 -0
- package/template/api/data/dashboard.json +11 -0
- package/template/api/data/users.json +18 -0
- package/template/api/mockApi.js +161 -0
- package/template/assets/icon.svg +13 -0
- package/template/assets/logo.svg +25 -0
- package/template/eslint.config.js +94 -0
- package/template/index.html +137 -0
- package/template/manifest.json +19 -0
- package/template/public/.well-known/security.txt +9 -0
- package/template/public/_headers +24 -0
- package/template/public/_redirects +14 -0
- package/template/public/assets/icon.svg +13 -0
- package/template/public/assets/logo.svg +25 -0
- package/template/public/manifest.json +19 -0
- package/template/public/robots.txt +13 -0
- package/template/public/sitemap.xml +27 -0
- package/template/scripts/build-for-bots.mjs +121 -0
- package/template/scripts/convert-to-ts.mjs +106 -0
- package/template/scripts/fix-encoding.mjs +38 -0
- package/template/scripts/fix-svg-paths.mjs +32 -0
- package/template/scripts/generate-cf-router.mjs +52 -0
- package/template/scripts/inject-dev-tools.mjs +41 -0
- package/template/scripts/inject-version.mjs +65 -0
- package/template/scripts/make-component.mjs +445 -0
- package/template/scripts/make-component.mjs.backup +432 -0
- package/template/scripts/make-controller.mjs +119 -0
- package/template/scripts/make-core-component.mjs +303 -0
- package/template/scripts/make-view.mjs +346 -0
- package/template/scripts/minify.mjs +71 -0
- package/template/scripts/prepare-static-assets.mjs +141 -0
- package/template/scripts/prompt-bot-build.mjs +223 -0
- package/template/scripts/remove-component.mjs +170 -0
- package/template/scripts/remove-core-component.mjs +156 -0
- package/template/scripts/remove-dev.mjs +13 -0
- package/template/scripts/remove-view.mjs +200 -0
- package/template/scripts/strip-dev-blocks.mjs +30 -0
- package/template/scripts/watch-compile.mjs +69 -0
- package/template/server.js +1066 -0
- package/template/src/app.ts +115 -0
- package/template/src/components/appRegistry.ts +8 -0
- package/template/src/components/core/app-footer.ts +27 -0
- package/template/src/components/core/app-header.ts +175 -0
- package/template/src/components/core/app-sidebar.ts +238 -0
- package/template/src/components/core/loading-spinner.ts +25 -0
- package/template/src/components/core/nc-a.ts +313 -0
- package/template/src/components/core/nc-accordion.ts +186 -0
- package/template/src/components/core/nc-alert.ts +153 -0
- package/template/src/components/core/nc-animation.ts +1150 -0
- package/template/src/components/core/nc-autocomplete.ts +271 -0
- package/template/src/components/core/nc-avatar-group.ts +113 -0
- package/template/src/components/core/nc-avatar.ts +148 -0
- package/template/src/components/core/nc-badge.ts +86 -0
- package/template/src/components/core/nc-bottom-nav.ts +214 -0
- package/template/src/components/core/nc-breadcrumb.ts +96 -0
- package/template/src/components/core/nc-button.ts +307 -0
- package/template/src/components/core/nc-card.ts +160 -0
- package/template/src/components/core/nc-checkbox.ts +282 -0
- package/template/src/components/core/nc-chip.ts +115 -0
- package/template/src/components/core/nc-code.ts +314 -0
- package/template/src/components/core/nc-collapsible.ts +154 -0
- package/template/src/components/core/nc-color-picker.ts +268 -0
- package/template/src/components/core/nc-copy-button.ts +119 -0
- package/template/src/components/core/nc-date-picker.ts +443 -0
- package/template/src/components/core/nc-div.ts +280 -0
- package/template/src/components/core/nc-divider.ts +81 -0
- package/template/src/components/core/nc-drawer.ts +230 -0
- package/template/src/components/core/nc-dropdown.ts +178 -0
- package/template/src/components/core/nc-empty-state.ts +134 -0
- package/template/src/components/core/nc-file-upload.ts +354 -0
- package/template/src/components/core/nc-form.ts +312 -0
- package/template/src/components/core/nc-image.ts +184 -0
- package/template/src/components/core/nc-input.ts +383 -0
- package/template/src/components/core/nc-kbd.ts +48 -0
- package/template/src/components/core/nc-menu-item.ts +193 -0
- package/template/src/components/core/nc-menu.ts +376 -0
- package/template/src/components/core/nc-modal.ts +238 -0
- package/template/src/components/core/nc-nav-item.ts +151 -0
- package/template/src/components/core/nc-number-input.ts +350 -0
- package/template/src/components/core/nc-otp-input.ts +235 -0
- package/template/src/components/core/nc-pagination.ts +178 -0
- package/template/src/components/core/nc-popover.ts +260 -0
- package/template/src/components/core/nc-progress-circular.ts +119 -0
- package/template/src/components/core/nc-progress.ts +134 -0
- package/template/src/components/core/nc-radio.ts +235 -0
- package/template/src/components/core/nc-rating.ts +266 -0
- package/template/src/components/core/nc-rich-text.ts +283 -0
- package/template/src/components/core/nc-scroll-top.ts +116 -0
- package/template/src/components/core/nc-select.ts +452 -0
- package/template/src/components/core/nc-skeleton.ts +107 -0
- package/template/src/components/core/nc-slider.ts +285 -0
- package/template/src/components/core/nc-snackbar.ts +230 -0
- package/template/src/components/core/nc-splash.ts +343 -0
- package/template/src/components/core/nc-stepper.ts +247 -0
- package/template/src/components/core/nc-switch.ts +281 -0
- package/template/src/components/core/nc-tab-item.ts +138 -0
- package/template/src/components/core/nc-table.ts +279 -0
- package/template/src/components/core/nc-tabs.ts +554 -0
- package/template/src/components/core/nc-tag-input.ts +279 -0
- package/template/src/components/core/nc-textarea.ts +216 -0
- package/template/src/components/core/nc-time-picker.ts +438 -0
- package/template/src/components/core/nc-timeline.ts +186 -0
- package/template/src/components/core/nc-tooltip.ts +143 -0
- package/template/src/components/frameworkRegistry.ts +68 -0
- package/template/src/components/preloadRegistry.ts +28 -0
- package/template/src/components/registry.ts +8 -0
- package/template/src/components/ui/dashboard-signal-lab.ts +284 -0
- package/template/src/constants/apiEndpoints.ts +27 -0
- package/template/src/constants/errorMessages.ts +23 -0
- package/template/src/constants/index.ts +8 -0
- package/template/src/constants/routePaths.ts +15 -0
- package/template/src/constants/storageKeys.ts +18 -0
- package/template/src/controllers/dashboard.controller.ts +200 -0
- package/template/src/controllers/home.controller.ts +21 -0
- package/template/src/controllers/index.ts +11 -0
- package/template/src/controllers/login.controller.ts +131 -0
- package/template/src/core/component.ts +354 -0
- package/template/src/core/errorHandler.ts +85 -0
- package/template/src/core/gpu-animation.ts +604 -0
- package/template/src/core/http.ts +173 -0
- package/template/src/core/lazyComponents.ts +90 -0
- package/template/src/core/router.ts +642 -0
- package/template/src/core/signals.ts +146 -0
- package/template/src/core/state.ts +248 -0
- package/template/src/dev/component-editor.ts +1363 -0
- package/template/src/dev/component-overlay.ts +278 -0
- package/template/src/dev/context-menu.ts +223 -0
- package/template/src/dev/denc-tools.ts +250 -0
- package/template/src/dev/hmr.ts +189 -0
- package/template/src/dev/nfbs.code-workspace +27 -0
- package/template/src/dev/outline-panel.ts +1247 -0
- package/template/src/middleware/auth.middleware.ts +23 -0
- package/template/src/routes/routes.ts +38 -0
- package/template/src/services/api.service.ts +394 -0
- package/template/src/services/auth.service.ts +176 -0
- package/template/src/services/index.ts +8 -0
- package/template/src/services/logger.service.ts +74 -0
- package/template/src/services/storage.service.ts +88 -0
- package/template/src/stores/appStore.ts +57 -0
- package/template/src/stores/uiStore.ts +36 -0
- package/template/src/styles/core-variables.css +219 -0
- package/template/src/styles/core.css +710 -0
- package/template/src/styles/main.css +3164 -0
- package/template/src/styles/variables.css +152 -0
- package/template/src/types/global.d.ts +47 -0
- package/template/src/utils/cacheBuster.ts +20 -0
- package/template/src/utils/dom.ts +149 -0
- package/template/src/utils/events.ts +203 -0
- package/template/src/utils/form.ts +176 -0
- package/template/src/utils/formatters.ts +169 -0
- package/template/src/utils/helpers.ts +195 -0
- package/template/src/utils/markdown.ts +307 -0
- package/template/src/utils/sidebar.ts +96 -0
- package/template/src/utils/smoothScroll.ts +85 -0
- package/template/src/utils/templates.ts +23 -0
- package/template/src/utils/validation.ts +73 -0
- package/template/src/views/protected/dashboard.html +293 -0
- package/template/src/views/public/home.html +150 -0
- package/template/src/views/public/login.html +102 -0
- package/template/tests/unit/component.test.ts +87 -0
- package/template/tests/unit/computed.test.ts +79 -0
- package/template/tests/unit/form.test.ts +68 -0
- package/template/tests/unit/formatters.test.ts +49 -0
- package/template/tests/unit/lazy-components.test.ts +59 -0
- package/template/tests/unit/markdown.test.ts +62 -0
- package/template/tests/unit/router.test.ts +112 -0
- package/template/tests/unit/signals.test.ts +54 -0
- package/template/tests/unit/validation.test.ts +50 -0
- package/template/tsconfig.build.json +21 -0
- package/template/tsconfig.json +51 -0
- package/template/vitest.config.ts +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nativecore",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Interactive CLI for scaffolding NativeCore applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nativecore",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
25
25
|
"bin",
|
|
26
|
-
"README.md"
|
|
26
|
+
"README.md",
|
|
27
|
+
"template"
|
|
27
28
|
],
|
|
28
29
|
"scripts": {
|
|
29
30
|
"build": "echo create-nativecore is a direct CLI package"
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Environment Configuration Template
|
|
2
|
+
# Copy this file to .env and update with your values
|
|
3
|
+
# DO NOT commit .env to version control
|
|
4
|
+
|
|
5
|
+
# Application Environment
|
|
6
|
+
# Options: development, staging, production
|
|
7
|
+
NODE_ENV=development
|
|
8
|
+
|
|
9
|
+
# API Configuration
|
|
10
|
+
API_BASE_URL=http://localhost:8000/api
|
|
11
|
+
API_TIMEOUT=30000
|
|
12
|
+
|
|
13
|
+
# Authentication
|
|
14
|
+
# Options: memory, session, local
|
|
15
|
+
AUTH_STORAGE_STRATEGY=session
|
|
16
|
+
|
|
17
|
+
# Application Info
|
|
18
|
+
APP_NAME=MyApp
|
|
19
|
+
APP_VERSION=1.0.0
|
|
20
|
+
|
|
21
|
+
# Feature Flags
|
|
22
|
+
FEATURE_ANALYTICS=false
|
|
23
|
+
FEATURE_DARK_MODE=false
|
|
24
|
+
FEATURE_DEBUG_MODE=true
|
|
25
|
+
|
|
26
|
+
# Backend URLs (if using external API)
|
|
27
|
+
# BACKEND_API_URL=https://api.yourdomain.com
|
|
28
|
+
# BACKEND_AUTH_URL=https://auth.yourdomain.com
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tagname-lowercase": false,
|
|
3
|
+
"attr-lowercase": true,
|
|
4
|
+
"attr-value-double-quotes": true,
|
|
5
|
+
"attr-no-duplication": true,
|
|
6
|
+
"doctype-first": false,
|
|
7
|
+
"tag-pair": true,
|
|
8
|
+
"spec-char-escape": true,
|
|
9
|
+
"id-unique": true,
|
|
10
|
+
"src-not-empty": true,
|
|
11
|
+
"alt-require": true,
|
|
12
|
+
"space-tab-mixed-disabled": "space",
|
|
13
|
+
"attr-unsafe-chars": true
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"users": 1234,
|
|
3
|
+
"sessions": 56,
|
|
4
|
+
"revenue": 45678,
|
|
5
|
+
"newToday": 23,
|
|
6
|
+
"recentActivity": [
|
|
7
|
+
{ "id": 1, "message": "New user registered", "time": "5 minutes ago" },
|
|
8
|
+
{ "id": 2, "message": "Payment received", "time": "12 minutes ago" },
|
|
9
|
+
{ "id": 3, "message": "System backup completed", "time": "1 hour ago" }
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"users": [
|
|
3
|
+
{
|
|
4
|
+
"id": 1,
|
|
5
|
+
"email": "demo@example.com",
|
|
6
|
+
"password": "pa$$w0rd",
|
|
7
|
+
"name": "Demo User",
|
|
8
|
+
"role": "admin"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": 2,
|
|
12
|
+
"email": "user@example.com",
|
|
13
|
+
"password": "password",
|
|
14
|
+
"name": "Test User",
|
|
15
|
+
"role": "user"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock API Helper Functions
|
|
3
|
+
*/
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import path from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
|
|
11
|
+
// Simple JWT-like token generation for local development only.
|
|
12
|
+
function generateToken(user) {
|
|
13
|
+
const header = Buffer.from(JSON.stringify({ alg: 'none', typ: 'JWT' })).toString('base64url');
|
|
14
|
+
const payload = {
|
|
15
|
+
userId: user.id,
|
|
16
|
+
email: user.email,
|
|
17
|
+
name: user.name,
|
|
18
|
+
role: user.role,
|
|
19
|
+
exp: Math.floor(Date.now() / 1000) + (60 * 60) // 1 hour expiry
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const payloadSegment = Buffer.from(JSON.stringify(payload)).toString('base64url');
|
|
23
|
+
return `${header}.${payloadSegment}.mock`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Read JSON file
|
|
27
|
+
function readJSON(filename) {
|
|
28
|
+
const filePath = path.join(__dirname, 'data', filename);
|
|
29
|
+
const data = fs.readFileSync(filePath, 'utf8');
|
|
30
|
+
return JSON.parse(data);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Handle login
|
|
34
|
+
function handleLogin(body) {
|
|
35
|
+
const { email, password } = body;
|
|
36
|
+
const data = readJSON('users.json');
|
|
37
|
+
|
|
38
|
+
const user = data.users.find(u => u.email === email && u.password === password);
|
|
39
|
+
|
|
40
|
+
if (!user) {
|
|
41
|
+
return {
|
|
42
|
+
status: 401,
|
|
43
|
+
data: { error: 'Invalid email or password' }
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const accessToken = generateToken(user);
|
|
48
|
+
const refreshToken = generateToken(user); // Same for demo
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
status: 200,
|
|
52
|
+
data: {
|
|
53
|
+
accessToken,
|
|
54
|
+
refreshToken,
|
|
55
|
+
user: {
|
|
56
|
+
id: user.id,
|
|
57
|
+
name: user.name,
|
|
58
|
+
email: user.email,
|
|
59
|
+
role: user.role
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Handle dashboard stats
|
|
66
|
+
function handleDashboard() {
|
|
67
|
+
const data = readJSON('dashboard.json');
|
|
68
|
+
return {
|
|
69
|
+
status: 200,
|
|
70
|
+
data
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function handleVerify(user) {
|
|
75
|
+
return {
|
|
76
|
+
status: 200,
|
|
77
|
+
data: {
|
|
78
|
+
authenticated: true,
|
|
79
|
+
user: {
|
|
80
|
+
id: user.userId,
|
|
81
|
+
email: user.email,
|
|
82
|
+
name: user.name,
|
|
83
|
+
role: user.role
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function handleUserDetail(userId) {
|
|
90
|
+
const data = readJSON('users.json');
|
|
91
|
+
const user = data.users.find(u => String(u.id) === String(userId));
|
|
92
|
+
|
|
93
|
+
if (!user) {
|
|
94
|
+
return {
|
|
95
|
+
status: 404,
|
|
96
|
+
data: { error: 'User not found' }
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
status: 200,
|
|
102
|
+
data: {
|
|
103
|
+
id: user.id,
|
|
104
|
+
email: user.email,
|
|
105
|
+
name: user.name,
|
|
106
|
+
role: user.role,
|
|
107
|
+
createdAt: new Date('2026-01-01T00:00:00.000Z').toISOString()
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Verify token (simplified - just check if exists)
|
|
113
|
+
function verifyToken(authHeader) {
|
|
114
|
+
if (!authHeader || !authHeader.startsWith('Bearer ')) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const token = authHeader.split(' ')[1];
|
|
119
|
+
|
|
120
|
+
const parsePayload = (rawToken) => {
|
|
121
|
+
if (!rawToken) return null;
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
if (rawToken.includes('.')) {
|
|
125
|
+
const [, payloadSegment] = rawToken.split('.');
|
|
126
|
+
if (!payloadSegment) return null;
|
|
127
|
+
|
|
128
|
+
const normalized = payloadSegment.replace(/-/g, '+').replace(/_/g, '/');
|
|
129
|
+
const padded = normalized.padEnd(normalized.length + ((4 - normalized.length % 4) % 4), '=');
|
|
130
|
+
return JSON.parse(Buffer.from(padded, 'base64').toString());
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return JSON.parse(Buffer.from(rawToken, 'base64').toString());
|
|
134
|
+
} catch {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
try {
|
|
140
|
+
const payload = parsePayload(token);
|
|
141
|
+
if (!payload) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Check if expired
|
|
146
|
+
if (payload.exp && payload.exp < Math.floor(Date.now() / 1000)) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
return payload;
|
|
150
|
+
} catch (e) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export {
|
|
156
|
+
handleLogin,
|
|
157
|
+
handleDashboard,
|
|
158
|
+
handleVerify,
|
|
159
|
+
handleUserDetail,
|
|
160
|
+
verifyToken
|
|
161
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title>NativeCore Icon</title>
|
|
3
|
+
<desc>Green circular mark with a white play triangle</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="bg" x1="64" y1="64" x2="448" y2="448" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop offset="0" stop-color="#34d399"/>
|
|
7
|
+
<stop offset="1" stop-color="#059669"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
<rect width="512" height="512" rx="120" fill="#0f172a"/>
|
|
11
|
+
<circle cx="256" cy="256" r="150" fill="url(#bg)"/>
|
|
12
|
+
<path d="M221 180l122 76-122 76V180z" fill="#ffffff"/>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title>NativeCore Logo</title>
|
|
3
|
+
<desc>Rounded dark square containing a geometric teal N with a circular core at the center.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="nativecore-bg" x1="86" y1="64" x2="430" y2="448" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop offset="0" stop-color="#132238"/>
|
|
7
|
+
<stop offset="1" stop-color="#09111d"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="nativecore-mark" x1="120" y1="104" x2="372" y2="394" gradientUnits="userSpaceOnUse">
|
|
10
|
+
<stop offset="0" stop-color="#8bf5d4"/>
|
|
11
|
+
<stop offset="0.55" stop-color="#42d6c5"/>
|
|
12
|
+
<stop offset="1" stop-color="#1595c9"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
<linearGradient id="nativecore-ring" x1="188" y1="180" x2="325" y2="337" gradientUnits="userSpaceOnUse">
|
|
15
|
+
<stop offset="0" stop-color="#effcff" stop-opacity="0.96"/>
|
|
16
|
+
<stop offset="1" stop-color="#b9f7f0" stop-opacity="0.82"/>
|
|
17
|
+
</linearGradient>
|
|
18
|
+
</defs>
|
|
19
|
+
<rect width="512" height="512" rx="128" fill="url(#nativecore-bg)"/>
|
|
20
|
+
<rect x="22" y="22" width="468" height="468" rx="106" fill="none" stroke="#ffffff" stroke-opacity="0.08"/>
|
|
21
|
+
<path fill="url(#nativecore-mark)" d="M137 114h63l117 147V114h58v284h-63L195 251v147h-58V114z"/>
|
|
22
|
+
<circle cx="256" cy="256" r="71" fill="#09111d"/>
|
|
23
|
+
<circle cx="256" cy="256" r="55" fill="none" stroke="url(#nativecore-ring)" stroke-width="18"/>
|
|
24
|
+
<circle cx="256" cy="256" r="14" fill="#8bf5d4"/>
|
|
25
|
+
</svg>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import globals from 'globals';
|
|
3
|
+
import tseslint from 'typescript-eslint';
|
|
4
|
+
|
|
5
|
+
export default tseslint.config(
|
|
6
|
+
js.configs.recommended,
|
|
7
|
+
...tseslint.configs.recommended,
|
|
8
|
+
{
|
|
9
|
+
languageOptions: {
|
|
10
|
+
ecmaVersion: 'latest',
|
|
11
|
+
sourceType: 'module',
|
|
12
|
+
globals: {
|
|
13
|
+
...globals.browser,
|
|
14
|
+
...globals.node,
|
|
15
|
+
...globals.es2021
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
rules: {
|
|
19
|
+
'no-console': 'off',
|
|
20
|
+
'no-debugger': 'error',
|
|
21
|
+
'no-var': 'error',
|
|
22
|
+
'prefer-const': 'error',
|
|
23
|
+
'prefer-arrow-callback': 'warn',
|
|
24
|
+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
25
|
+
'@typescript-eslint/no-explicit-any': 'off', // Framework code needs flexible typing
|
|
26
|
+
|
|
27
|
+
'no-restricted-globals': [
|
|
28
|
+
'error',
|
|
29
|
+
{
|
|
30
|
+
name: 'event',
|
|
31
|
+
message: 'Use local event parameter instead of global \'event\''
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
|
|
35
|
+
'no-restricted-syntax': [
|
|
36
|
+
'error',
|
|
37
|
+
{
|
|
38
|
+
selector: 'CallExpression[callee.object.name=\'document\'][callee.property.name=\'querySelector\']',
|
|
39
|
+
message: 'Use dom.query() in controllers or this.$() in components instead of document.querySelector()'
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
selector: 'CallExpression[callee.object.name=\'document\'][callee.property.name=\'querySelectorAll\']',
|
|
43
|
+
message: 'Use dom.queryAll() in controllers or this.$$() in components instead of document.querySelectorAll()'
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
selector: 'CallExpression[callee.object.name=\'document\'][callee.property.name=\'getElementById\']',
|
|
47
|
+
message: 'Use dom.query() in controllers or this.$() in components instead of document.getElementById()'
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
selector: 'CallExpression[callee.object.name=\'document\'][callee.property.name=\'getElementsByClassName\']',
|
|
51
|
+
message: 'Use dom.queryAll() in controllers or this.$$() in components instead of document.getElementsByClassName()'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
selector: 'CallExpression[callee.object.name=\'document\'][callee.property.name=\'getElementsByTagName\']',
|
|
55
|
+
message: 'Use dom.queryAll() in controllers or this.$$() in components instead of document.getElementsByTagName()'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
selector: 'MemberExpression[object.name=\'element\'][property.name=\'innerHTML\']',
|
|
59
|
+
message: 'Avoid innerHTML for security. Use textContent or render() method instead'
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
|
|
63
|
+
'no-eval': 'error',
|
|
64
|
+
'no-implied-eval': 'error',
|
|
65
|
+
'no-new-func': 'error'
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
// Controllers and router - allow document.querySelector since they're not components
|
|
70
|
+
files: ['src/controllers/**/*.{js,ts}', 'src/core/router.{js,ts}', 'src/app.{js,ts}', 'src/utils/**/*.{js,ts}'],
|
|
71
|
+
rules: {
|
|
72
|
+
'no-restricted-syntax': 'off'
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
// Dev tools - need direct DOM access at framework level
|
|
77
|
+
files: ['src/dev/**/*.{js,ts}'],
|
|
78
|
+
rules: {
|
|
79
|
+
'no-restricted-syntax': 'off'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
// Scripts and test files - relaxed rules
|
|
84
|
+
files: ['scripts/**/*.{js,mjs}', '*.test.{js,ts}', '*.spec.{js,ts}', 'tests/**/*.{js,ts}'],
|
|
85
|
+
rules: {
|
|
86
|
+
'no-restricted-syntax': 'off',
|
|
87
|
+
'no-console': 'off'
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
// Ignore patterns
|
|
92
|
+
ignores: ['node_modules/**', 'dist/**', 'build/**']
|
|
93
|
+
}
|
|
94
|
+
);
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en" prefix="og: https://ogp.me/ns#" data-public-route="ready">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
7
|
+
<base href="/">
|
|
8
|
+
<!-- Primary Meta Tags -->
|
|
9
|
+
<title>NativeCore | Modern Reactive JavaScript Framework</title>
|
|
10
|
+
<meta name="title" content="NativeCore | Modern Reactive JavaScript Framework">
|
|
11
|
+
<meta name="description" content="A modern, lightweight reactive framework using vanilla JavaScript, Web Components, reactive signals, and zero dependencies. Fast, simple, and powerful.">
|
|
12
|
+
<meta name="keywords" content="NativeCore, JavaScript framework, reactive signals, Web Components, vanilla JS, SPA, lightweight, TypeScript, frontend framework">
|
|
13
|
+
<meta name="author" content="NativeCore Framework">
|
|
14
|
+
<meta name="robots" content="index, follow">
|
|
15
|
+
<meta name="language" content="English">
|
|
16
|
+
<meta name="revisit-after" content="7 days">
|
|
17
|
+
<!-- Canonical URL -->
|
|
18
|
+
<link rel="canonical" href="https://nativecorejs.com/">
|
|
19
|
+
<!-- Open Graph / Facebook -->
|
|
20
|
+
<meta property="og:type" content="website">
|
|
21
|
+
<meta property="og:url" content="https://nativecorejs.com/">
|
|
22
|
+
<meta property="og:title" content="NativeCore | Modern Reactive JavaScript Framework">
|
|
23
|
+
<meta property="og:description" content="A modern, lightweight reactive framework using vanilla JavaScript, Web Components, reactive signals, and zero dependencies.">
|
|
24
|
+
<meta property="og:image" content="https://nativecorejs.com/assets/og-image.png">
|
|
25
|
+
<meta property="og:site_name" content="NativeCore Framework">
|
|
26
|
+
<meta property="og:locale" content="en_US">
|
|
27
|
+
<!-- Twitter Card -->
|
|
28
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
29
|
+
<meta name="twitter:url" content="https://nativecorejs.com/">
|
|
30
|
+
<meta name="twitter:title" content="NativeCore | Modern Reactive JavaScript Framework">
|
|
31
|
+
<meta name="twitter:description" content="A modern, lightweight reactive framework using vanilla JavaScript, Web Components, reactive signals, and zero dependencies.">
|
|
32
|
+
<meta name="twitter:image" content="https://nativecorejs.com/assets/twitter-card.png">
|
|
33
|
+
<meta name="twitter:creator" content="@nativecorejs">
|
|
34
|
+
<!-- Inline SVG favicon to prevent fetch requests -->
|
|
35
|
+
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>N</text></svg>">
|
|
36
|
+
<link rel="apple-touch-icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>N</text></svg>">
|
|
37
|
+
<!-- PWA Manifest -->
|
|
38
|
+
<link rel="manifest" href="/manifest.json">
|
|
39
|
+
<style>
|
|
40
|
+
html[data-public-route="pending"] body {
|
|
41
|
+
visibility: hidden;
|
|
42
|
+
opacity: 0;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
45
|
+
<script>
|
|
46
|
+
(function() {
|
|
47
|
+
const isRootPath = window.location.pathname === '/';
|
|
48
|
+
if (!isRootPath) {
|
|
49
|
+
document.documentElement.setAttribute('data-public-route', 'pending');
|
|
50
|
+
window.addEventListener('pageloaded', function handlePageLoaded() {
|
|
51
|
+
document.documentElement.setAttribute('data-public-route', 'ready');
|
|
52
|
+
window.removeEventListener('pageloaded', handlePageLoaded);
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
document.documentElement.setAttribute('data-public-route', 'ready');
|
|
57
|
+
})();
|
|
58
|
+
</script>
|
|
59
|
+
<!-- JSON-LD Structured Data -->
|
|
60
|
+
<script type="application/ld+json">
|
|
61
|
+
{
|
|
62
|
+
"@context": "https://schema.org",
|
|
63
|
+
"@type": "WebApplication",
|
|
64
|
+
"name": "NativeCore Framework",
|
|
65
|
+
"alternateName": "NativeCore",
|
|
66
|
+
"url": "https://nativecorejs.com",
|
|
67
|
+
"logo": "https://nativecorejs.com/assets/logo.svg",
|
|
68
|
+
"description": "A modern, lightweight reactive framework using vanilla JavaScript, Web Components, reactive signals, and zero dependencies.",
|
|
69
|
+
"applicationCategory": "DeveloperApplication",
|
|
70
|
+
"operatingSystem": "Any",
|
|
71
|
+
"offers": {
|
|
72
|
+
"@type": "Offer",
|
|
73
|
+
"price": "0",
|
|
74
|
+
"priceCurrency": "USD"
|
|
75
|
+
},
|
|
76
|
+
"author": {
|
|
77
|
+
"@type": "Organization",
|
|
78
|
+
"name": "NativeCore Framework",
|
|
79
|
+
"url": "https://nativecorejs.com"
|
|
80
|
+
},
|
|
81
|
+
"keywords": "NativeCore, JavaScript framework, reactive signals, Web Components, vanilla JS"
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
<!-- Stylesheets with cache busting -->
|
|
85
|
+
<script>
|
|
86
|
+
(function() {
|
|
87
|
+
const isDev = location.hostname === 'localhost' || location.hostname === '127.0.0.1';
|
|
88
|
+
const version = isDev ? Date.now() : '1.0.0-20260414231644';
|
|
89
|
+
const modulePreloads = [
|
|
90
|
+
'/dist/app.js',
|
|
91
|
+
'/dist/controllers/home.controller.js',
|
|
92
|
+
'/dist/components/core/app-header.js',
|
|
93
|
+
'/dist/components/core/app-sidebar.js',
|
|
94
|
+
'/dist/components/core/app-footer.js',
|
|
95
|
+
'/dist/components/core/loading-spinner.js',
|
|
96
|
+
'/dist/components/core/nc-a.js',
|
|
97
|
+
'/dist/components/core/nc-scroll-top.js',
|
|
98
|
+
'/dist/components/core/nc-snackbar.js'
|
|
99
|
+
];
|
|
100
|
+
modulePreloads.forEach(path => {
|
|
101
|
+
document.write(`<link rel="modulepreload" href="${path}?v=${version}">`);
|
|
102
|
+
});
|
|
103
|
+
document.write(`<link rel="stylesheet" href="/src/styles/core-variables.css?v=${version}">`);
|
|
104
|
+
document.write(`<link rel="stylesheet" href="/src/styles/core.css?v=${version}">`);
|
|
105
|
+
document.write(`<link rel="stylesheet" href="/src/styles/variables.css?v=${version}">`);
|
|
106
|
+
document.write(`<link rel="stylesheet" href="/src/styles/main.css?v=${version}">`);
|
|
107
|
+
})();
|
|
108
|
+
</script>
|
|
109
|
+
</head>
|
|
110
|
+
<body>
|
|
111
|
+
<div id="page-progress" role="progressbar" aria-label="Page loading progress"></div>
|
|
112
|
+
|
|
113
|
+
<div id="app" class="no-sidebar">
|
|
114
|
+
<app-header class="app-header"></app-header>
|
|
115
|
+
<app-sidebar></app-sidebar>
|
|
116
|
+
|
|
117
|
+
<main class="main-content">
|
|
118
|
+
<div id="main-content" class="page">
|
|
119
|
+
<loading-spinner message="Loading page..."></loading-spinner>
|
|
120
|
+
</div>
|
|
121
|
+
<app-footer></app-footer>
|
|
122
|
+
</main>
|
|
123
|
+
|
|
124
|
+
<nc-scroll-top to="top"></nc-scroll-top>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<nc-snackbar position="bottom-right"></nc-snackbar>
|
|
128
|
+
|
|
129
|
+
<script type="module">
|
|
130
|
+
(function() {
|
|
131
|
+
const isDev = location.hostname === 'localhost' || location.hostname === '127.0.0.1';
|
|
132
|
+
const version = isDev ? Date.now() : '1.0.0-20260414231644';
|
|
133
|
+
import(`/dist/app.js?v=${version}`);
|
|
134
|
+
})();
|
|
135
|
+
</script>
|
|
136
|
+
</body>
|
|
137
|
+
</html>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "NativeCore - Modern Reactive JavaScript Framework",
|
|
3
|
+
"short_name": "NativeCore",
|
|
4
|
+
"description": "A modern, lightweight reactive framework using vanilla JavaScript, Web Components, and reactive signals.",
|
|
5
|
+
"start_url": "/",
|
|
6
|
+
"display": "standalone",
|
|
7
|
+
"background_color": "#ffffff",
|
|
8
|
+
"theme_color": "#667eea",
|
|
9
|
+
"orientation": "portrait-primary",
|
|
10
|
+
"icons": [
|
|
11
|
+
{
|
|
12
|
+
"src": "/assets/icon.svg",
|
|
13
|
+
"sizes": "any",
|
|
14
|
+
"type": "image/svg+xml",
|
|
15
|
+
"purpose": "any"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"categories": ["development", "productivity"]
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Security Policy for nativeCore Framework
|
|
2
|
+
# https://securitytxt.org/
|
|
3
|
+
|
|
4
|
+
Contact: mailto:security@yourdomain.com
|
|
5
|
+
Expires: 2027-01-22T00:00:00.000Z
|
|
6
|
+
Preferred-Languages: en
|
|
7
|
+
Canonical: https://yourdomain.com/.well-known/security.txt
|
|
8
|
+
Policy: https://yourdomain.com/security-policy
|
|
9
|
+
Acknowledgments: https://yourdomain.com/security-thanks
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Strict-Transport-Security: max-age=31536000; includeSubDomains
|
|
3
|
+
Content-Security-Policy: default-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; object-src 'none'; script-src 'self' 'unsafe-inline' https://static.cloudflareinsights.com; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:; connect-src 'self' https://api.nativecorejs.com https://cloudflareinsights.com https://static.cloudflareinsights.com; manifest-src 'self'; worker-src 'self'
|
|
4
|
+
X-Frame-Options: SAMEORIGIN
|
|
5
|
+
Permissions-Policy: accelerometer=(), autoplay=(), camera=(), display-capture=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()
|
|
6
|
+
Access-Control-Allow-Origin: https://nativecorejs.com
|
|
7
|
+
|
|
8
|
+
/index.html
|
|
9
|
+
Cache-Control: no-store
|
|
10
|
+
|
|
11
|
+
/manifest.json
|
|
12
|
+
Cache-Control: no-cache, no-store, must-revalidate
|
|
13
|
+
|
|
14
|
+
/dist/*
|
|
15
|
+
Cache-Control: no-cache, no-store, must-revalidate
|
|
16
|
+
|
|
17
|
+
/src/styles/*
|
|
18
|
+
Cache-Control: no-cache, no-store, must-revalidate
|
|
19
|
+
|
|
20
|
+
/src/views/*
|
|
21
|
+
Cache-Control: no-cache, no-store, must-revalidate
|
|
22
|
+
|
|
23
|
+
/docs/*
|
|
24
|
+
Cache-Control: no-cache, no-store, must-revalidate
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/docs / 200
|
|
2
|
+
/docs/ / 200
|
|
3
|
+
/login / 200
|
|
4
|
+
/login/ / 200
|
|
5
|
+
/components / 200
|
|
6
|
+
/components/ / 200
|
|
7
|
+
/dashboard / 200
|
|
8
|
+
/dashboard/ / 200
|
|
9
|
+
/under-construction / 200
|
|
10
|
+
/under-construction/ / 200
|
|
11
|
+
/user/:id / 200
|
|
12
|
+
/user/:id/ / 200
|
|
13
|
+
/testpage / 200
|
|
14
|
+
/testpage/ / 200
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title>NativeCore Icon</title>
|
|
3
|
+
<desc>Green circular mark with a white play triangle</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="bg" x1="64" y1="64" x2="448" y2="448" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop offset="0" stop-color="#34d399"/>
|
|
7
|
+
<stop offset="1" stop-color="#059669"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
</defs>
|
|
10
|
+
<rect width="512" height="512" rx="120" fill="#0f172a"/>
|
|
11
|
+
<circle cx="256" cy="256" r="150" fill="url(#bg)"/>
|
|
12
|
+
<path d="M221 180l122 76-122 76V180z" fill="#ffffff"/>
|
|
13
|
+
</svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title>NativeCore Logo</title>
|
|
3
|
+
<desc>Rounded dark square containing a geometric teal N with a circular core at the center.</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="nativecore-bg" x1="86" y1="64" x2="430" y2="448" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop offset="0" stop-color="#132238"/>
|
|
7
|
+
<stop offset="1" stop-color="#09111d"/>
|
|
8
|
+
</linearGradient>
|
|
9
|
+
<linearGradient id="nativecore-mark" x1="120" y1="104" x2="372" y2="394" gradientUnits="userSpaceOnUse">
|
|
10
|
+
<stop offset="0" stop-color="#8bf5d4"/>
|
|
11
|
+
<stop offset="0.55" stop-color="#42d6c5"/>
|
|
12
|
+
<stop offset="1" stop-color="#1595c9"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
<linearGradient id="nativecore-ring" x1="188" y1="180" x2="325" y2="337" gradientUnits="userSpaceOnUse">
|
|
15
|
+
<stop offset="0" stop-color="#effcff" stop-opacity="0.96"/>
|
|
16
|
+
<stop offset="1" stop-color="#b9f7f0" stop-opacity="0.82"/>
|
|
17
|
+
</linearGradient>
|
|
18
|
+
</defs>
|
|
19
|
+
<rect width="512" height="512" rx="128" fill="url(#nativecore-bg)"/>
|
|
20
|
+
<rect x="22" y="22" width="468" height="468" rx="106" fill="none" stroke="#ffffff" stroke-opacity="0.08"/>
|
|
21
|
+
<path fill="url(#nativecore-mark)" d="M137 114h63l117 147V114h58v284h-63L195 251v147h-58V114z"/>
|
|
22
|
+
<circle cx="256" cy="256" r="71" fill="#09111d"/>
|
|
23
|
+
<circle cx="256" cy="256" r="55" fill="none" stroke="url(#nativecore-ring)" stroke-width="18"/>
|
|
24
|
+
<circle cx="256" cy="256" r="14" fill="#8bf5d4"/>
|
|
25
|
+
</svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nativeCore - Modern Reactive JavaScript Framework",
|
|
3
|
+
"short_name": "nativeCore",
|
|
4
|
+
"description": "A modern, lightweight reactive framework using vanilla JavaScript, Web Components, and reactive signals.",
|
|
5
|
+
"start_url": "/",
|
|
6
|
+
"display": "standalone",
|
|
7
|
+
"background_color": "#ffffff",
|
|
8
|
+
"theme_color": "#667eea",
|
|
9
|
+
"orientation": "portrait-primary",
|
|
10
|
+
"icons": [
|
|
11
|
+
{
|
|
12
|
+
"src": "/assets/icon.svg",
|
|
13
|
+
"sizes": "any",
|
|
14
|
+
"type": "image/svg+xml",
|
|
15
|
+
"purpose": "any"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"categories": ["development", "productivity"]
|
|
19
|
+
}
|