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 CHANGED
@@ -329,24 +329,25 @@ export async function homeController(): Promise<() => void> {
329
329
  }
330
330
 
331
331
  function homeViewTemplate(config) {
332
- const secondaryAuth = config.includeAuth ? '<nc-a variant="hero-ghost" href="/login">Sign In</nc-a>' : '';
333
- const secondaryDashboard = config.includeDashboard ? '<nc-a variant="hero-ghost" href="/dashboard">Dashboard</nc-a>' : '';
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>${config.projectTitle}</h1>
339
+ <h1>NativeCoreJS</h1>
340
340
 
341
341
  <p class="hero-tagline">
342
- This project was scaffolded with NativeCore and includes the full project structure,
343
- dev tooling, HMR, mock API flow, stores, services, middleware, scripts, and component registries.
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="${config.includeAuth ? '/login' : config.includeDashboard ? '/dashboard' : '/'}" id="get-started-btn">${config.includeAuth ? 'Sign In' : config.includeDashboard ? 'Open Dashboard' : 'Get Started'}</nc-a>
348
- ${secondaryDashboard}
349
- ${secondaryAuth}
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', `${config.projectTitle} | Built with NativeCore`)
527
- .replaceAll('NativeCore Framework', config.projectTitle)
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.', `${config.projectTitle} built with NativeCore.`));
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*"[^"]+"/, `"name": "${config.projectTitle}"`)
535
- .replace(/"short_name"\s*:\s*"[^"]+"/, `"short_name": "${config.projectTitle}"`));
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-nativecore",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Interactive CLI for scaffolding NativeCore applications",
5
5
  "keywords": [
6
6
  "nativecore",
@@ -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
- this.handleRoute(browserPath, state);
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
  /**