create-nativecore 0.2.0 → 0.2.1
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/bin/index.mjs +14 -13
- package/package.json +1 -1
- package/template/src/core/router.ts +12 -1
package/bin/index.mjs
CHANGED
|
@@ -329,24 +329,25 @@ export async function homeController(): Promise<() => void> {
|
|
|
329
329
|
}
|
|
330
330
|
|
|
331
331
|
function homeViewTemplate(config) {
|
|
332
|
-
const
|
|
333
|
-
const
|
|
332
|
+
const primaryHref = config.includeAuth ? '/login' : config.includeDashboard ? '/dashboard' : '/';
|
|
333
|
+
const primaryLabel = config.includeAuth ? 'Sign In' : config.includeDashboard ? 'Open Dashboard' : 'Get Started';
|
|
334
334
|
|
|
335
335
|
return `<section class="hero">
|
|
336
336
|
<div class="hero-inner">
|
|
337
337
|
<div class="hero-badge">TypeScript-first. Web Components. Dev tools included.</div>
|
|
338
338
|
|
|
339
|
-
<h1
|
|
339
|
+
<h1>NativeCoreJS</h1>
|
|
340
340
|
|
|
341
341
|
<p class="hero-tagline">
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
Build modern applications with a browser-native architecture that leans on web standards,
|
|
343
|
+
not proprietary runtimes. NativeCoreJS keeps you close to the platform with Web Components,
|
|
344
|
+
TypeScript, reactive state, and high-performance patterns that stay durable as the web evolves.
|
|
344
345
|
</p>
|
|
345
346
|
|
|
346
347
|
<div class="hero-actions">
|
|
347
|
-
<nc-a variant="hero-primary" href="${
|
|
348
|
-
|
|
349
|
-
|
|
348
|
+
<nc-a variant="hero-primary" href="${primaryHref}" id="get-started-btn">${primaryLabel}</nc-a>
|
|
349
|
+
<nc-a variant="hero-ghost" href="https://nativecorejs.com/docs" target="_blank" rel="noopener noreferrer">Read the Docs</nc-a>
|
|
350
|
+
<nc-a variant="hero-ghost" href="https://nativecorejs.com/components" target="_blank" rel="noopener noreferrer">Component Library</nc-a>
|
|
350
351
|
</div>
|
|
351
352
|
|
|
352
353
|
<div class="hero-stats">
|
|
@@ -523,16 +524,16 @@ async function customizeProject(targetDir, config) {
|
|
|
523
524
|
.replace(/<a href="\/docs" data-link class="login-form__utility-link">Review the docs<\/a>/g, '<a href="/" data-link class="login-form__utility-link">Return home</a>'));
|
|
524
525
|
|
|
525
526
|
await replaceInFile(path.join(targetDir, 'index.html'), content => content
|
|
526
|
-
.replaceAll('NativeCore | Modern Reactive JavaScript Framework',
|
|
527
|
-
.replaceAll('NativeCore Framework',
|
|
527
|
+
.replaceAll('NativeCore | Modern Reactive JavaScript Framework', 'NativeCoreJS | Built with NativeCore')
|
|
528
|
+
.replaceAll('NativeCore Framework', 'NativeCoreJS')
|
|
528
529
|
.replaceAll('https://nativecorejs.com/', '/')
|
|
529
530
|
.replaceAll('https://nativecorejs.com', '/')
|
|
530
531
|
.replaceAll('@nativecorejs', '')
|
|
531
|
-
.replaceAll('A modern, lightweight reactive framework using vanilla JavaScript, Web Components, reactive signals, and zero dependencies.',
|
|
532
|
+
.replaceAll('A modern, lightweight reactive framework using vanilla JavaScript, Web Components, reactive signals, and zero dependencies.', 'A NativeCoreJS starter focused on web standards, browser-native architecture, and durable performance.'));
|
|
532
533
|
|
|
533
534
|
await replaceInFile(path.join(targetDir, 'manifest.json'), content => content
|
|
534
|
-
.replace(/"name"\s*:\s*"[^"]+"/,
|
|
535
|
-
.replace(/"short_name"\s*:\s*"[^"]+"/,
|
|
535
|
+
.replace(/"name"\s*:\s*"[^"]+"/, '"name": "NativeCoreJS"')
|
|
536
|
+
.replace(/"short_name"\s*:\s*"[^"]+"/, '"short_name": "NativeCoreJS"'));
|
|
536
537
|
|
|
537
538
|
await replaceInFile(path.join(targetDir, 'public/_headers'), content => content
|
|
538
539
|
.replace(/https:\/\/api\.nativecorejs\.com\s*/g, '')
|
package/package.json
CHANGED
|
@@ -193,7 +193,18 @@ export class Router {
|
|
|
193
193
|
replace(path: string, state: any = {}): void {
|
|
194
194
|
const browserPath = this.normalizeBrowserPath(path);
|
|
195
195
|
window.history.replaceState(state, '', browserPath);
|
|
196
|
-
|
|
196
|
+
|
|
197
|
+
// Allow redirects triggered during an in-flight navigation, such as
|
|
198
|
+
// auth middleware or logout handlers, to schedule a new route load.
|
|
199
|
+
if (this.navigationController) {
|
|
200
|
+
this.navigationController.abort();
|
|
201
|
+
}
|
|
202
|
+
this.isNavigating = false;
|
|
203
|
+
this.navigationController = new AbortController();
|
|
204
|
+
|
|
205
|
+
queueMicrotask(() => {
|
|
206
|
+
void this.handleRoute(browserPath, state);
|
|
207
|
+
});
|
|
197
208
|
}
|
|
198
209
|
|
|
199
210
|
/**
|