Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
ntnyq committed Sep 15, 2024
1 parent 9807e3f commit f8dd2ff
Show file tree
Hide file tree
Showing 20 changed files with 910 additions and 637 deletions.
2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

9 changes: 1 addition & 8 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
import { ntnyq } from '@ntnyq/eslint-config'

export default ntnyq({}, [
{
files: ['**/*.d.ts'],
rules: {
'no-use-before-define': 'off',
},
},
])
export default ntnyq()
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "taro-define-config",
"version": "0.6.2",
"packageManager": "pnpm@9.9.0",
"packageManager": "pnpm@9.10.0",
"description": "Provide a defineConfig function for tarojs config",
"keywords": [
"tarojs",
Expand Down Expand Up @@ -57,18 +57,18 @@
"webpack": "^5.94.0"
},
"devDependencies": {
"@ntnyq/eslint-config": "^3.0.0-beta.4",
"@ntnyq/eslint-config": "^3.0.0-beta.12",
"@ntnyq/prettier-config": "^1.21.2",
"bumpp": "^9.5.2",
"eslint": "^9.9.1",
"husky": "^9.1.5",
"eslint": "^9.10.0",
"husky": "^9.1.6",
"nano-staged": "^0.8.0",
"npm-run-all2": "^6.2.2",
"npm-run-all2": "^6.2.3",
"prettier": "^3.3.3",
"taro-define-config": "workspace:*",
"tsup": "^8.2.4",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
"typescript": "^5.6.2",
"vitest": "^2.1.1"
},
"prettier": "@ntnyq/prettier-config",
"nano-staged": {
Expand Down
1,453 changes: 868 additions & 585 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/config/compiler.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Compile } from './common'
import type { ESBuildBuildOptions, SWCOptions } from './packages'
import type { Configuration as WebpackConfig } from 'webpack'
import type { LiteralUnion } from '../utility-types'
import type { Compile } from './common'
import type { ESBuildBuildOptions, SWCOptions } from './packages'

export type CompilerType = LiteralUnion<'webpack4' | 'webpack5'>

Expand Down
16 changes: 8 additions & 8 deletions src/config/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import type { LiteralUnion } from '../utility-types'
import type { SassOptions } from './packages'
import type { Copy } from './copy'
import type { Cache } from './cache'
import type { Logger } from './logger'
import type { Plugin } from './plugin'
import type { Preset } from './preset'
import type { Compiler } from './compiler'
import type { Copy } from './copy'
import type { DesignWidth } from './design-width'
import type { PlatformH5, PlatformMini, PlatformRN } from './platforms'
import type { Logger } from './logger'
import type {
CSSMinimizer,
CSSOMinimizer,
EsbuildMinimizer,
JSMinimizer,
TerserMinimizer,
} from './minimizers'
import type { SassOptions } from './packages'
import type { PlatformH5, PlatformMini, PlatformRN } from './platforms'
import type { Plugin } from './plugin'
import type { Preset } from './preset'

export type Framework = LiteralUnion<'react' | 'preact' | 'nerv' | 'vue' | 'vue3'>

Expand Down Expand Up @@ -197,10 +197,10 @@ export interface TaroConfig {
mini?: PlatformMini
}

export * from './common'

export * from './copy'

export * from './cache'
export * from './common'
export * from './logger'
export * from './plugin'
export * from './preset'
Expand Down
2 changes: 1 addition & 1 deletion src/config/minimizers/css.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { LiteralUnion } from '../../utility-types'
import type { CSSNanoOptions } from '../packages'
import type { ConfigurablePlugin } from '../common'
import type { CSSNanoOptions } from '../packages'

export type CSSMinimizer = LiteralUnion<'csso' | 'esbuild' | 'parcelCss'>

Expand Down
4 changes: 2 additions & 2 deletions src/config/minimizers/js.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { EsbuildPluginOptions, TerserMinifyOptions } from '../packages'
import type { ConfigurablePlugin } from '../common'
import type { LiteralUnion } from '../../utility-types'
import type { ConfigurablePlugin } from '../common'
import type { EsbuildPluginOptions, TerserMinifyOptions } from '../packages'

export type JSMinimizer = LiteralUnion<'terser' | 'esbuild'>

Expand Down
2 changes: 1 addition & 1 deletion src/config/packages/esbuild-loader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @see https://www.npmjs.com/package/esbuild-loader?activeTab=code
*/

import type { TransformOptions, transform } from './esbuild'
import type { transform, TransformOptions } from './esbuild'

type Filter = string | RegExp

Expand Down
2 changes: 1 addition & 1 deletion src/config/packages/html-webpack-plugin.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Options as HtmlMinifierOptions } from 'html-minifier-terser'
/**
* `html-webpack-plugin` 配置
*
* @see https://github.com/jantimon/html-webpack-plugin#options
*/
import type { AsyncSeriesWaterfallHook } from 'tapable'
import type { Compilation, Compiler } from 'webpack'
import type { Options as HtmlMinifierOptions } from 'html-minifier-terser'

declare class HtmlWebpackPlugin {
constructor(options?: HtmlWebpackPlugin.Options)
Expand Down
10 changes: 5 additions & 5 deletions src/config/packages/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ export * from './sass'
export * from './less'
export * from './stylus'
export * from './cssnano'
export * from './autoprefixer'

export * from './css-loader'

export * from './url-loader'
export * from './sass-loader'
export * from './less-loader'
export * from './postcss-url'
export * from './autoprefixer'
export * from './style-loader'
export * from './stylus-loader'

export * from './postcss-url'
export * from './stylus-loader'
export * from './postcss-css-modules'
export * from './postcss-pxtransform'
export * from './postcss-html-transform'

export { ChainableWebpackConfig } from './webpack-chain'
export { Options as SWCOptions } from './swc-core'
export { EsbuildPluginOptions } from './esbuild-loader'
export { ChainableWebpackConfig } from './webpack-chain'
export { MinifyOptions as TerserMinifyOptions } from './terser'
export { BuildOptions as ESBuildBuildOptions } from './esbuild'

Expand Down
2 changes: 1 addition & 1 deletion src/config/packages/postcss-pxtransform.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
* @see https://github.com/NervJS/taro/tree/main/packages/postcss-pxtransform#配置-options
*/

import type { DesignWidth } from '../design-width'
import type { LiteralUnion } from '../../utility-types'
import type { DesignWidth } from '../design-width'

export type PostcssPxtransformPlatform = LiteralUnion<
'weapp' | 'h5' | 'rn' | 'quickapp' | 'harmony'
Expand Down
2 changes: 1 addition & 1 deletion src/config/packages/stylus-loader.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

import type { Buffer } from 'node:buffer'
import type { LoaderContext } from '../common'
import type { AnyFn } from '../../utility-types'
import type { LoaderContext } from '../common'
import type { StylusOptions } from './stylus'

export interface StylusOptionsResolveURL {
Expand Down
2 changes: 1 addition & 1 deletion src/config/platforms/h5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { LiteralUnion } from '../../utility-types'
import type { Compile, ConfigurablePlugin, ParseAstType, SourceMapType } from '../common'
import type {
AutoprefixerOptions,
CSSLoaderOptions,
ChainableWebpackConfig,
CSSLoaderOptions,
HtmlWebpackPluginOptions,
LessLoaderOptions,
MiniCSSExtractPluginOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/config/platforms/mini.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Compile, ConfigurablePlugin, ParseAstType, SourceMapType } from '../common'
import type {
AutoprefixerOptions,
CSSLoaderOptions,
ChainableWebpackConfig,
CSSLoaderOptions,
LessLoaderOptions,
MiniCSSExtractPluginOptions,
PostcssCssModulesOptions,
Expand Down
4 changes: 2 additions & 2 deletions src/config/platforms/rn.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/**
* ReactNative端专用配置
* ReactNative 端专用配置
*
* @see https://nervjs.github.io/taro-docs/docs/config-detail#rn
*/

import type { ConfigurablePlugin } from '../common'
import type {
LessOptions,
PostcssCssModulesOptions,
PostcssPxtransformOptions,
SassOptions,
StylusOptions,
} from '../packages'
import type { ConfigurablePlugin } from '../common'

/**
* @see https://github.com/NervJS/taro/blob/next/packages/taro-rn-style-transformer/README.md#rnless
Expand Down
8 changes: 4 additions & 4 deletions src/config/plugins/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export * from './html'
export * from './http'
export * from './inject'
export * from './miniCI'

export * from './mock'
export * from './indie'

export * from './inject'
export * from './miniCI'

export * from './platformXhs'
export * from './platformKwai'
export * from './platformLark'
export * from './platformXhs'
export * from './platformNextJs'
export * from './platformAlipayDd'
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Awaitable } from './utility-types'
import type { TaroConfig } from './config'
import type { Awaitable } from './utility-types'

export interface TaroConfigEnv {
/**
Expand Down
2 changes: 1 addition & 1 deletion test/index.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expectTypeOf, it } from 'vitest'
import { defineConfig } from 'taro-define-config'
import { expectTypeOf, it } from 'vitest'
import type { TaroConfigExport } from 'taro-define-config'

declare module 'taro-define-config' {
Expand Down
5 changes: 2 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"esModuleInterop": true,
"strict": true,
"noImplicitAny": true,
"skipLibCheck": false
},
"exclude": ["./taze.config.ts"]
"skipLibCheck": true
}
}

0 comments on commit f8dd2ff

Please sign in to comment.