mirror of
https://github.com/logto-io/logto.git
synced 2025-03-17 22:31:28 -05:00
feat(ui): init ui-new
package (#245)
This commit is contained in:
parent
c8d45a13f0
commit
011f073efe
10 changed files with 189 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="index.tsx"></script>
|
||||
</body>
|
||||
|
|
3
packages/ui-new/README.md
Normal file
3
packages/ui-new/README.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# @logto/ui
|
||||
|
||||
The register / sign-in experience for end-users.
|
43
packages/ui-new/package.json
Normal file
43
packages/ui-new/package.json
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"name": "@logto/ui-new",
|
||||
"version": "0.1.0",
|
||||
"license": "MPL-2.0",
|
||||
"private": true,
|
||||
"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.1",
|
||||
"@silverhand/eslint-config-react": "^0.8.1",
|
||||
"@silverhand/ts-config": "^0.8.1",
|
||||
"@silverhand/ts-config-react": "^0.8.1",
|
||||
"@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"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "@silverhand/react"
|
||||
},
|
||||
"stylelint": {
|
||||
"extends": "@silverhand/eslint-config-react/.stylelintrc"
|
||||
},
|
||||
"prettier": "@silverhand/eslint-config/.prettierrc"
|
||||
}
|
3
packages/ui-new/src/App.module.scss
Normal file
3
packages/ui-new/src/App.module.scss
Normal file
|
@ -0,0 +1,3 @@
|
|||
.app {
|
||||
color: #aaa;
|
||||
}
|
7
packages/ui-new/src/App.tsx
Normal file
7
packages/ui-new/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/ui-new/src/include.d/react-app.d.ts
vendored
Normal file
65
packages/ui-new/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;
|
||||
}
|
15
packages/ui-new/src/index.html
Normal file
15
packages/ui-new/src/index.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Logto</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="index.tsx"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
7
packages/ui-new/src/index.tsx
Normal file
7
packages/ui-new/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/ui-new/tsconfig.json
Normal file
6
packages/ui-new/tsconfig.json
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": "@silverhand/ts-config-react/tsconfig.base",
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
39
pnpm-lock.yaml
generated
39
pnpm-lock.yaml
generated
|
@ -307,6 +307,45 @@ importers:
|
|||
webpack: 5.65.0
|
||||
webpack-dev-server: 3.11.3_webpack@5.65.0
|
||||
|
||||
packages/ui-new:
|
||||
specifiers:
|
||||
'@parcel/core': ^2.3.1
|
||||
'@parcel/transformer-sass': ^2.3.1
|
||||
'@silverhand/eslint-config': ^0.8.1
|
||||
'@silverhand/eslint-config-react': ^0.8.1
|
||||
'@silverhand/ts-config': ^0.8.1
|
||||
'@silverhand/ts-config-react': ^0.8.1
|
||||
'@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
|
||||
react: ^17.0.2
|
||||
react-dom: ^17.0.2
|
||||
stylelint: ^13.13.1
|
||||
dependencies:
|
||||
react: 17.0.2
|
||||
react-dom: 17.0.2_react@17.0.2
|
||||
devDependencies:
|
||||
'@parcel/core': 2.3.1
|
||||
'@parcel/transformer-sass': 2.3.1_@parcel+core@2.3.1
|
||||
'@silverhand/eslint-config': 0.8.1_b07be603d0ceb19daeedad1772e0f2c4
|
||||
'@silverhand/eslint-config-react': 0.8.1_bde439a4d13c321a6cb4f974de44a545
|
||||
'@silverhand/ts-config': 0.8.1_typescript@4.5.5
|
||||
'@silverhand/ts-config-react': 0.8.1_typescript@4.5.5
|
||||
'@types/react': 17.0.37
|
||||
'@types/react-dom': 17.0.11
|
||||
eslint: 8.4.1
|
||||
lint-staged: 11.2.6
|
||||
parcel: 2.3.1_postcss@8.4.6
|
||||
postcss: 8.4.6
|
||||
postcss-modules: 4.3.0_postcss@8.4.6
|
||||
prettier: 2.5.1
|
||||
stylelint: 13.13.1
|
||||
|
||||
packages:
|
||||
|
||||
/@babel/code-frame/7.10.4:
|
||||
|
|
Loading…
Add table
Reference in a new issue