### Install Project Dependencies Source: https://github.com/sonnetjs/sonnet/blob/main/packages/sonnet-store/README.md Installs all project dependencies listed in the package.json file using npm. This step is crucial before running the application. ```bash npm i ``` -------------------------------- ### Start Development Server Source: https://github.com/sonnetjs/sonnet/blob/main/packages/sonnet-store/README.md Starts the development server for your SonnetJS application. This command typically watches for file changes and hot-reloads the application. ```bash npm run dev ``` -------------------------------- ### Install @sonnetjs/router Source: https://github.com/sonnetjs/sonnet/blob/main/packages/sonnet-router/README.md Installs the @sonnetjs/router package using npm. This is the first step to integrate the router into your SonnetJS project. ```bash npm i @sonnetjs/router ``` -------------------------------- ### Install SonnetJS Store Source: https://github.com/sonnetjs/sonnet/blob/main/packages/sonnet-store/README.md Installs the sonnetjs/store package into your project's dependencies using npm. This makes the state management library available for use. ```bash npm i @sonnetjs/store ``` -------------------------------- ### Initialize SonnetJS App with Router Source: https://github.com/sonnetjs/sonnet/blob/main/packages/sonnet-router/README.md Shows the main application setup in SonnetJS, integrating the defined routers. It initializes the SonnetJS app, sets the root component, uses the router, and mounts the application to the DOM. ```typescript // src/main.ts import App from './App'; import { routers } from './routes'; import { createApp } from '@sonnetjs/core'; const app = createApp(); app.root(App); app.use(routers); app.lazy(); app.mount('#app'); app.initialized(); ``` -------------------------------- ### Start Development Server Source: https://github.com/sonnetjs/sonnet/blob/main/README.md Starts the local development server for the SonnetJS application. This command typically enables features like hot-reloading and provides a URL to view the application in a browser. ```bash npm run dev ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/sonnetjs/sonnet/blob/main/README.md Installs all necessary Node.js packages for the SonnetJS project. This command reads the project's package.json file to download and link dependencies. ```bash npm i ``` -------------------------------- ### Install SonnetJS Core Package Source: https://github.com/sonnetjs/sonnet/blob/main/README.md Installs the core package of the SonnetJS framework from NPM. This package provides the foundational elements for building web applications with SonnetJS. ```bash npm i @sonnetjs/core ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/sonnetjs/sonnet/blob/main/README.md Changes the current working directory to the root of the newly created SonnetJS application. This is a standard shell command required before installing dependencies or running development servers. ```bash cd [my-sonnet-app] ``` -------------------------------- ### Create SonnetJS App Source: https://github.com/sonnetjs/sonnet/blob/main/packages/sonnet-store/README.md Creates a new SonnetJS project using npx. This command initializes a new project with the necessary structure and configurations. ```bash npx create-sonnet-app@latest ``` -------------------------------- ### Create SonnetJS App Source: https://github.com/sonnetjs/sonnet/blob/main/README.md Initializes a new SonnetJS project using npx. This command sets up the project structure and necessary configuration files for a new web application. ```bash npx create-sonnet-app@latest ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/sonnetjs/sonnet/blob/main/packages/sonnet-store/README.md Changes the current directory to the newly created SonnetJS project. Replace '[my-sonnet-app]' with your actual project name. ```bash cd [my-sonnet-app] ``` -------------------------------- ### Define Routes with SonnetJS Router Source: https://github.com/sonnetjs/sonnet/blob/main/packages/sonnet-router/README.md Demonstrates how to define routes for a SonnetJS application using the router. It shows setting up a layout, child routes with paths and components, and creating the router instance. ```typescript // src/routes.ts import { router, createBrowserHistory, createRouter } from '@sonnetjs/router'; export const routes = router() .layout(async () => (await import('./partials/Layout')).default()) .children([ router() .path('/') .component(async () => (await import('./pages/Home')).default()) .get(), router() .path('/about') .component(async () => (await import('./pages/About')).default()) .get(), router() .path('/contact') .component(async () => (await import('./pages/Contact')).default()) .get(), ]) .get(); const history = createBrowserHistory(); export const routers = createRouter() .routes(routes) .history(history) .mountedId('#app-1') .get(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.