mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
feat(console): init (#239)
* feat(console): init * refactor: remove unused tsconfig props * fix: lint error
This commit is contained in:
parent
e206dfcecb
commit
5ce8c18652
12 changed files with 1659 additions and 10 deletions
3
.github/workflows/main.yml
vendored
3
.github/workflows/main.yml
vendored
|
@ -22,6 +22,9 @@ jobs:
|
|||
- name: Lint
|
||||
run: pnpm -- lerna run --parallel lint
|
||||
|
||||
- name: Style Lint
|
||||
run: pnpm -- lerna run --parallel stylelint
|
||||
|
||||
- name: Test
|
||||
run: pnpm -- lerna run --parallel test:coverage
|
||||
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,6 +11,7 @@ node_modules
|
|||
# production
|
||||
/packages/*/build
|
||||
/packages/*/lib
|
||||
/packages/*/dist
|
||||
|
||||
# logs
|
||||
logs
|
||||
|
|
3
.npmrc
Normal file
3
.npmrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Hoist for Parcel
|
||||
public-hoist-pattern[]=@parcel/*
|
||||
public-hoist-pattern[]=postcss
|
3
packages/console/README.md
Normal file
3
packages/console/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# @logto/console
|
||||
|
||||
The web admin console for Logto.
|
46
packages/console/package.json
Normal file
46
packages/console/package.json
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"name": "@logto/console",
|
||||
"version": "0.1.0",
|
||||
"description": "> TODO: description",
|
||||
"author": "Gao Sun <gao@silverhand.io>",
|
||||
"homepage": "https://github.com/logto-io/logto#readme",
|
||||
"license": "MPL-2.0",
|
||||
"scripts": {
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"precommit": "lint-staged",
|
||||
"start": "parcel src/index.html",
|
||||
"check": "tsc --noEmit",
|
||||
"build": "pnpm check && rm -rf dist && parcel build src/index.html --no-autoinstall",
|
||||
"lint": "eslint --ext .ts --ext .tsx src",
|
||||
"stylelint": "stylelint \"src/**/*.scss\""
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@parcel/core": "^2.3.1",
|
||||
"@parcel/transformer-sass": "^2.3.1",
|
||||
"@silverhand/eslint-config": "^0.8.0",
|
||||
"@silverhand/eslint-config-react": "^0.8.0",
|
||||
"@silverhand/ts-config": "^0.8.0",
|
||||
"@silverhand/ts-config-react": "^0.8.0",
|
||||
"@types/react": "^17.0.14",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"eslint": "^8.1.0",
|
||||
"lint-staged": "^11.1.1",
|
||||
"parcel": "^2.3.1",
|
||||
"postcss": "^8.4.6",
|
||||
"postcss-modules": "^4.3.0",
|
||||
"prettier": "^2.3.2",
|
||||
"stylelint": "^13.13.1",
|
||||
"typescript": "^4.3.5"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "@silverhand/react"
|
||||
},
|
||||
"stylelint": {
|
||||
"extends": "@silverhand/eslint-config-react/.stylelintrc"
|
||||
},
|
||||
"prettier": "@silverhand/eslint-config/.prettierrc"
|
||||
}
|
3
packages/console/src/App.module.scss
Normal file
3
packages/console/src/App.module.scss
Normal file
|
@ -0,0 +1,3 @@
|
|||
.app {
|
||||
color: #aaa;
|
||||
}
|
7
packages/console/src/App.tsx
Normal file
7
packages/console/src/App.tsx
Normal file
|
@ -0,0 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
import * as styles from './App.module.scss';
|
||||
|
||||
export const App = () => {
|
||||
return <h1 className={styles.app}>Hello world!</h1>;
|
||||
};
|
65
packages/console/src/include.d/react-app.d.ts
vendored
Normal file
65
packages/console/src/include.d/react-app.d.ts
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
// Copied from react-scripts/lib/react-app.d.ts
|
||||
|
||||
declare module '*.avif' {
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.bmp' {
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.gif' {
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.jpg' {
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.jpeg' {
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.png' {
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.webp' {
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.svg' {
|
||||
import * as React from 'react';
|
||||
|
||||
export const ReactComponent: React.FunctionComponent<
|
||||
React.SVGProps<SVGSVGElement> & { title?: string }
|
||||
>;
|
||||
|
||||
const src: string;
|
||||
export default src;
|
||||
}
|
||||
|
||||
declare module '*.module.css' {
|
||||
const classes: Readonly<Record<string, string>>;
|
||||
export default classes;
|
||||
export = classes;
|
||||
}
|
||||
|
||||
declare module '*.module.scss' {
|
||||
const classes: Readonly<Record<string, string>>;
|
||||
export default classes;
|
||||
export = classes;
|
||||
}
|
||||
|
||||
declare module '*.module.sass' {
|
||||
const classes: Readonly<Record<string, string>>;
|
||||
export default classes;
|
||||
export = classes;
|
||||
}
|
14
packages/console/src/index.html
Normal file
14
packages/console/src/index.html
Normal file
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Logto Console</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="index.tsx"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
7
packages/console/src/index.tsx
Normal file
7
packages/console/src/index.tsx
Normal file
|
@ -0,0 +1,7 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
|
||||
import { App } from './App';
|
||||
|
||||
const app = document.querySelector('#app');
|
||||
ReactDOM.render(<App />, app);
|
6
packages/console/tsconfig.json
Normal file
6
packages/console/tsconfig.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": "@silverhand/ts-config-react/tsconfig.base",
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
1511
pnpm-lock.yaml
1511
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue