Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.

Commit 06c5afa

Browse files
committedJun 14, 2019
build: refine source code structure to reach full typescript
1 parent a49fa3d commit 06c5afa

28 files changed

+189
-159
lines changed
 

Diff for: ‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
lib
33
.temp
44
types
5+
src/**/*.js
56

67
### Code ###
78
# Visual Studio Code - https://code.visualstudio.com/

Diff for: ‎examples/blog/.vuepress/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
title: `ULIVZ`,
33
plugins: [
4-
[require('../../../lib'), {
4+
[require('../../../lib/node'), {
55
directories: [
66
{
77
// Unique ID of current classification

Diff for: ‎examples/blog/.vuepress/theme/layouts/Layout.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
<router-link v-if="$pagination.hasPrev" :to="$pagination.prevLink">Prev</router-link>
1010
<router-link v-if="$pagination.hasNext" :to="$pagination.nextLink">Next</router-link>
1111
</div>
12-
13-
<Pagination />
12+
13+
<Pagination/>
1414
</div>
1515
</template>
1616

1717
<script>
18-
import Pagination from '../../../../../src/components/Pagination'
18+
import { Pagination } from '../../../../../lib/client/components.js'
1919
2020
export default {
2121
components: { Pagination },
2222
created() {
2323
console.log(this.$route.meta.pid)
2424
console.log(this.$currentTag)
25-
}
25+
},
2626
}
2727
</script>

Diff for: ‎examples/directory-classifier/.vuepress/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
title: `ULIVZ`,
33
plugins: [
4-
[require('../../../lib'), {
4+
[require('../../../lib/node'), {
55
directories: [
66
{
77
// Unique ID of current classification

Diff for: ‎examples/frontmatter-classifier/.vuepress/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
title: `ULIVZ`,
33
plugins: [
4-
[require('../../../lib'), {
4+
[require('../../../lib/node'), {
55
frontmatters: [
66
{
77
// Unique ID of current classification

Diff for: ‎package.json

+17-35
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,20 @@
44
"description": "Offical blog plugin for VuePress",
55
"scripts": {
66
"lint": "xo",
7-
"dev": "npm run cpc && tsc -skipLibCheck --watch",
8-
"cpc": "cp -r src/client lib",
9-
"build": "tsc -skipLibCheck && npm run cpc",
7+
"dev": "concurrently \"yarn dev:client\" \"yarn dev:node\" \"yarn build:components\"",
8+
"build": "concurrently \"yarn build:client\" \"yarn build:node\" \"yarn build:components\"",
9+
"dev:client": "tsc -p tsconfig.client.json --watch",
10+
"dev:node": "tsc -p tsconfig.node.json --watch",
11+
"build:client": "tsc -p tsconfig.client.json",
12+
"build:node": "tsc -p tsconfig.node.json",
13+
"build:components": "mkdir -p lib/client/components && cp -r src/client/components lib/client",
1014
"dev:docs": "vuepress dev docs --temp docs/.temp",
1115
"build:docs": "vuepress build docs --temp docs/.temp",
1216
"example": "node examples/launch.js",
1317
"prepare": "npm run build",
1418
"prepublishOnly": "npm run build && conventional-changelog -p angular -r 2 -i CHANGELOG.md -s"
1519
},
16-
"main": "lib/index.js",
20+
"main": "lib/node/index.js",
1721
"files": [
1822
"lib",
1923
"docs",
@@ -25,24 +29,17 @@
2529
},
2630
"author": "ULIVZ <chl814@foxmail.com>",
2731
"license": "MIT",
32+
"dependencies": {
33+
"vuejs-paginate": "^2.1.0"
34+
},
2835
"devDependencies": {
36+
"concurrently": "^4.1.0",
2937
"conventional-changelog-cli": "^2.0.1",
30-
"eslint-config-prettier": "^3.3.0",
31-
"eslint-config-rem": "^4.0.0",
32-
"eslint-config-xo-typescript": "^0.3.0",
33-
"eslint-plugin-prettier": "^3.0.0",
34-
"eslint-plugin-typescript": "^0.14.0",
35-
"husky": "^1.2.0",
3638
"inquirer": "^6.3.1",
37-
"lint-staged": "^8.1.0",
3839
"nodemon": "^1.18.7",
39-
"prettier": "^1.15.2",
4040
"ts-node": "^7.0.1",
41-
"typescript": "^3.1.4",
42-
"typescript-eslint-parser": "^21.0.2",
43-
"vuejs-paginate": "^2.1.0",
44-
"vuepress": "^1.0.0",
45-
"xo": "^0.23.0"
41+
"typescript": "3.1.4",
42+
"vuepress": "^1.0.0"
4643
},
4744
"xo": {
4845
"extends": [
@@ -63,24 +60,9 @@
6360
"typescript/no-var-requires": "off",
6461
"no-implicit-globals": "off",
6562
"import/no-unresolved": "off",
66-
"import/no-extraneous-dependencies": "off"
67-
}
68-
},
69-
"husky": {
70-
"hooks": {
71-
"pre-commit": "lint-staged"
72-
}
73-
},
74-
"lint-staged": {
75-
"linters": {
76-
"*.{ts,js}": [
77-
"xo --fix",
78-
"git add"
79-
],
80-
"*.{json,md}": [
81-
"prettier --write",
82-
"git add"
83-
]
63+
"import/no-extraneous-dependencies": "off",
64+
"typescript/no-use-before-define": "off",
65+
"typescript/no-type-alias": "off"
8466
}
8567
},
8668
"publishConfig": {

Diff for: ‎src/client/classification.js renamed to ‎src/client/classification.ts

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
// @ts-ignore
12
import { findPageByKey } from '@app/util'
2-
import frontmatterClassifiedPageMap from '@dynamic/vuepress_blog/frontmatterClassified'
3+
// @ts-ignore
4+
import frontmatterClassifiedMap from '@dynamic/vuepress_blog/frontmatterClassified'
5+
import { VuePressPage } from '../types/VuePress'
36

47
class Classifiable {
8+
private _metaMap: any
9+
510
constructor(metaMap, pages) {
611
this._metaMap = Object.assign({}, metaMap)
712
Object.keys(this._metaMap).forEach(name => {
@@ -27,7 +32,12 @@ class Classifiable {
2732
}
2833

2934
toArray() {
30-
const tags = []
35+
const tags: Array<{
36+
name: string
37+
pages: VuePressPage[]
38+
path: string
39+
}> = []
40+
3141
Object.keys(this._metaMap).forEach(name => {
3242
const { pages, path } = this._metaMap[name]
3343
tags.push({ name, pages, path })
@@ -41,18 +51,22 @@ class Classifiable {
4151
}
4252

4353
export default ({ Vue }) => {
44-
const computed = Object.keys(frontmatterClassifiedPageMap)
54+
const computed = Object.keys(frontmatterClassifiedMap)
4555
.map(classifiedType => {
46-
const map = frontmatterClassifiedPageMap[classifiedType]
56+
const map = frontmatterClassifiedMap[classifiedType]
4757
const helperName = `$${classifiedType}`
4858
return {
4959
[helperName]() {
60+
// @ts-ignore
5061
const { pages } = this.$site
5162
const classified = new Classifiable(map, pages)
5263
return classified
5364
},
54-
[`$current${classifiedType.charAt(0).toUpperCase() + classifiedType.slice(1)}`]() {
65+
[`$current${classifiedType.charAt(0).toUpperCase() +
66+
classifiedType.slice(1)}`]() {
67+
// @ts-ignore
5568
const tagName = this.$route.meta.id
69+
// @ts-ignore
5670
return this[helperName].getItemByName(tagName)
5771
},
5872
}

Diff for: ‎src/client/components.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @ts-ignore
2+
import Pagination from './components/Pagination.vue'
3+
// @ts-ignore
4+
import SimplePagination from './components/SimplePagination.vue'
5+
6+
export { Pagination, SimplePagination }

Diff for: ‎src/components/Pagination.vue renamed to ‎src/client/components/Pagination.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,20 @@
1212

1313
<script>
1414
import Paginate from 'vuejs-paginate'
15-
15+
1616
export default {
1717
data() {
1818
return {
1919
page: 0,
2020
}
2121
},
2222
components: { Paginate },
23+
created() {
24+
this.page = this.$pagination.paginationIndex + 1
25+
},
2326
methods: {
2427
clickCallback(pageNum) {
2528
const link = this.$pagination.getSpecificPageLink(pageNum - 1)
26-
console.log(link)
2729
this.$router.push(link)
2830
},
2931
},
File renamed without changes.

Diff for: ‎src/client/init.js

-2
This file was deleted.

Diff for: ‎src/client/pagination.js renamed to ‎src/client/pagination.ts

+17
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
import Vue from 'vue'
2+
// @ts-ignore
23
import paginations from '@dynamic/vuepress_blog/paginations'
34
import _debug from 'debug'
45

56
const debug = _debug('plugin-blog:pagination')
67

78
class Pagination {
9+
public paginationIndex: number
10+
11+
public _paginationPages: any
12+
13+
public _currentPage: any
14+
15+
public _matchedPages: any
16+
17+
public _indexPage: string
18+
819
constructor(pagination, pages, route) {
920
debug(pagination)
1021
const { pages: paginationPages } = pagination
@@ -71,11 +82,14 @@ class Pagination {
7182
}
7283

7384
class PaginationGateway {
85+
private paginations: any
86+
7487
constructor(paginations) {
7588
this.paginations = paginations
7689
}
7790

7891
get pages() {
92+
// @ts-ignore
7993
return Vue.$vuepress.$get('siteData').pages
8094
}
8195

@@ -96,15 +110,18 @@ export default ({ Vue }) => {
96110
methods: {
97111
$getPagination(pid, id) {
98112
id = id || pid
113+
// @ts-ignore
99114
return gateway.getPagination(pid, id, this.$route)
100115
},
101116
},
102117
computed: {
103118
$pagination() {
119+
// @ts-ignore
104120
if (!this.$route.meta.pid || !this.$route.meta.id) {
105121
return {}
106122
}
107123

124+
// @ts-ignore
108125
return this.$getPagination(this.$route.meta.pid, this.$route.meta.id)
109126
},
110127
},

Diff for: ‎src/interface/Classifier.ts

-9
This file was deleted.

Diff for: ‎src/interface/ExtraPages.ts

-5
This file was deleted.

Diff for: ‎src/handleOptions.ts renamed to ‎src/node/handleOptions.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BlogPluginOptions } from './interface/Options'
22
import { ExtraPage } from './interface/ExtraPages'
33
import { PageEnhancer } from './interface/PageEnhancer'
4-
import { AppContext } from './interface/VuePress'
4+
import { VuePressContext } from './interface/VuePress'
55
import { InternalPagination, PaginationConfig } from './interface/Pagination'
66
import { FrontmatterClassificationPage } from './interface/Frontmatter'
77
import {
@@ -19,7 +19,10 @@ import { ClassifierTypeEnum } from './interface/Classifier'
1919
* @returns {*}
2020
*/
2121

22-
export function handleOptions(options: BlogPluginOptions, ctx: AppContext) {
22+
export function handleOptions(
23+
options: BlogPluginOptions,
24+
ctx: VuePressContext,
25+
) {
2326
const { directories = [], frontmatters = [] } = options
2427

2528
const pageEnhancers: PageEnhancer[] = []

Diff for: ‎src/index.ts renamed to ‎src/node/index.ts

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import * as path from 'path'
22
import { handleOptions } from './handleOptions'
3-
import { registerPagination } from './pagination'
3+
import { registerPaginations } from './pagination'
44
import { BlogPluginOptions } from './interface/Options'
5-
import { AppContext, Page } from './interface/VuePress'
65
import { logPages, resolvePaginationConfig } from './util'
76
import { ClassifierTypeEnum, DefaultLayoutEnum } from './interface/Classifier'
7+
import { VuePressContext, VuePressPage } from './interface/VuePress'
88

9-
function injectExtraAPI(ctx: AppContext) {
9+
function injectExtraAPI(ctx: VuePressContext) {
1010
const { layoutComponentMap } = ctx.themeAPI
1111

1212
/**
@@ -22,7 +22,7 @@ function injectExtraAPI(ctx: AppContext) {
2222
}
2323
}
2424

25-
module.exports = (options: BlogPluginOptions, ctx: AppContext) => {
25+
module.exports = (options: BlogPluginOptions, ctx: VuePressContext) => {
2626
injectExtraAPI(ctx)
2727

2828
const {
@@ -38,7 +38,7 @@ module.exports = (options: BlogPluginOptions, ctx: AppContext) => {
3838
/**
3939
* 1. Execute `pageEnhancers` generated in handleOptions
4040
*/
41-
extendPageData(pageCtx: Page) {
41+
extendPageData(pageCtx: VuePressPage) {
4242
const { frontmatter: rawFrontmatter } = pageCtx
4343

4444
pageEnhancers.forEach(({ when, data = {}, frontmatter = {} }) => {
@@ -143,14 +143,14 @@ module.exports = (options: BlogPluginOptions, ctx: AppContext) => {
143143
logPages(`Automatically Added Index Pages`, allExtraPages)
144144

145145
await Promise.all(allExtraPages.map(async page => ctx.addPage(page)))
146-
await registerPagination(paginations, ctx)
146+
await registerPaginations(paginations, ctx)
147147
},
148148

149149
/**
150150
* Generate tag and category metadata.
151151
*/
152152
async clientDynamicModules() {
153-
const frontmatterClassifiedPageMap = ctx.frontmatterClassificationPages.reduce(
153+
const frontmatterClassifiedMap = ctx.frontmatterClassificationPages.reduce(
154154
(map, page) => {
155155
map[page.id] = page.map
156156
return map
@@ -164,7 +164,7 @@ module.exports = (options: BlogPluginOptions, ctx: AppContext) => {
164164
{
165165
name: `${PREFIX}/frontmatterClassified.js`,
166166
content: `export default ${JSON.stringify(
167-
frontmatterClassifiedPageMap,
167+
frontmatterClassifiedMap,
168168
null,
169169
2,
170170
)}`,
@@ -193,8 +193,8 @@ export default ${serializePaginations(ctx.serializedPaginations, [
193193
},
194194

195195
enhanceAppFiles: [
196-
path.resolve(__dirname, 'client/classification.js'),
197-
path.resolve(__dirname, 'client/pagination.js'),
196+
path.resolve(__dirname, '../client/classification.js'),
197+
path.resolve(__dirname, '../client/pagination.js'),
198198
],
199199
}
200200
}

Diff for: ‎src/node/interface/Classifier.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export enum ClassifierTypeEnum {
2+
Directory = 'Directory',
3+
Frontmatter = 'Frontmatter',
4+
}
5+
6+
export enum DefaultLayoutEnum {
7+
FrontmatterPagination = 'FrontmatterPagination',
8+
DirectoryPagination = 'DirectoryPagination',
9+
}
10+
11+
export interface FrontmatterClassifiedIdMap<T = undefined> {
12+
[id: string]: T & {
13+
scope: string;
14+
path: string;
15+
pageKeys: string[]
16+
}
17+
}
18+
19+
export interface FrontmatterClassifiedMap {
20+
[pid: string]: FrontmatterClassifiedIdMap;
21+
}

Diff for: ‎src/node/interface/ExtraPages.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export interface ExtraPage {
2+
permalink: string
3+
frontmatter?: Record<string, any>
4+
meta?: Record<string, any>
5+
}
File renamed without changes.
File renamed without changes.

Diff for: ‎src/interface/PageEnhancer.ts renamed to ‎src/node/interface/PageEnhancer.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { Page } from './VuePress'
1+
import { VuePressPage } from './VuePress'
22

33
export interface PageEnhancer {
44
/**
55
* Conditions for enhancer execution
66
*/
7-
when($page: Page): boolean;
7+
when($page: VuePressPage): boolean;
88

99
/**
1010
* frontmatter injected to matched pages

Diff for: ‎src/interface/Pagination.ts renamed to ‎src/node/interface/Pagination.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
/**
22
* Config of a Pagination
33
*/
4-
import { Page } from './VuePress'
4+
import { VuePressPage } from './VuePress'
55
import { ClassifierTypeEnum } from './Classifier'
66

7-
export type PageFilter = (page: Page) => boolean
8-
export type PageSorter = (prev: Page, next: Page) => boolean | number
7+
export type PageFilter = (page: VuePressPage) => boolean
8+
export type PageSorter = (
9+
prev: VuePressPage,
10+
next: VuePressPage,
11+
) => boolean | number
912
export type GetPaginationPageUrl = (index: number) => string
1013
export type getPaginationPageTitle = (index: number) => string
1114

Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
1-
import Vue from 'vue'
1+
import {
2+
VuePressContext as BaseContext,
3+
VuePressPage as BasePage,
4+
} from '../../types/VuePress'
25
import { FrontmatterClassificationPage } from './Frontmatter'
36
import { SerializedPagination } from './Pagination'
47

5-
export interface Page {
6-
key: string;
7-
regularPath: string;
8-
frontmatter: Record<string, string>;
9-
}
10-
11-
export interface AppContext {
12-
pages: Page[];
13-
themeAPI: {
14-
layoutComponentMap: Record<string, Vue>
15-
};
16-
addPage: any;
17-
}
18-
19-
export interface AppContext {
8+
export interface VuePressContext extends BaseContext {
209
frontmatterClassificationPages: FrontmatterClassificationPage[];
2110
serializedPaginations: SerializedPagination[];
2211
pageFilters: any;
2312
pageSorters: any;
2413
getLayout: (name?: string, fallback?: string) => string | undefined;
2514
}
15+
16+
export interface VuePressPage extends BasePage {}

Diff for: ‎src/pagination.ts renamed to ‎src/node/pagination.ts

+35-39
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AppContext } from './interface/VuePress'
1+
import { VuePressContext } from './interface/VuePress'
22
import {
33
InternalPagination,
44
PageFilter,
@@ -8,9 +8,30 @@ import {
88
} from './interface/Pagination'
99
import { logPages } from './util'
1010

11-
export async function registerPagination(
11+
/**
12+
* Divided an interval of several lengths into several equal-length intervals.
13+
*/
14+
15+
function getIntervallers(max, interval) {
16+
const count =
17+
max % interval === 0
18+
? Math.floor(max / interval)
19+
: Math.floor(max / interval) + 1
20+
const arr = [...new Array(count)]
21+
// @ts-ignore
22+
return arr.map((v, index) => {
23+
const start = index * interval
24+
const end = (index + 1) * interval - 1
25+
return [start, end > max ? max : end]
26+
})
27+
}
28+
29+
/**
30+
* Register paginations
31+
*/
32+
export async function registerPaginations(
1233
paginations: InternalPagination[],
13-
ctx: AppContext,
34+
ctx: VuePressContext,
1435
) {
1536
ctx.serializedPaginations = []
1637
ctx.pageFilters = []
@@ -54,18 +75,10 @@ export async function registerPagination(
5475
recordPageFilters(pid, filter)
5576
recordPageSorters(pid, sorter)
5677

57-
logPages(
58-
`Automatically generated pagination pages`,
59-
pagination.pages.slice(1),
60-
)
61-
62-
await Promise.all(
63-
pagination.pages.map(async ({ path }, index) => {
64-
if (index === 0) {
65-
return
66-
}
67-
68-
return ctx.addPage({
78+
const extraPages = pagination.pages
79+
.slice(1) // The index page has been generated.
80+
.map(({ path }, index) => {
81+
return {
6982
permalink: path,
7083
frontmatter: {
7184
layout,
@@ -75,31 +88,14 @@ export async function registerPagination(
7588
pid,
7689
id,
7790
},
78-
})
79-
}),
80-
)
91+
}
92+
})
93+
94+
logPages(`Automatically generated pagination pages`, extraPages)
95+
96+
await Promise.all(extraPages.map(page => ctx.addPage(page)))
97+
8198
// @ts-ignore
8299
ctx.serializedPaginations.push(pagination)
83100
}
84101
}
85-
86-
/**
87-
* Divided an interval of several lengths into several equal-length intervals.
88-
*
89-
* @param max
90-
* @param interval
91-
*/
92-
93-
function getIntervallers(max, interval) {
94-
const count =
95-
max % interval === 0
96-
? Math.floor(max / interval)
97-
: Math.floor(max / interval) + 1
98-
const arr = [...new Array(count)]
99-
// @ts-ignore
100-
return arr.map((v, index) => {
101-
const start = index * interval
102-
const end = (index + 1) * interval - 1
103-
return [start, end > max ? max : end]
104-
})
105-
}

Diff for: ‎src/util.ts renamed to ‎src/node/util.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { env } from '@vuepress/shared-utils'
2-
import { AppContext, Page } from './interface/VuePress'
2+
import { VuePressContext, VuePressPage } from './interface/VuePress'
33
import { ClassifierTypeEnum, DefaultLayoutEnum } from './interface/Classifier'
44
import { PaginationConfig } from './interface/Pagination'
55

@@ -58,7 +58,7 @@ export function resolvePaginationConfig(
5858
indexPath,
5959
pid, // post / tag
6060
id, // post / js
61-
ctx: AppContext,
61+
ctx: VuePressContext,
6262
keys: string[] = [''], // ['js']
6363
) {
6464
return Object.assign(
@@ -79,7 +79,7 @@ export function resolvePaginationConfig(
7979
? getIdentityFilter(pid, id)
8080
: getFrontmatterClassifierPageFilter(keys, id),
8181

82-
sorter: (prev: Page, next: Page) => {
82+
sorter: (prev: VuePressPage, next: VuePressPage) => {
8383
const prevTime = new Date(prev.frontmatter.date).getTime()
8484
const nextTime = new Date(next.frontmatter.date).getTime()
8585
return prevTime - nextTime > 0 ? -1 : 1
@@ -91,8 +91,7 @@ export function resolvePaginationConfig(
9191

9292
function getIdentityFilter(pid, id) {
9393
return new Function(
94-
// @ts-ignore
95-
['page'],
94+
'page',
9695
`return page.pid === ${JSON.stringify(pid)} && page.id === ${JSON.stringify(
9796
id,
9897
)}`,
@@ -102,7 +101,7 @@ function getIdentityFilter(pid, id) {
102101
function getFrontmatterClassifierPageFilter(keys, value) {
103102
return new Function(
104103
// @ts-ignore
105-
['page'],
104+
'page',
106105
`
107106
const keys = ${JSON.stringify(keys)};
108107
const value = ${JSON.stringify(value)};

Diff for: ‎tsconfig.client.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"target": "es2015",
5+
"module": "esnext",
6+
"outDir": "./lib/client"
7+
},
8+
"include": ["./src/client/**/*.ts"]
9+
}

Diff for: ‎tsconfig.json

+4-16
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
{
22
"compilerOptions": {
3-
"target": "esnext",
4-
"module": "commonjs",
5-
"lib": [
6-
"dom",
7-
"es6",
8-
"es2017",
9-
"esnext.asynciterable"
10-
],
3+
"lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
4+
"target": "es2015",
5+
"skipLibCheck": true,
116
"sourceMap": false,
12-
"outDir": "./lib",
137
"declaration": true,
148
"declarationDir": "types",
159
"moduleResolution": "node",
@@ -26,11 +20,5 @@
2620
"emitDecoratorMetadata": true,
2721
"experimentalDecorators": true
2822
},
29-
"exclude": [
30-
"node_modules"
31-
],
32-
"include": [
33-
"./src/**/*.tsx",
34-
"./src/**/*.ts"
35-
]
23+
"exclude": ["node_modules"]
3624
}

Diff for: ‎tsconfig.node.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"target": "esnext",
5+
"module": "commonjs",
6+
"outDir": "./lib/node"
7+
},
8+
"include": ["./src/node/**/*.ts"]
9+
}

0 commit comments

Comments
 (0)
This repository has been archived.