Skip to content

Commit

Permalink
chore(deps): update dependency tsbb to v3.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 27, 2021
1 parent e831c46 commit 3cbe903
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 327 deletions.
37 changes: 0 additions & 37 deletions .babelrc

This file was deleted.

9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,10 @@ Runs the project in development mode.

```bash
# Step 1, run first, listen to the component compile and output the .js file
npm run ts:watch
# Step 2, listen for compilation output type .d.ts file
npm run types:watch
# Step 3, development mode, listen to compile preview website instance
npm run doc:dev
npm run watch
npm run build
# Step 2, development mode, listen to compile preview website instance
npm run doc
```

**production**
Expand Down
48 changes: 21 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,19 @@
"name": "@uiw/react-split",
"version": "5.7.4",
"description": "A piece of view can be divided into areas where the width or height can be adjusted by dragging.",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
"typings": "lib/esm/index.d.ts",
"main": "cjs/index.js",
"module": "esm/index.js",
"homepage": "https://uiwjs.github.io/react-split",
"scripts": {
"prepare": "npm run build",
"released": "npm run build && npm run doc",
"doc": "kkt build --app-src ./website",
"start": "kkt start --app-src ./website",
"build": "npm run ts:build && npm run types:esm && npm run types:cjs && npm run css:build && npm run css:build:dist",
"watch": "npm run ts:watch & npm run types:watch & npm run css:watch",
"types:build": "tsbb types --sourceRoot src --target ESNEXT",
"types:watch": "npm run types:esm -- --watch & npm run types:cjs -- --watch",
"types:esm": "npm run types:build -- --outDir ../lib/esm",
"types:cjs": "npm run types:build -- --outDir ../lib/cjs",
"css:build": "compile-less -d src -o lib/esm",
"css:watch": "compile-less -d src -o lib/esm --watch",
"css:build:dist": "compile-less -d src --combine lib/dist.css --rm-global",
"ts:watch": "tsbb watch --env-name esm:dev --env-name cjs --target react",
"ts:build": "tsbb build --target react"
"css:watch": "compile-less -d src -o esm --watch",
"css:build": "compile-less -d src -o esm",
"css:build:dist": "compile-less -d src --combine dist.css --rm-global",
"watch": "tsbb watch & npm run css:watch",
"build": "tsbb build && npm run css:build && npm run css:build:dist"
},
"repository": {
"type": "git",
Expand All @@ -31,28 +24,29 @@
"license": "MIT",
"files": [
"src",
"lib"
"esm",
"cjs"
],
"peerDependencies": {
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
},
"devDependencies": {
"@kkt/less-modules": "6.10.4",
"@kkt/raw-modules": "6.10.4",
"@kkt/scope-plugin-options": "6.10.4",
"@types/react": "17.0.11",
"@types/react-dom": "17.0.8",
"@uiw/react-code-preview": "1.11.13",
"@kkt/less-modules": "6.11.0",
"@kkt/raw-modules": "6.11.0",
"@kkt/scope-plugin-options": "6.11.0",
"@types/react": "17.0.19",
"@types/react-dom": "17.0.9",
"@uiw/react-code-preview": "1.12.1",
"@uiw/react-github-corners": "1.4.0",
"@uiw/react-markdown-preview": "3.1.1",
"@uiw/reset.css": "1.0.4",
"compile-less-cli": "1.8.0",
"kkt": "6.10.4",
"rehype-attr": "1.3.2",
"@uiw/react-markdown-preview": "3.2.2",
"@uiw/reset.css": "1.0.5",
"compile-less-cli": "1.8.1",
"kkt": "6.11.0",
"rehype-attr": "1.4.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"tsbb": "2.2.1",
"tsbb": "3.0.0-rc.13",
"uiw": "4.9.1"
},
"eslintConfig": {
Expand Down
5 changes: 5 additions & 0 deletions src/react-app-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/// <reference types="react-scripts" />

declare module '*.less' {
const classes: { readonly [key: string]: string };
export default classes;
}
29 changes: 6 additions & 23 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
{
"extends": "../tsconfig",
"include": ["../src"],
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"declaration": true,
"baseUrl": ".",
"jsx": "react",
"typeRoots": [
"node_modules/@types",
]
},
"include": ["../src"]
"outDir": "../cjs",
"emitDeclarationOnly": true,
"noEmit": false
}
}
14 changes: 10 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"target": "es5",
"target": "esnext",
"module": "esnext",
"lib": [
"dom",
"dom.iterable",
Expand All @@ -12,17 +13,22 @@
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"declaration": true,
"baseUrl": "website",
"baseUrl": "./website",
"jsx": "react-jsx",
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"experimentalDecorators": true,
"removeComments": false,
"types": ["node"],
"noEmit": true
},
"include": [
"website"
"website",
"src",
".kktrc.ts"
]
}
2 changes: 1 addition & 1 deletion website/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRef, useEffect, useState } from 'react';
import { Menu, Button } from 'uiw';
import Markdown from './components/Markdown';
import Split from '../';
import Split from '..';

export default class Page extends Markdown {
dependencies = { Split, Menu, Button, useRef, useEffect, useState };
Expand Down
1 change: 0 additions & 1 deletion website/components/Markdown/Code.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import CodePreview, { CodePreviewProps } from '@uiw/react-code-preview';

export interface CodeProps extends CodePreviewProps {
Expand Down
34 changes: 19 additions & 15 deletions website/components/Markdown/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { Component } from 'react';
import MarkdownPreview from '@uiw/react-markdown-preview';
import rehypeAttr from 'rehype-attr';
import Code, { CodeProps } from './Code';
import Code from './Code';
import styles from './index.module.less';

interface MarkdownProps { }
Expand Down Expand Up @@ -49,7 +49,7 @@ export default class Markdown extends Component<MarkdownProps, MarkdownState> {
mdStr: '',
};
}
getMdStr?: any;
getMdStr?: () => Promise<typeof import("*.md")>;
dependencies?: any;
componentDidMount() {
if (this.getMdStr) {
Expand All @@ -75,19 +75,23 @@ export default class Markdown extends Component<MarkdownProps, MarkdownState> {
* noScroll 预览区域不显示滚动条。
* codePen 显示 Codepen 按钮,要特别注意 包导入的问题,实例中的 import 主要用于 Codepen 使用。
*/
code: ({ inline, node, noPreview, noScroll, bgWhite, noCode, codePen, codeSandbox, ...props }) => {
const conf = { noPreview, noScroll, bgWhite, noCode, codePen, codeSandbox } as CodeProps;
if (noPreview || noScroll || bgWhite || noCode || codePen || codeSandbox) {
return (
<Code
{...conf}
code={getCodeStr(node.children)}
dependencies={this.dependencies}
language={(props.className || '').replace(/^language-/, '')}
/>
);
code: ({ inline, node, ...props }) => {
const { noPreview, noScroll, bgWhite, noCode, codePen, codeSandbox } = props as any;
if (inline) {
return <code {...props} />;
}
return <code {...props} />;
const config = { noPreview, noScroll, bgWhite, noCode, codePen } as any;
if (Object.keys(config).filter((name) => config[name] !== undefined).length === 0) {
return <code {...props} />;
}
return (
<Code
code={getCodeStr(node.children)}
dependencies={this.dependencies}
language={(props.className || '').replace(/^language-/, '')}
{...{ noPreview, noScroll, bgWhite, noCode, codePen, codeSandbox }}
/>
);
},
}}
/>
Expand Down
75 changes: 4 additions & 71 deletions website/react-app-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,78 +1,11 @@
/// <reference types="node" />
/// <reference types="react" />
/// <reference types="react-dom" />

declare namespace NodeJS {
interface ProcessEnv {
readonly NODE_ENV: 'development' | 'production' | 'test';
readonly PUBLIC_URL: string;
}
}

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>>;

const src: string;
export default src;
}

declare module '*.module.less' {
const classes: { readonly [key: string]: string };
export default classes;
}
/// <reference types="react-scripts" />

declare module '*.less' {
const src: string;
export default src;
}
declare module '*.md' {
const src: string;
export default src;
}

declare module '*.module.css' {
const classes: { readonly [key: string]: string };
export default classes;
}

declare module '*.module.scss' {
const classes: { readonly [key: string]: string };
export default classes;
}

declare module '*.module.sass' {
const classes: { readonly [key: string]: string };
export default classes;
declare module '*.md' {
const file: string;
export default file;
}
Loading

0 comments on commit 3cbe903

Please sign in to comment.