From e71068b2c8ca3716a64db046366ef0baca258a69 Mon Sep 17 00:00:00 2001 From: aidanaden Date: Sat, 10 Aug 2024 07:05:14 +0800 Subject: [PATCH] feat: init --- .changeset/config.json | 11 + .editorconfig | 10 + .github/workflows/format.yml | 29 + .github/workflows/release.yml | 32 + .github/workflows/tests.yml | 31 + .gitignore | 30 + .npmrc | 2 + .prettierrc | 10 + LICENSE | 21 + README.md | 69 + configs/vite.config.ts | 9 + configs/vitest.config.ts | 43 + examples/sandbox/index.html | 16 + examples/sandbox/package.json | 20 + examples/sandbox/src/App.module.css | 33 + examples/sandbox/src/App.tsx | 31 + examples/sandbox/src/index.css | 11 + examples/sandbox/src/index.tsx | 7 + examples/sandbox/src/logo.svg | 1 + examples/sandbox/tsconfig.json | 7 + examples/sandbox/vite.config.ts | 2 + examples/start-tailwind/.gitignore | 28 + examples/start-tailwind/README.md | 32 + .../app.config.timestamp_1723239863379.js | 70 + examples/start-tailwind/app.config.ts | 81 + examples/start-tailwind/package.json | 29 + examples/start-tailwind/postcss.config.cjs | 6 + examples/start-tailwind/public/favicon.ico | Bin 0 -> 664 bytes examples/start-tailwind/src/app.css | 20 + examples/start-tailwind/src/app.tsx | 36 + .../start-tailwind/src/components/Counter.tsx | 13 + .../start-tailwind/src/components/Nav.tsx | 19 + examples/start-tailwind/src/entry-client.tsx | 4 + examples/start-tailwind/src/entry-server.tsx | 21 + examples/start-tailwind/src/global.d.ts | 1 + .../start-tailwind/src/routes/[...404].tsx | 25 + examples/start-tailwind/src/routes/about.tsx | 25 + examples/start-tailwind/src/routes/index.tsx | 166 + examples/start-tailwind/tailwind.config.cjs | 8 + examples/start-tailwind/tsconfig.json | 19 + package.json | 42 + packages/core/CHANGELOG.md | 1 + packages/core/LICENSE | 21 + packages/core/README.md | 36 + packages/core/package.json | 64 + packages/core/src/index.ts | 1 + packages/core/src/walletStore.ts | 427 + packages/core/test/index.test.tsx | 51 + packages/core/test/server.test.tsx | 30 + packages/core/tsconfig.json | 4 + packages/core/tsup.config.ts | 42 + packages/hello/CHANGELOG.md | 1 + packages/hello/LICENSE | 21 + packages/hello/README.md | 36 + packages/hello/package.json | 63 + packages/hello/src/index.tsx | 24 + packages/hello/test/index.test.tsx | 51 + packages/hello/test/server.test.tsx | 30 + packages/hello/tsconfig.json | 4 + packages/hello/tsup.config.ts | 42 + pnpm-lock.yaml | 14951 ++++++++++++++++ pnpm-workspace.yaml | 3 + tsconfig.json | 23 + turbo.json | 26 + 64 files changed, 17022 insertions(+) create mode 100644 .changeset/config.json create mode 100644 .editorconfig create mode 100644 .github/workflows/format.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tests.yml create mode 100644 .gitignore create mode 100644 .npmrc create mode 100644 .prettierrc create mode 100644 LICENSE create mode 100644 README.md create mode 100644 configs/vite.config.ts create mode 100644 configs/vitest.config.ts create mode 100644 examples/sandbox/index.html create mode 100644 examples/sandbox/package.json create mode 100644 examples/sandbox/src/App.module.css create mode 100644 examples/sandbox/src/App.tsx create mode 100644 examples/sandbox/src/index.css create mode 100644 examples/sandbox/src/index.tsx create mode 100644 examples/sandbox/src/logo.svg create mode 100644 examples/sandbox/tsconfig.json create mode 100644 examples/sandbox/vite.config.ts create mode 100644 examples/start-tailwind/.gitignore create mode 100644 examples/start-tailwind/README.md create mode 100644 examples/start-tailwind/app.config.timestamp_1723239863379.js create mode 100644 examples/start-tailwind/app.config.ts create mode 100644 examples/start-tailwind/package.json create mode 100644 examples/start-tailwind/postcss.config.cjs create mode 100644 examples/start-tailwind/public/favicon.ico create mode 100644 examples/start-tailwind/src/app.css create mode 100644 examples/start-tailwind/src/app.tsx create mode 100644 examples/start-tailwind/src/components/Counter.tsx create mode 100644 examples/start-tailwind/src/components/Nav.tsx create mode 100644 examples/start-tailwind/src/entry-client.tsx create mode 100644 examples/start-tailwind/src/entry-server.tsx create mode 100644 examples/start-tailwind/src/global.d.ts create mode 100644 examples/start-tailwind/src/routes/[...404].tsx create mode 100644 examples/start-tailwind/src/routes/about.tsx create mode 100644 examples/start-tailwind/src/routes/index.tsx create mode 100644 examples/start-tailwind/tailwind.config.cjs create mode 100644 examples/start-tailwind/tsconfig.json create mode 100644 package.json create mode 100644 packages/core/CHANGELOG.md create mode 100644 packages/core/LICENSE create mode 100644 packages/core/README.md create mode 100644 packages/core/package.json create mode 100644 packages/core/src/index.ts create mode 100644 packages/core/src/walletStore.ts create mode 100644 packages/core/test/index.test.tsx create mode 100644 packages/core/test/server.test.tsx create mode 100644 packages/core/tsconfig.json create mode 100644 packages/core/tsup.config.ts create mode 100644 packages/hello/CHANGELOG.md create mode 100644 packages/hello/LICENSE create mode 100644 packages/hello/README.md create mode 100644 packages/hello/package.json create mode 100644 packages/hello/src/index.tsx create mode 100644 packages/hello/test/index.test.tsx create mode 100644 packages/hello/test/server.test.tsx create mode 100644 packages/hello/tsconfig.json create mode 100644 packages/hello/tsup.config.ts create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 tsconfig.json create mode 100644 turbo.json diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..bf6f6af --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ef8b2d9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,10 @@ +# editorconfig.org +root = true + +[*] +indent_style = tab +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..f359066 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,29 @@ +name: Format + +on: + push: + branches: [main] + +jobs: + format: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2.2.4 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install dependencies + run: pnpm install --ignore-scripts + + - name: Format + run: pnpm run format + + - name: Add, Commit and Push + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: 'Format' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..84ef055 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: + push: + branches: [main] + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2.2.4 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install Dependencies + run: pnpm install --ignore-scripts + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + version: pnpm run ci:version + publish: pnpm run release + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..9bd3d96 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,31 @@ +name: Build and Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2.2.4 + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install dependencies + run: pnpm install --ignore-scripts + + - name: Build all packages + run: pnpm build + + - name: Run Build and Tests + run: pnpm run build-test + env: + CI: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d1d0ec0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +node_modules +dist +gitignore + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# turbo +.turbo + +# solid +.solid + +/.idea +.project +.classpath +*.launch +.settings/ + +.DS_Store +Thumbs.db diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..4c2f52b --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +auto-install-peers=true +strict-peer-dependencies=false diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..0f76260 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "trailingComma": "all", + "tabWidth": 2, + "printWidth": 100, + "semi": false, + "singleQuote": false, + "useTabs": false, + "arrowParens": "avoid", + "bracketSpacing": true +} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..003a3b9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 your-author-name + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d8de548 --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +

+ your-repository-name Monorepo +

+ +# your-repository-name + +[![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg?style=for-the-badge&logo=pnpm)](https://pnpm.io/) +[![turborepo](https://img.shields.io/badge/built%20with-turborepo-cc00ff.svg?style=for-the-badge&logo=turborepo)](https://turborepo.org/) + +your-repository-desc + +> **Note** After using this template, you have to search and replace all `your-repository-name` and similar strings +> with appropriate texts. +> +> `your-repository-name` should be a **kebab-case** string representing the name of you monorepo. +> +> `your-repository-desc` should be a **Normal case** string with the description of the repository. +> +> `your-nickname` should be a **kebab-case** string from your profile URL. +> +> `your-author-name` should be a **Normal case** string with your first and last name. + +## Project Commands + +List of cli commands available from a project root. + +To use the commands, first install [pnpm](https://pnpm.io) and install dependencies with `pnpm i`. + +```bash +pnpm run dev +# Builds all packages in watch mode, and starts all examples +# turbo run dev --parallel + +pnpm run build +# Builds all the packages in the monorepo +# turbo run build --filter=!./examples/* + +pnpm run test +# Runs tests for all the packages in the monorepo +# turbo run test --filter=!./examples/* + +pnpm run typecheck +# Runs TS typecheck for all the packages in the monorepo +# turbo run typecheck --filter=!./examples/* + +pnpm run build-test +# Runs build, typecheck and test commands for all the packages in the monorepo +# "turbo run build test typecheck --filter=!./examples/* + +pnpm run format +# Formats the reposotory with prettier +# prettier -w \"packages/**/*.{js,ts,json,css,tsx,jsx,md}\" \"examples/**/*.{js,ts,json,css,tsx,jsx,md}\" + +pnpm run changeset +# Creates a changeset +# changeset + +pnpm run version-packages +# Applies changesets to bump package versions and update CHANGELOGs +# "changeset version && pnpm i + +pnpm run release +# Builds and publishes changed packages to npm +# pnpm run build-test && changeset publish + +pnpm run update-deps +# Updates all dependencies in the repository +# pnpm up -Lri +``` diff --git a/configs/vite.config.ts b/configs/vite.config.ts new file mode 100644 index 0000000..b80a99b --- /dev/null +++ b/configs/vite.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from 'vite' +import solidPlugin from 'vite-plugin-solid' + +export default defineConfig({ + plugins: [solidPlugin()], + build: { + target: 'esnext', + }, +}) diff --git a/configs/vitest.config.ts b/configs/vitest.config.ts new file mode 100644 index 0000000..cb0539e --- /dev/null +++ b/configs/vitest.config.ts @@ -0,0 +1,43 @@ +import { defineConfig } from 'vitest/config' +import solidPlugin from 'vite-plugin-solid' + +export default defineConfig(({ mode }) => { + // to test in server environment, run with "--mode ssr" or "--mode test:ssr" flag + // loads only server.test.ts file + const testSSR = mode === 'test:ssr' || mode === 'ssr' + + return { + plugins: [ + solidPlugin({ + // https://github.com/solidjs/solid-refresh/issues/29 + hot: false, + // For testing SSR we need to do a SSR JSX transform + solid: { generate: testSSR ? 'ssr' : 'dom' }, + }), + ], + test: { + watch: false, + isolate: !testSSR, + env: { + NODE_ENV: testSSR ? 'production' : 'development', + DEV: testSSR ? '' : '1', + SSR: testSSR ? '1' : '', + PROD: testSSR ? '1' : '', + }, + passWithNoTests: true, + environment: testSSR ? 'node' : 'jsdom', + transformMode: { web: [/\.[jt]sx$/] }, + ...(testSSR + ? { + include: ['test/server.test.{ts,tsx}'], + } + : { + include: ['test/*.test.{ts,tsx}'], + exclude: ['test/server.test.{ts,tsx}'], + }), + }, + resolve: { + conditions: testSSR ? ['node'] : ['browser', 'development'], + }, + } +}) diff --git a/examples/sandbox/index.html b/examples/sandbox/index.html new file mode 100644 index 0000000..48c59fc --- /dev/null +++ b/examples/sandbox/index.html @@ -0,0 +1,16 @@ + + + + + + + + Solid App + + + +
+ + + + diff --git a/examples/sandbox/package.json b/examples/sandbox/package.json new file mode 100644 index 0000000..ea23284 --- /dev/null +++ b/examples/sandbox/package.json @@ -0,0 +1,20 @@ +{ + "name": "@solana-wallets-solid/sandbox", + "version": "0.0.0", + "description": "", + "private": true, + "scripts": { + "start": "vite", + "dev": "vite", + "build": "vite build", + "serve": "vite preview" + }, + "devDependencies": { + "vite": "^5.4.0", + "vite-plugin-solid": "^2.5.0" + }, + "dependencies": { + "@solana-wallets-solid/hello": "workspace:*", + "solid-js": "^1.8.18" + } +} diff --git a/examples/sandbox/src/App.module.css b/examples/sandbox/src/App.module.css new file mode 100644 index 0000000..48308b2 --- /dev/null +++ b/examples/sandbox/src/App.module.css @@ -0,0 +1,33 @@ +.App { + text-align: center; +} + +.logo { + animation: logo-spin infinite 20s linear; + height: 40vmin; + pointer-events: none; +} + +.header { + background-color: #282c34; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: white; +} + +.link { + color: #b318f0; +} + +@keyframes logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/examples/sandbox/src/App.tsx b/examples/sandbox/src/App.tsx new file mode 100644 index 0000000..490b424 --- /dev/null +++ b/examples/sandbox/src/App.tsx @@ -0,0 +1,31 @@ +import type { Component } from "solid-js" +import { Hello } from "@solana-wallets-solid/hello" + +import logo from "./logo.svg" +import styles from "./App.module.css" + +const App: Component = () => { + return ( +
+
+ logo +

+ +

+

+ Edit src/App.tsx and save to reload. +

+ + Learn Solid + +
+
+ ) +} + +export default App diff --git a/examples/sandbox/src/index.css b/examples/sandbox/src/index.css new file mode 100644 index 0000000..714ab0e --- /dev/null +++ b/examples/sandbox/src/index.css @@ -0,0 +1,11 @@ +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", + "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +code { + font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; +} diff --git a/examples/sandbox/src/index.tsx b/examples/sandbox/src/index.tsx new file mode 100644 index 0000000..12c9a8c --- /dev/null +++ b/examples/sandbox/src/index.tsx @@ -0,0 +1,7 @@ +/* @refresh reload */ +import { render } from "solid-js/web" + +import "./index.css" +import App from "./App" + +render(() => , document.getElementById("root") as HTMLElement) diff --git a/examples/sandbox/src/logo.svg b/examples/sandbox/src/logo.svg new file mode 100644 index 0000000..025aa30 --- /dev/null +++ b/examples/sandbox/src/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/sandbox/tsconfig.json b/examples/sandbox/tsconfig.json new file mode 100644 index 0000000..6ed1e63 --- /dev/null +++ b/examples/sandbox/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "types": ["vite/client"] + }, + "include": ["src/**/*"] +} diff --git a/examples/sandbox/vite.config.ts b/examples/sandbox/vite.config.ts new file mode 100644 index 0000000..25bdd41 --- /dev/null +++ b/examples/sandbox/vite.config.ts @@ -0,0 +1,2 @@ +import config from "../../configs/vite.config" +export default config diff --git a/examples/start-tailwind/.gitignore b/examples/start-tailwind/.gitignore new file mode 100644 index 0000000..ff04496 --- /dev/null +++ b/examples/start-tailwind/.gitignore @@ -0,0 +1,28 @@ + +dist +.solid +.output +.vercel +.netlify +.vinxi + +# Environment +.env +.env*.local + +# dependencies +/node_modules + +# IDEs and editors +/.idea +.project +.classpath +*.launch +.settings/ + +# Temp +gitignore + +# System Files +.DS_Store +Thumbs.db diff --git a/examples/start-tailwind/README.md b/examples/start-tailwind/README.md new file mode 100644 index 0000000..a84af39 --- /dev/null +++ b/examples/start-tailwind/README.md @@ -0,0 +1,32 @@ +# SolidStart + +Everything you need to build a Solid project, powered by [`solid-start`](https://start.solidjs.com); + +## Creating a project + +```bash +# create a new project in the current directory +npm init solid@latest + +# create a new project in my-app +npm init solid@latest my-app +``` + +## Developing + +Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: + +```bash +npm run dev + +# or start the server and open the app in a new browser tab +npm run dev -- --open +``` + +## Building + +Solid apps are built with _presets_, which optimise your project for deployment to different environments. + +By default, `npm run build` will generate a Node app that you can run with `npm start`. To use a different preset, add it to the `devDependencies` in `package.json` and specify in your `app.config.js`. + +## This project was created with the [Solid CLI](https://solid-cli.netlify.app) diff --git a/examples/start-tailwind/app.config.timestamp_1723239863379.js b/examples/start-tailwind/app.config.timestamp_1723239863379.js new file mode 100644 index 0000000..a178617 --- /dev/null +++ b/examples/start-tailwind/app.config.timestamp_1723239863379.js @@ -0,0 +1,70 @@ +// app.config.ts +import { defineConfig } from "@solidjs/start/config"; +var app_config_default = defineConfig({ + /** + * Toggle between client and server rendering. + * @default true + */ + ssr: true, + /** + * Configuration object for [vite-plugin-solid](https://github.com/solidjs/vite-plugin-solid) + */ + solid: {}, + /** + * Array of file extensions to be treated as routes. + * @default ["js", "jsx", "ts", "tsx"] + */ + extensions: ["js", "jsx", "ts", "tsx"], + /** + * Nitro server config options + * + * @see https://nitro.unjs.io/config + */ + server: { + /** CLOUDFLARE PRESET: + * 1. uncomment the following + * 2. Within wrangler.toml you will need to enable node compatibility: `compatibility_flags = [ "nodejs_compat" ]` + */ + // preset: "cloudflare_module", + // rollupConfig: { + // external: ["__STATIC_CONTENT_MANIFEST", "node:async_hooks"], + }, + /** + * The path to the root of the application. + * + * @default "./src" + */ + appRoot: "./src", + /** + * The path to where the routes are located. + * + * @default "./routes" + */ + routeDir: "./routes", + /** + * The path to an optional middleware file. + */ + middleware: void 0, + /** + * Toggle the dev overlay. + * + * @default true + */ + devOverlay: true, + experimental: { + /** + * Enable "islands" mode. + */ + islands: false + }, + /** + * Vite config object. Can be configured for each router which has + * the string value "server", "client" or "server-function"` + * + * @see https://vitejs.dev/config/shared-options.html + */ + vite: {} +}); +export { + app_config_default as default +}; diff --git a/examples/start-tailwind/app.config.ts b/examples/start-tailwind/app.config.ts new file mode 100644 index 0000000..c884830 --- /dev/null +++ b/examples/start-tailwind/app.config.ts @@ -0,0 +1,81 @@ +import { defineConfig } from "@solidjs/start/config" + +/** + * Solid-start specific config file + * @see https://docs.solidjs.com/solid-start/reference/config/define-config + */ +export default defineConfig({ + /** + * Toggle between client and server rendering. + * @default true + */ + ssr: true, + /** + * Configuration object for [vite-plugin-solid](https://github.com/solidjs/vite-plugin-solid) + */ + solid: {}, + /** + * Array of file extensions to be treated as routes. + * @default ["js", "jsx", "ts", "tsx"] + */ + extensions: ["js", "jsx", "ts", "tsx"], + /** + * Nitro server config options + * + * @see https://nitro.unjs.io/config + */ + server: { + preset: "cloudflare-pages", + alias: { + // For `readable-stream` to properly resolve Cloudflare runtime polyfill + "process/": "process", + }, + esbuild: { + options: { + // We need BigInt support (default: 2019) + target: "esnext", + }, + }, + }, + /** + * The path to the root of the application. + * + * @default "./src" + */ + appRoot: "./src", + /** + * The path to where the routes are located. + * + * @default "./routes" + */ + routeDir: "./routes", + /** + * The path to an optional middleware file. + */ + middleware: undefined, + /** + * Toggle the dev overlay. + * + * @default true + */ + devOverlay: true, + experimental: { + /** + * Enable "islands" mode. + */ + islands: false, + }, + /** + * Vite config object. Can be configured for each router which has + * the string value "server", "client" or "server-function"` + * + * @see https://vitejs.dev/config/shared-options.html + */ + vite: { + define: { + // For WalletConnect + // Node.js global to browser globalThis + global: "globalThis", + }, + }, +}) diff --git a/examples/start-tailwind/package.json b/examples/start-tailwind/package.json new file mode 100644 index 0000000..9bde95b --- /dev/null +++ b/examples/start-tailwind/package.json @@ -0,0 +1,29 @@ +{ + "name": "@solana-wallets-solid/start-tailwind", + "type": "module", + "scripts": { + "dev": "vinxi dev", + "build": "vinxi build", + "start": "vinxi start" + }, + "dependencies": { + "@solana-mobile/wallet-adapter-mobile": "^2.1.3", + "@solana-wallets-solid/core": "workspace:*", + "@solana-wallets-solid/hello": "workspace:*", + "@solana/wallet-adapter-base": "^0.9.23", + "@solana/wallet-adapter-wallets": "^0.19.32", + "@solana/wallet-standard-util": "^1.1.1", + "@solana/wallet-standard-wallet-adapter-base": "^1.1.2", + "@solidjs/router": "^0.14.1", + "@solidjs/start": "^1.0.6", + "@wallet-standard/app": "0.0.0-20240703212708", + "autoprefixer": "^10.4.19", + "postcss": "^8.4.38", + "solid-js": "^1.8.18", + "tailwindcss": "^3.4.3", + "vinxi": "^0.4.1" + }, + "engines": { + "node": ">=18" + } +} diff --git a/examples/start-tailwind/postcss.config.cjs b/examples/start-tailwind/postcss.config.cjs new file mode 100644 index 0000000..33ad091 --- /dev/null +++ b/examples/start-tailwind/postcss.config.cjs @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/examples/start-tailwind/public/favicon.ico b/examples/start-tailwind/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..fb282da0719ef6ab4c1732df93be6216b0d85520 GIT binary patch literal 664 zcmV;J0%!e+P)m9ebk1R zejT~~6f_`?;`cEd!+`7(hw@%%2;?RN8gX-L?z6cM( zKoG@&w+0}f@Pfvwc+deid)qgE!L$ENKYjViZC_Zcr>L(`2oXUT8f0mRQ(6-=HN_Ai zeBBEz3WP+1Cw`m!49Wf!MnZzp5bH8VkR~BcJ1s-j90TAS2Yo4j!J|KodxYR%3Numw zA?gq6e`5@!W~F$_De3yt&uspo&2yLb$(NwcPPI-4LGc!}HdY%jfq@AFs8LiZ4k(p} zZ!c9o+qbWYs-Mg zgdyTALzJX&7QXHdI_DPTFL33;w}88{e6Zk)MX0kN{3DX9uz#O_L58&XRH$Nvvu;fO zf&)7@?C~$z1K<>j0ga$$MIg+5xN;eQ?1-CA=`^Y169@Ab6!vcaNP=hxfKN%@Ly^R* zK1iv*s1Yl6_dVyz8>ZqYhz6J4|3fQ@2LQeX@^%W(B~8>=MoEmBEGGD1;gHXlpX>!W ym)!leA2L@`cpb^hy)P75=I!`pBYxP7<2VfQ3j76qLgzIA0000 ({ adapter: a, readyState: a.readyState })) + createEffect(() => { + console.log({ wallets }) + }) + return ( + ( + <> + +