-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from arkedge/init-client-ui
Initialize client-ui
- Loading branch information
Showing
23 changed files
with
8,189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Client UI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- client-ui/** | ||
- .github/workflows/client-ui.yml | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- client-ui/** | ||
- .github/workflows/client-ui.yml | ||
|
||
defaults: | ||
run: | ||
working-directory: ./client-ui | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4.2.2 | ||
|
||
- uses: pnpm/action-setup@v4.0.0 | ||
with: | ||
package_json_file: client-ui/package.json | ||
|
||
- uses: actions/setup-node@v4.1.0 | ||
with: | ||
cache: pnpm | ||
cache-dependency-path: client-ui/pnpm-lock.yaml | ||
node-version-file: client-ui/.nvmrc | ||
|
||
- run: pnpm install | ||
|
||
- run: pnpm run lint | ||
|
||
typecheck: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4.2.2 | ||
|
||
- uses: pnpm/action-setup@v4.0.0 | ||
with: | ||
package_json_file: client-ui/package.json | ||
|
||
- uses: actions/setup-node@v4.1.0 | ||
with: | ||
cache: pnpm | ||
cache-dependency-path: client-ui/pnpm-lock.yaml | ||
node-version-file: client-ui/.nvmrc | ||
|
||
- run: pnpm install | ||
|
||
- run: pnpm run typecheck | ||
|
||
build: | ||
name: build ${{ github.ref_name == 'main' && 'and push' || '' }} | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
attestations: write | ||
id-token: write | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: arkedge/clover-ui | ||
|
||
steps: | ||
- uses: actions/checkout@v4.2.2 | ||
|
||
- uses: docker/setup-buildx-action@v3.7.1 | ||
with: | ||
# renovate: datasource=github-releases depName=docker/buildx | ||
version: "v0.18.0" | ||
|
||
- uses: docker/login-action@v3.3.0 | ||
if: github.ref_name == 'main' | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: docker/metadata-action@v5.5.1 | ||
id: meta | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
tags: | | ||
type=sha,prefix= | ||
type=raw,value=latest | ||
- uses: docker/build-push-action@v6.9.0 | ||
id: build-push | ||
with: | ||
context: ./client-ui | ||
push: ${{ github.ref_name == 'main' }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- uses: actions/attest-build-provenance@v1.4.4 | ||
if: github.ref_name == 'main' | ||
with: | ||
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} | ||
subject-digest: ${{ steps.build-push.outputs.digest }} | ||
push-to-registry: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** | ||
* This is intended to be a basic starting point for linting in your app. | ||
* It relies on recommended configs out of the box for simplicity, but you can | ||
* and should modify this configuration to best suit your team's needs. | ||
*/ | ||
|
||
/** @type {import('eslint').Linter.Config} */ | ||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es6: true, | ||
}, | ||
ignorePatterns: ["!**/.server", "!**/.client"], | ||
|
||
// Base config | ||
extends: ["eslint:recommended", "prettier"], | ||
|
||
overrides: [ | ||
// React | ||
{ | ||
files: ["**/*.{js,jsx,ts,tsx}"], | ||
plugins: ["react", "jsx-a11y"], | ||
extends: [ | ||
"plugin:react/recommended", | ||
"plugin:react/jsx-runtime", | ||
"plugin:react-hooks/recommended", | ||
"plugin:jsx-a11y/recommended", | ||
], | ||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
formComponents: ["Form"], | ||
linkComponents: [ | ||
{ name: "Link", linkAttribute: "to" }, | ||
{ name: "NavLink", linkAttribute: "to" }, | ||
], | ||
"import/resolver": { | ||
typescript: {}, | ||
}, | ||
}, | ||
}, | ||
|
||
// Typescript | ||
{ | ||
files: ["**/*.{ts,tsx}"], | ||
plugins: ["@typescript-eslint", "import"], | ||
parser: "@typescript-eslint/parser", | ||
settings: { | ||
"import/internal-regex": "^~/", | ||
"import/resolver": { | ||
node: { | ||
extensions: [".ts", ".tsx"], | ||
}, | ||
typescript: { | ||
alwaysTryTypes: true, | ||
}, | ||
}, | ||
}, | ||
extends: [ | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:import/recommended", | ||
"plugin:import/typescript", | ||
], | ||
}, | ||
|
||
// Node | ||
{ | ||
files: [".eslintrc.cjs"], | ||
env: { | ||
node: true, | ||
}, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
|
||
/.cache | ||
/build | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
22.11.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["prettier-plugin-tailwindcss"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
FROM node:22-bullseye-slim AS base | ||
|
||
ENV NODE_ENV=production | ||
|
||
RUN corepack enable | ||
|
||
# build stage | ||
|
||
FROM base AS build | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json pnpm-lock.yaml ./ | ||
RUN pnpm install --frozen-lockfile --prod=false | ||
|
||
COPY . . | ||
RUN pnpm run build | ||
RUN pnpm prune --prod | ||
|
||
# runtime stage | ||
|
||
FROM base | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json . | ||
COPY --from=build /app/node_modules /app/node_modules | ||
COPY --from=build /app/build/client /app/build/client | ||
COPY --from=build /app/build/server /app/build/server | ||
|
||
RUN corepack install | ||
|
||
CMD ["pnpm", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Welcome to Remix! | ||
|
||
- 📖 [Remix docs](https://remix.run/docs) | ||
|
||
## Development | ||
|
||
Run the dev server: | ||
|
||
```shellscript | ||
npm run dev | ||
``` | ||
|
||
## Deployment | ||
|
||
First, build your app for production: | ||
|
||
```sh | ||
npm run build | ||
``` | ||
|
||
Then run the app in production mode: | ||
|
||
```sh | ||
npm start | ||
``` | ||
|
||
Now you'll need to pick a host to deploy it to. | ||
|
||
### DIY | ||
|
||
If you're familiar with deploying Node applications, the built-in Remix app server is production-ready. | ||
|
||
Make sure to deploy the output of `npm run build` | ||
|
||
- `build/server` | ||
- `build/client` | ||
|
||
## Styling | ||
|
||
This template comes with [Tailwind CSS](https://tailwindcss.com/) already configured for a simple default starting experience. You can use whatever css framework you prefer. See the [Vite docs on css](https://vitejs.dev/guide/features.html#css) for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* By default, Remix will handle hydrating your app on the client for you. | ||
* You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ | ||
* For more information, see https://remix.run/file-conventions/entry.client | ||
*/ | ||
|
||
import { RemixBrowser } from "@remix-run/react"; | ||
import { startTransition, StrictMode } from "react"; | ||
import { hydrateRoot } from "react-dom/client"; | ||
|
||
startTransition(() => { | ||
hydrateRoot( | ||
document, | ||
<StrictMode> | ||
<RemixBrowser /> | ||
</StrictMode>, | ||
); | ||
}); |
Oops, something went wrong.