Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanWalker committed Jan 8, 2024
1 parent bf0172f commit f17d716
Show file tree
Hide file tree
Showing 22 changed files with 3,747 additions and 2,074 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ Thumbs.db
.nx/cache

# Dist output
apps/web-hello-world/netlify
apps/web-hello-world/dist
apps/web-hello-world/.solid

Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
Solid running on Web, iOS, Android and Vision Pro.

## Setup

Prerequisites:
- [NativeScript Environment Setup](https://docs.nativescript.org/setup/macos#setting-up-macos-for-ios)
- [Xcode 15.2 Beta Installed for Vision Pro Simulator](https://developer.apple.com/download/applications/)
- [Download SwiftPackages here](https://drive.google.com/file/d/17wFGXOBqeXgs7mhFZ-wfg4ogHyRYlYCR/view?usp=sharing)
- **Important for visionOS**: Once unzipped, place the folder at `apps/nativescript-hello-world/SwiftPackages`

```bash
yarn setup
```
Expand All @@ -9,9 +17,9 @@ yarn setup
```bash
yarn web

yarn android

yarn ios

yarn vision

yarn android
```
6 changes: 3 additions & 3 deletions apps/nativescript-hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
},
"dependencies": {
"@nativescript-community/ui-collectionview": "^5.3.2",
"@nativescript-community/solid-js": "^0.0.4-alpha.5",
"@nativescript-community/solid-js": "^0.0.5",
"@nativescript/core": "vision",
"@nativescript/swift-ui": "vision",
"@nativescript/tailwind": "*",
"solid-navigation": "^1.0.0-alpha.8"
"solid-navigation": "^1.0.0-alpha.11"
},
"devDependencies": {
"@nativescript/android": "~8.6.0",
"@nativescript/ios": "~8.6.0",
"@nativescript/visionos": "~8.6.0",
"typescript": "~5.2.0"
"typescript": "~5.3.0"
}
}
9 changes: 3 additions & 6 deletions apps/web-hello-world/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"executor": "nx:run-commands",
"options": {
"cwd": "apps/web-hello-world",
"command": "solid-start build"
"command": "vinxi build"
},
"configurations": {
"development": {
Expand All @@ -25,7 +25,7 @@
"defaultConfiguration": "development",
"options": {
"cwd": "apps/web-hello-world",
"command": "solid-start dev"
"command": "vinxi dev"
},
"configurations": {
"development": {
Expand All @@ -48,10 +48,7 @@
},
"lint": {
"executor": "@nx/eslint:lint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/web-hello-world/**/*.ts"]
}
"outputs": ["{options.outputFile}"]
}
}
}
File renamed without changes.
21 changes: 21 additions & 0 deletions apps/web-hello-world/src/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @refresh reload
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start";
import { Suspense } from "solid-js";
import Nav from "~/components/Nav";
import "./app.css";

export default function App() {
return (
<Router
root={(props) => (
<>
<Nav />
<Suspense>{props.children}</Suspense>
</>
)}
>
<FileRoutes />
</Router>
);
}
21 changes: 21 additions & 0 deletions apps/web-hello-world/src/components/Nav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { useLocation } from '@solidjs/router';

export default function Nav() {
const location = useLocation();
const active = (path: string) =>
path == location.pathname
? 'border-sky-600'
: 'border-transparent hover:border-sky-600';
return (
<nav class="bg-sky-800">
<ul class="container flex items-center p-3 text-gray-200">
<li class={`border-b-2 ${active('/')} mx-1.5 sm:mx-6`}>
<a href="/">Home</a>
</li>
<li class={`border-b-2 ${active('/about')} mx-1.5 sm:mx-6`}>
<a href="/about">About</a>
</li>
</ul>
</nav>
);
}
4 changes: 2 additions & 2 deletions apps/web-hello-world/src/entry-client.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { mount, StartClient } from "solid-start/entry-client";
import { mount, StartClient } from "@solidjs/start/client";

mount(() => <StartClient />, document);
mount(() => <StartClient />, document.getElementById("app"));
27 changes: 19 additions & 8 deletions apps/web-hello-world/src/entry-server.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import {
StartServer,
createHandler,
renderAsync,
} from "solid-start/entry-server";
import { createHandler, StartServer } from "@solidjs/start/server";

export default createHandler(
renderAsync((event) => <StartServer event={event} />)
);
export default createHandler(() => (
<StartServer
document={({ assets, children, scripts }) => (
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" />
{assets}
</head>
<body>
<div id="app">{children}</div>
{scripts}
</body>
</html>
)}
/>
));
2 changes: 1 addition & 1 deletion apps/web-hello-world/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/// <reference types="solid-start/env" />
/// <reference types="@solidjs/start/env" />
53 changes: 0 additions & 53 deletions apps/web-hello-world/src/root.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion apps/web-hello-world/src/routes/[...404].tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { A } from "solid-start";
import { A } from "@solidjs/router";

export default function NotFound() {
return (
Expand Down
8 changes: 4 additions & 4 deletions apps/web-hello-world/src/routes/about.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { A } from 'solid-start';
import { A } from "@solidjs/router";
import { Counter } from '@solid-x-platforms/components';

export default function About() {
Expand All @@ -9,21 +9,21 @@ export default function About() {
</h1>
<Counter />
<p class="mt-8">
Visit{' '}
Visit{" "}
<a
href="https://solidjs.com"
target="_blank"
class="text-sky-600 hover:underline"
>
solidjs.com
</a>{' '}
</a>{" "}
to learn how to build Solid apps.
</p>
<p class="my-4">
<A href="/" class="text-sky-600 hover:underline">
Home
</A>
{' - '}
{" - "}
<span>About Page</span>
</p>
</main>
Expand Down
10 changes: 5 additions & 5 deletions apps/web-hello-world/src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { A } from 'solid-start';
import { A } from "@solidjs/router";
import { Counter } from '@solid-x-platforms/components';

export default function Home() {
Expand All @@ -9,22 +9,22 @@ export default function Home() {
</h1>
<Counter />
<p class="mt-8">
Visit{' '}
Visit{" "}
<a
href="https://solidjs.com"
target="_blank"
class="text-sky-600 hover:underline"
>
solidjs.com
</a>{' '}
</a>{" "}
to learn how to build Solid apps.
</p>
<p class="my-4">
<span>Home</span>
{' - '}
{" - "}
<A href="/about" class="text-sky-600 hover:underline">
About Page
</A>{' '}
</A>{" "}
</p>
</main>
);
Expand Down
2 changes: 1 addition & 1 deletion apps/web-hello-world/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
"types": ["vinxi/client", "node"]
},
"exclude": ["src/**/*.spec.ts", "src/**/*.test.ts"],
"include": ["src/**/*.ts"]
Expand Down
8 changes: 7 additions & 1 deletion apps/web-hello-world/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@
"noUnusedParameters": true,
"noImplicitReturns": true,
"skipLibCheck": true,
"types": ["vite/client", "vitest"]
"types": ["vite/client", "vitest"],
"baseUrl": ".",
"paths": {
"~/*": ["src/*"],
"@solid-x-platforms/components": ["../../packages/components/src/index.ts"],
"@solid-x-platforms/utils": ["../../packages/utils/src/index.ts"]
}
},
"include": ["src"],
"references": [
Expand Down
11 changes: 3 additions & 8 deletions apps/web-hello-world/vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import solid from 'solid-start/vite';
import { defineConfig } from 'vite';
import { defineConfig } from '@solidjs/start/config';
import viteTsConfigPaths from 'vite-tsconfig-paths';
import netlify from 'solid-start-netlify';

export default defineConfig({
cacheDir: '../../node_modules/.vite/web-hello-world',
Expand All @@ -14,9 +12,6 @@ export default defineConfig({
plugins: [
viteTsConfigPaths({
root: '../../',
}),
solid({
adapter: netlify({ edge: true }),
}),
})
],
});
});
5 changes: 1 addition & 4 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
"{workspaceRoot}/eslint.config.js"
]
},
"test": {
"@nx/vite:test": {
"cache": true,
"inputs": ["default", "^production"]
},
"e2e": {
"cache": true
}
},
"namedInputs": {
Expand Down
Loading

0 comments on commit f17d716

Please sign in to comment.