Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
build/
generated/
89 changes: 46 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,53 @@ jobs:
- name: Install dependencies
run: pnpm install

- name: Initialize types
run: pnpm initialize:type

- name: Run knip
run: pnpm lint:unused
lint-js:
name: Lint JS
environment: 'test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Lint Javascript
run: pnpm lint:js
# typecheck:
# name: Typecheck
# environment: 'test'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4

# - name: Install pnpm
# uses: pnpm/action-setup@v4

# - name: Install Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'pnpm'

# - name: Install dependencies
# run: pnpm install

# - name: Generate types
# run: pnpm generate:type

# - name: Lint Javascript
# run: pnpm typecheck
# lint-js:
# name: Lint JS
# environment: 'test'
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Install pnpm
# uses: pnpm/action-setup@v4
# - name: Install Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 20
# cache: 'pnpm'
# - name: Install dependencies
# run: pnpm install

# - name: Lint Javascript
# run: pnpm lint:js
css-lint:
name: Lint CSS
environment: 'test'
Expand All @@ -95,31 +119,10 @@ jobs:

- name: Css Lint
run: pnpm lint:css
typecheck:
name: Typecheck
environment: 'test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Lint Javascript
run: pnpm typecheck
build:
name: Build
environment: 'test'
needs: [lint-js, css-lint, typecheck]
needs: [unused, css-lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ build-ssr
.env
.eslintcache
tsconfig.tsbuildinfo

generated/
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
git bash g++ make \
&& rm -rf /var/lib/apt/lists/* \
# NOTE: yarn > 1.22.19 breaks yarn-install invoked by pnpm
&& npm install -g [email protected] [email protected] --force

RUN npm install -g pnpm
&& npm install -g [email protected] [email protected] --force \
&& git config --global --add safe.directory /code

WORKDIR /code

RUN git config --global --add safe.directory /code
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
target: dev
command: sh -c 'pnpm install && pnpm start --host'
environment:
APP_TITLE: ${APP_TITLE:-TC Global Notes}
APP_TITLE: ${APP_TITLE:-Unified Notes}
volumes:
- .:/code
ports:
Expand Down
2 changes: 1 addition & 1 deletion env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import {

export default defineConfig({
APP_TITLE: Schema.string(),
APP_UNIFIED_ENDPOINT: Schema.string.optional(),
APP_UNIFIED_API_ENDPOINT: Schema.string({ format: 'url', protocol: true, tld: false }),
});
5 changes: 3 additions & 2 deletions knip.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": [
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/index.tsx!"
],
"ignoreDependencies": [
"openapi-typescript"
],
"project": [
"src/**/*.d.ts",
"src/**/*.test.ts",
"src/**/*.test.tsx",
"src/**/*.tsx!",
"src/**/*.ts!"
Expand Down
28 changes: 20 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,51 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"initialize:type": "mkdir -p generated/ && pnpm initialize:type:unified",
"initialize:type:unified": "test -f ./generate/types/ts && true || cp types.stub.ts ./generated/types.ts",
"generate:type": "dotenv -- cross-var openapi-typescript \"%APP_UNIFIED_API_ENDPOINT%openapi.json\" -o ./generated/types.ts --alphabetize",
"prestart": "pnpm initialize:type",
"start": "vite",
"prebuild": "pnpm initialize:type",
"build": "vite build",
"test": "vitest",
"coverage": "vitest run --coverage",
"pretypecheck": "pnpm initialize:type",
"typecheck": "tsc",
"lint": "pnpm lint:js && pnpm lint:css",
"lint": "pnpm lint:js && pnpm lint:css && pnpm lint:unused",
"lint:fix": "pnpm lint:js --fix && pnpm lint:css --fix",
"prelint:js": "pnpm initialize:type",
"lint:js": "eslint src",
"lint:css": "stylelint \"./src/**/*.css\"",
"lint:unused": "knip --tags=-knipignore",
"postinstall": "patch-package"
},
"engines": {
"node": "20",
"pnpm": "8.15.9"
"pnpm": "10.6.1"
},
"dependencies": {
"@julr/vite-plugin-validate-env": "^1.1.1",
"@julr/vite-plugin-validate-env": "git+https://github.com/toggle-corp/vite-plugin-validate-env#v2.2.0-tc.1",
"@togglecorp/fujs": "^2.0.0",
"@togglecorp/toggle-form": "^2.0.4",
"@togglecorp/toggle-request": "1.0.0-beta.3",
"@togglecorp/toggle-ui": "^0.18.3",
"@ifrc-go/ui": "1.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "5.5.0",
"react-router-dom": "^6.11.1"
},
"devDependencies": {
"@types/node": "^20.1.3",
"@types/react": "^18.0.28",
"@types/react-dom": "^18.0.11",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"@typescript-eslint/eslint-plugin": "^8.30.1",
"@typescript-eslint/parser": "^8.30.1",
"@vitejs/plugin-react-swc": "^3.0.0",
"@vitest/coverage-v8": "^2.1.3",
"autoprefixer": "^10.4.14",
"cross-var": "^1.1.0",
"dotenv-cli": "^7.4.2",
"eslint": "^8.40.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-import-resolver-typescript": "^3.5.5",
Expand All @@ -50,6 +61,7 @@
"eslint-plugin-simple-import-sort": "^12.1.1",
"happy-dom": "^13.6.2",
"knip": "^5.33.3",
"openapi-typescript": "6.5.5",
"patch-package": "^8.0.0",
"postcss": "^8.3.0",
"postcss-nested": "^6.0.1",
Expand All @@ -60,7 +72,7 @@
"stylelint-config-recommended": "^14.0.0",
"stylelint-no-unused-selectors": "git+https://github.com/toggle-corp/stylelint-no-unused-selectors#e0831e1",
"stylelint-value-no-unknown-custom-properties": "^6.0.1",
"typescript": "^5.0.4",
"typescript": "^5.5.2",
"vite": "^5.1.5",
"vite-plugin-checker": "^0.6.0",
"vite-plugin-compression2": "^1.0.0",
Expand All @@ -69,5 +81,5 @@
"vite-tsconfig-paths": "^4.2.0",
"vitest": "^1.3.1"
},
"packageManager": "pnpm@8.15.9"
"packageManager": "pnpm@10.6.1+sha512.40ee09af407fa9fbb5fbfb8e1cb40fbb74c0af0c3e10e9224d7b53c7658528615b2c92450e74cfad91e3a2dcafe3ce4050d80bda71d757756d2ce2b66213e9a3"
}
Loading