From 4f60dbfe2898090e16167d5108813d4c4196d66c Mon Sep 17 00:00:00 2001 From: Qubasa Date: Wed, 18 Jun 2025 20:34:54 +0200 Subject: [PATCH] clan-app: Add more symlinks to ui-2d --- pkgs/clan-app/ui-2d/README.md | 43 ------------------- pkgs/clan-app/ui-2d/eslint.config.mjs | 38 +---------------- pkgs/clan-app/ui-2d/index.html | 15 +------ pkgs/clan-app/ui-2d/postcss.config.js | 9 +--- pkgs/clan-app/ui-2d/prettier.config.js | 10 +---- pkgs/clan-app/ui-2d/stylelint.config.js | 7 +--- pkgs/clan-app/ui-2d/tailwind.config.ts | 13 +----- pkgs/clan-app/ui-2d/util.ts | 34 +-------------- pkgs/clan-app/ui-2d/vite.config.ts | 55 +------------------------ 9 files changed, 8 insertions(+), 216 deletions(-) delete mode 100644 pkgs/clan-app/ui-2d/README.md mode change 100644 => 120000 pkgs/clan-app/ui-2d/eslint.config.mjs mode change 100644 => 120000 pkgs/clan-app/ui-2d/index.html mode change 100644 => 120000 pkgs/clan-app/ui-2d/postcss.config.js mode change 100644 => 120000 pkgs/clan-app/ui-2d/prettier.config.js mode change 100644 => 120000 pkgs/clan-app/ui-2d/stylelint.config.js mode change 100644 => 120000 pkgs/clan-app/ui-2d/tailwind.config.ts mode change 100644 => 120000 pkgs/clan-app/ui-2d/util.ts mode change 100644 => 120000 pkgs/clan-app/ui-2d/vite.config.ts diff --git a/pkgs/clan-app/ui-2d/README.md b/pkgs/clan-app/ui-2d/README.md deleted file mode 100644 index cd52c6e45..000000000 --- a/pkgs/clan-app/ui-2d/README.md +++ /dev/null @@ -1,43 +0,0 @@ -## Usage - -Those templates dependencies are maintained via [pnpm](https://pnpm.io) via -`pnpm up -Lri`. - -This is the reason you see a `pnpm-lock.yaml`. That being said, any package -manager will work. This file can be safely be removed once you clone a template. - -```bash -$ npm install # or pnpm install or yarn install -``` - -### Learn more on the [Solid Website](https://solidjs.com) and come chat with us on our [Discord](https://discord.com/invite/solidjs) - -## Available Scripts - -In the project directory, you can run: - -### `npm run dev` or `npm start` - -Runs the app in the development mode.
Open -[http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.
- -### `npm run build` - -Builds the app for production to the `dist` folder.
It correctly bundles -Solid in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.
Your app is -ready to be deployed! - -### `npm run storybook` - -Starts an instance of [storybook](https://storybook.js.org/). - -For more info on how to write stories, please [see here](https://storybook.js.org/docs). - -## Deployment - -You can deploy the `dist` folder to any static host provider (netlify, surge, -now, etc.) diff --git a/pkgs/clan-app/ui-2d/eslint.config.mjs b/pkgs/clan-app/ui-2d/eslint.config.mjs deleted file mode 100644 index 44b2bae56..000000000 --- a/pkgs/clan-app/ui-2d/eslint.config.mjs +++ /dev/null @@ -1,37 +0,0 @@ -import eslint from "@eslint/js"; -import tseslint from "typescript-eslint"; -import tailwind from "eslint-plugin-tailwindcss"; -import pluginQuery from "@tanstack/eslint-plugin-query"; -import { globalIgnores } from "eslint/config"; - -const config = tseslint.config( - eslint.configs.recommended, - ...pluginQuery.configs["flat/recommended"], - ...tseslint.configs.strict, - ...tseslint.configs.stylistic, - ...tailwind.configs["flat/recommended"], - globalIgnores(["src/types/index.d.ts"]), - { - rules: { - "tailwindcss/no-contradicting-classname": [ - "error", - { - callees: ["cx"], - }, - ], - "tailwindcss/no-custom-classname": [ - "error", - { - callees: ["cx"], - whitelist: ["material-icons"], - }, - ], - // TODO: make this more strict by removing later - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-non-null-assertion": "off", - }, - }, -); - -export default config; diff --git a/pkgs/clan-app/ui-2d/eslint.config.mjs b/pkgs/clan-app/ui-2d/eslint.config.mjs new file mode 120000 index 000000000..8d1d5d6ec --- /dev/null +++ b/pkgs/clan-app/ui-2d/eslint.config.mjs @@ -0,0 +1 @@ +../ui/eslint.config.mjs \ No newline at end of file diff --git a/pkgs/clan-app/ui-2d/index.html b/pkgs/clan-app/ui-2d/index.html deleted file mode 100644 index 0c649c3fb..000000000 --- a/pkgs/clan-app/ui-2d/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - Solid App - - - - - -
- - - - diff --git a/pkgs/clan-app/ui-2d/index.html b/pkgs/clan-app/ui-2d/index.html new file mode 120000 index 000000000..548aa000e --- /dev/null +++ b/pkgs/clan-app/ui-2d/index.html @@ -0,0 +1 @@ +../ui/index.html \ No newline at end of file diff --git a/pkgs/clan-app/ui-2d/postcss.config.js b/pkgs/clan-app/ui-2d/postcss.config.js deleted file mode 100644 index a982c6414..000000000 --- a/pkgs/clan-app/ui-2d/postcss.config.js +++ /dev/null @@ -1,8 +0,0 @@ -const config = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -}; - -export default config; diff --git a/pkgs/clan-app/ui-2d/postcss.config.js b/pkgs/clan-app/ui-2d/postcss.config.js new file mode 120000 index 000000000..5a4173088 --- /dev/null +++ b/pkgs/clan-app/ui-2d/postcss.config.js @@ -0,0 +1 @@ +../ui/postcss.config.js \ No newline at end of file diff --git a/pkgs/clan-app/ui-2d/prettier.config.js b/pkgs/clan-app/ui-2d/prettier.config.js deleted file mode 100644 index 2aa318a4a..000000000 --- a/pkgs/clan-app/ui-2d/prettier.config.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * @see https://prettier.io/docs/en/configuration.html - * @type {import("prettier").Config} - */ -const config = { - trailingComma: "all", -}; - -export default config; diff --git a/pkgs/clan-app/ui-2d/prettier.config.js b/pkgs/clan-app/ui-2d/prettier.config.js new file mode 120000 index 000000000..b25d67971 --- /dev/null +++ b/pkgs/clan-app/ui-2d/prettier.config.js @@ -0,0 +1 @@ +../ui/prettier.config.js \ No newline at end of file diff --git a/pkgs/clan-app/ui-2d/stylelint.config.js b/pkgs/clan-app/ui-2d/stylelint.config.js deleted file mode 100644 index faf4babdd..000000000 --- a/pkgs/clan-app/ui-2d/stylelint.config.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - extends: ["stylelint-config-standard", "stylelint-config-tailwindcss"], - rules: { - // You can adjust rules here - }, -}; diff --git a/pkgs/clan-app/ui-2d/stylelint.config.js b/pkgs/clan-app/ui-2d/stylelint.config.js new file mode 120000 index 000000000..4367820b6 --- /dev/null +++ b/pkgs/clan-app/ui-2d/stylelint.config.js @@ -0,0 +1 @@ +../ui/stylelint.config.js \ No newline at end of file diff --git a/pkgs/clan-app/ui-2d/tailwind.config.ts b/pkgs/clan-app/ui-2d/tailwind.config.ts deleted file mode 100644 index a540896b4..000000000 --- a/pkgs/clan-app/ui-2d/tailwind.config.ts +++ /dev/null @@ -1,12 +0,0 @@ -import typography from "@tailwindcss/typography"; -import kobalte from "@kobalte/tailwindcss"; -import core from "./tailwind/core-plugin"; - -/** @type {import('tailwindcss').Config} */ -const config = { - content: ["./src/**/*.{js,jsx,ts,tsx}"], - theme: {}, - plugins: [typography, core, kobalte], -}; - -export default config; diff --git a/pkgs/clan-app/ui-2d/tailwind.config.ts b/pkgs/clan-app/ui-2d/tailwind.config.ts new file mode 120000 index 000000000..c136407eb --- /dev/null +++ b/pkgs/clan-app/ui-2d/tailwind.config.ts @@ -0,0 +1 @@ +../ui/tailwind.config.ts \ No newline at end of file diff --git a/pkgs/clan-app/ui-2d/util.ts b/pkgs/clan-app/ui-2d/util.ts deleted file mode 100644 index eaeeab027..000000000 --- a/pkgs/clan-app/ui-2d/util.ts +++ /dev/null @@ -1,33 +0,0 @@ -export function isValidHostname(value: string | null | undefined) { - if (typeof value !== "string") return false; - - const validHostnameChars = /^[a-zA-Z0-9-.]{1,253}\.?$/g; - - if (!validHostnameChars.test(value)) { - return false; - } - - if (value.endsWith(".")) { - value = value.slice(0, value.length - 1); - } - - if (value.length > 253) { - return false; - } - - const labels = value.split("."); - - const isValid = labels.every(function (label) { - const validLabelChars = /^([a-zA-Z0-9-]+)$/g; - - const validLabel = - validLabelChars.test(label) && - label.length < 64 && - !label.startsWith("-") && - !label.endsWith("-"); - - return validLabel; - }); - - return isValid; -} diff --git a/pkgs/clan-app/ui-2d/util.ts b/pkgs/clan-app/ui-2d/util.ts new file mode 120000 index 000000000..693e86b1c --- /dev/null +++ b/pkgs/clan-app/ui-2d/util.ts @@ -0,0 +1 @@ +../ui/util.ts \ No newline at end of file diff --git a/pkgs/clan-app/ui-2d/vite.config.ts b/pkgs/clan-app/ui-2d/vite.config.ts deleted file mode 100644 index 5ae7c0135..000000000 --- a/pkgs/clan-app/ui-2d/vite.config.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { defineConfig } from "vite"; -import solidPlugin from "vite-plugin-solid"; -import solidSvg from "vite-plugin-solid-svg"; -import devtools from "solid-devtools/vite"; -import path from "node:path"; -import { exec } from "child_process"; - -// watch also clan-cli to catch api changes -const clanCliDir = path.resolve(__dirname, "../../clan-cli"); - -function regenPythonApiOnFileChange() { - return { - name: "run-python-script-on-change", - handleHotUpdate({}) { - exec("reload-python-api.sh", (err, stdout, stderr) => { - if (err) { - console.error(`reload-python-api.sh error:\n${stderr}`); - } - }); - }, - configureServer(server: import("vite").ViteDevServer) { - server.watcher.add([clanCliDir]); - }, - }; -} - -export default defineConfig({ - resolve: { - alias: { - "@": path.resolve(__dirname, "./"), // Adjust the path as needed - }, - }, - optimizeDeps: { - include: ["debug", "extend"], - }, - plugins: [ - /* - Uncomment the following line to enable solid-devtools. - For more info see https://github.com/thetarnav/solid-devtools/tree/main/packages/extension#readme - */ - devtools(), - solidPlugin(), - solidSvg(), - regenPythonApiOnFileChange(), - ], - server: { - port: 3000, - }, - build: { - target: "safari11", - // assetsDi - manifest: true, - }, -}); diff --git a/pkgs/clan-app/ui-2d/vite.config.ts b/pkgs/clan-app/ui-2d/vite.config.ts new file mode 120000 index 000000000..f6579e6aa --- /dev/null +++ b/pkgs/clan-app/ui-2d/vite.config.ts @@ -0,0 +1 @@ +../ui/vite.config.ts \ No newline at end of file