Skip to content

About

Angular without boundaries

Resources

Stars

4 stars

Watchers

0 watching

Forks

Repository files navigation

nativescript-unified

One Nx monorepo (Angular 22, Vite 8, Nx 23) for an HTML-first NativeScript Angular design that runs on the web, iOS and Android (the same NativeScript app also runs on macOS and Windows). Web and native stay separate at the top; shared HTML/features sit underneath. The docs site (apps/web) is the best introduction: start at /docs/introduction.

apps/
  web/               AnalogJS app (@analogjs/platform, Vite). File routes in src/app/pages, web core in src/app/app.config.ts
  native/            NativeScript Angular app (@nativescript/vite). File routes in src/app/pages via analog-native
packages/
  shared/            HTML-first components, the 12 example screens and the docs Markdown, used by BOTH apps (no platform imports)
  ui/                Spartan: brain (headless) + helm (styled), ported to Angular 22, plus styles/ (tailwind preset, style-vega, tokens.css) and native/
  web-polyfills/     Angular components so NativeScript <StackLayout>, <GridLayout> and <Label> markup renders on the web
  analog-native/     File-based router + Markdown for NativeScript Angular (from nativescript-analog packages/analog)
docs/design.md       analog-native design notes

Commands

npm install                       # postinstall applies tools/native-patches and patches @nativescript/vite
npx nx show projects              # analog-native native shared ui web web-polyfills
npx nx serve web                  # dev server (AnalogJS)
npx nx build web                  # -> dist/apps/web/client
npx nx test web-polyfills         # polyfill unit tests
npx nx test analog-native         # router and Markdown unit tests
npx nx run-many -t typecheck      # tsc for ui, shared, web-polyfills, web, native, analog-native
npx nx run native:android         # needs the NativeScript CLI + Android SDK
cd apps/native && ns run ios      # needs a Mac with Xcode (no native:ios Nx target yet)

Theme

packages/ui/styles/tokens.css is the single source of colour tokens (shadcn-style names, plain hex): background #F2EBDD, foreground #10302F, primary #27695F, muted sand #E3D9C4. Dark mode (.dark on web, .ns-dark on native) flips to deep teal.

  • web: apps/web/src/styles.css imports packages/ui/styles/index.css (tailwind + Spartan preset + style-vega + tokens).
  • native: apps/native/src/app.css imports Tailwind (@nativescript/tailwind), the Spartan preset, style-vega and tokens.css.

Where things came from

  • analog-native, apps/native: D:\Code\playgrounds\nativescript-analog (packages/analog, apps/demo). The import name is @nativescript-unified/analog-native (path-mapped in tsconfig.base.json).
  • web-polyfills: angular-docs origin/main packages/libraries/ui only (layouts, views, text runs, Placeholder, ActionBar/Tabs/Pager/Drawer). Dropped: docs content, PLAN/RESEARCH/CONTENT-GAPS, playground, showcase catalog, brand, WebGPU hero, theme service.
  • ui: spartan working tree on feat/nativescript (libs/brain, libs/helm, registry style-vega.css). packages/ui/native/ is the NativeScript side of spartan, wired into apps/native through provideSpartanNativeScript(). It holds the CDK shims, element registrations, the native overlay host behind brain's dialog and overlay ports, icons and CSS overrides.

Known gaps / decisions

  • apps/web is prerendered (ssr: true + static: true in vite.config.mts); nx build web writes static HTML for / and every /docs/:slug to dist/apps/web/analog/public. Routes come from the files in packages/shared/content/docs.
  • Docs content is Markdown in packages/shared/content/docs (front matter: title, section, order, description). A fenced block tagged html live is both shown and rendered as a live demo (Angular JIT, see apps/web/src/app/docs/demo.ts). The native app renders the same files on its Guide and Components tabs.
  • The home page renders the shared example screens live (apps/web/src/app/home/home-showcase.ts), loaded with @defer once the section nears the viewport.
  • Verify the built site: npm run preview:web then npm run audit:web (headless Edge via playwright-core; screenshots in .audit/screenshots).
  • Spartan brain/helm are consumed from source via tsconfig paths (@spartan-ng/brain/*, @spartan-ng/helm/*), not built packages. Their specs were copied but have no test target yet.
  • embla-carousel-angular@21 and ngx-scrollbar@19 have Angular 21-era peers; they installed but are unproven on 22.
  • Native uses Spartan helm and Tailwind. The per-component results in the docs (the table at /docs/components#native-status) were recorded on an Android emulator (API 36) and have not been re-checked on iOS.
  • Angular 22.2 supports Node ^22.22.3, ^24.15.0 or >=26; older versions install with engine warnings.

About

Angular without boundaries

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages