chore: 移除 js 文件
parent
f2d855d25a
commit
d065103c70
|
@ -44,7 +44,7 @@ jobs:
|
||||||
- name: Build asset
|
- name: Build asset
|
||||||
run: pnpm build:asset
|
run: pnpm build:asset
|
||||||
|
|
||||||
- name: Test
|
- name: Typecheck
|
||||||
run: pnpm typecheck
|
run: pnpm typecheck
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
|
|
|
@ -17,12 +17,8 @@
|
||||||
"axios",
|
"axios",
|
||||||
"miniprogram",
|
"miniprogram",
|
||||||
"request",
|
"request",
|
||||||
"promise",
|
|
||||||
"alipay",
|
|
||||||
"uni-app",
|
"uni-app",
|
||||||
"wechat",
|
"wechat"
|
||||||
"fetch",
|
|
||||||
"network"
|
|
||||||
],
|
],
|
||||||
"author": "zjx0905 <954270063@qq.com>",
|
"author": "zjx0905 <954270063@qq.com>",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
@ -54,6 +50,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@commitlint/cli": "^17.4.4",
|
"@commitlint/cli": "^17.4.4",
|
||||||
"@commitlint/config-conventional": "^17.4.4",
|
"@commitlint/config-conventional": "^17.4.4",
|
||||||
|
"@rollup/plugin-typescript": "^11.1.0",
|
||||||
"@types/node": "^18.15.5",
|
"@types/node": "^18.15.5",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
"@typescript-eslint/eslint-plugin": "^5.55.0",
|
||||||
"@typescript-eslint/parser": "^5.55.0",
|
"@typescript-eslint/parser": "^5.55.0",
|
||||||
|
@ -78,6 +75,7 @@
|
||||||
"rollup-plugin-esbuild": "^5.0.0",
|
"rollup-plugin-esbuild": "^5.0.0",
|
||||||
"semver": "^7.3.8",
|
"semver": "^7.3.8",
|
||||||
"simple-git-hooks": "^2.8.1",
|
"simple-git-hooks": "^2.8.1",
|
||||||
|
"tslib": "^2.5.0",
|
||||||
"typescript": "^5.0.2",
|
"typescript": "^5.0.2",
|
||||||
"vitest": "^0.30.0"
|
"vitest": "^0.30.0"
|
||||||
},
|
},
|
||||||
|
|
|
@ -6,6 +6,7 @@ importers:
|
||||||
specifiers:
|
specifiers:
|
||||||
'@commitlint/cli': ^17.4.4
|
'@commitlint/cli': ^17.4.4
|
||||||
'@commitlint/config-conventional': ^17.4.4
|
'@commitlint/config-conventional': ^17.4.4
|
||||||
|
'@rollup/plugin-typescript': ^11.1.0
|
||||||
'@types/node': ^18.15.5
|
'@types/node': ^18.15.5
|
||||||
'@typescript-eslint/eslint-plugin': ^5.55.0
|
'@typescript-eslint/eslint-plugin': ^5.55.0
|
||||||
'@typescript-eslint/parser': ^5.55.0
|
'@typescript-eslint/parser': ^5.55.0
|
||||||
|
@ -30,11 +31,13 @@ importers:
|
||||||
rollup-plugin-esbuild: ^5.0.0
|
rollup-plugin-esbuild: ^5.0.0
|
||||||
semver: ^7.3.8
|
semver: ^7.3.8
|
||||||
simple-git-hooks: ^2.8.1
|
simple-git-hooks: ^2.8.1
|
||||||
|
tslib: ^2.5.0
|
||||||
typescript: ^5.0.2
|
typescript: ^5.0.2
|
||||||
vitest: ^0.30.0
|
vitest: ^0.30.0
|
||||||
devDependencies:
|
devDependencies:
|
||||||
'@commitlint/cli': 17.5.0
|
'@commitlint/cli': 17.5.0
|
||||||
'@commitlint/config-conventional': 17.4.4
|
'@commitlint/config-conventional': 17.4.4
|
||||||
|
'@rollup/plugin-typescript': 11.1.0_7sniqkrn5rmxrmax2dmiqcv3qu
|
||||||
'@types/node': 18.15.5
|
'@types/node': 18.15.5
|
||||||
'@typescript-eslint/eslint-plugin': 5.56.0_2hcjazgfnbtq42tcc73br2vup4
|
'@typescript-eslint/eslint-plugin': 5.56.0_2hcjazgfnbtq42tcc73br2vup4
|
||||||
'@typescript-eslint/parser': 5.56.0_j4766f7ecgqbon3u7zlxn5zszu
|
'@typescript-eslint/parser': 5.56.0_j4766f7ecgqbon3u7zlxn5zszu
|
||||||
|
@ -59,6 +62,7 @@ importers:
|
||||||
rollup-plugin-esbuild: 5.0.0_rollup@3.20.0
|
rollup-plugin-esbuild: 5.0.0_rollup@3.20.0
|
||||||
semver: 7.3.8
|
semver: 7.3.8
|
||||||
simple-git-hooks: 2.8.1
|
simple-git-hooks: 2.8.1
|
||||||
|
tslib: 2.5.0
|
||||||
typescript: 5.0.2
|
typescript: 5.0.2
|
||||||
vitest: 0.30.0
|
vitest: 0.30.0
|
||||||
|
|
||||||
|
@ -2136,6 +2140,26 @@ packages:
|
||||||
rollup: 3.20.0
|
rollup: 3.20.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@rollup/plugin-typescript/11.1.0_7sniqkrn5rmxrmax2dmiqcv3qu:
|
||||||
|
resolution: {integrity: sha512-86flrfE+bSHB69znnTV6kVjkncs2LBMhcTCyxWgRxLyfXfQrxg4UwlAqENnjrrxnSNS/XKCDJCl8EkdFJVHOxw==}
|
||||||
|
engines: {node: '>=14.0.0'}
|
||||||
|
peerDependencies:
|
||||||
|
rollup: ^2.14.0||^3.0.0
|
||||||
|
tslib: '*'
|
||||||
|
typescript: '>=3.7.0'
|
||||||
|
peerDependenciesMeta:
|
||||||
|
rollup:
|
||||||
|
optional: true
|
||||||
|
tslib:
|
||||||
|
optional: true
|
||||||
|
dependencies:
|
||||||
|
'@rollup/pluginutils': 5.0.2_rollup@3.20.0
|
||||||
|
resolve: 1.22.1
|
||||||
|
rollup: 3.20.0
|
||||||
|
tslib: 2.5.0
|
||||||
|
typescript: 5.0.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@rollup/pluginutils/3.1.0_rollup@2.79.1:
|
/@rollup/pluginutils/3.1.0_rollup@2.79.1:
|
||||||
resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==}
|
resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==}
|
||||||
engines: {node: '>= 8.0.0'}
|
engines: {node: '>= 8.0.0'}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
import { readFileSync } from 'node:fs';
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { RollupOptions, OutputOptions, Plugin, ModuleFormat } from 'rollup';
|
||||||
import esbuildPlugin from 'rollup-plugin-esbuild';
|
import esbuildPlugin from 'rollup-plugin-esbuild';
|
||||||
import dtsPlugin from 'rollup-plugin-dts';
|
import dtsPlugin from 'rollup-plugin-dts';
|
||||||
import { __dirname, distPath, getPkgJSON, resolve } from './scripts/utils.js';
|
import { __dirname, distPath, getPkgJSON, resolve } from './scripts/utils';
|
||||||
|
|
||||||
const pkg = getPkgJSON();
|
const pkg = getPkgJSON();
|
||||||
const inputPath = resolve('src/index.ts');
|
const inputPath = resolve('src/index.ts');
|
||||||
|
@ -19,9 +20,9 @@ function main() {
|
||||||
return configs;
|
return configs;
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildConfig(format) {
|
function buildConfig(format: ModuleFormat | 'dts'): RollupOptions {
|
||||||
const isDts = format === 'dts';
|
const isDts = format === 'dts';
|
||||||
const output = {
|
const output: OutputOptions = {
|
||||||
file: resolveOutput(format, isDts),
|
file: resolveOutput(format, isDts),
|
||||||
format: isDts ? 'es' : format,
|
format: isDts ? 'es' : format,
|
||||||
name: pkg.name,
|
name: pkg.name,
|
||||||
|
@ -43,7 +44,7 @@ function buildConfig(format) {
|
||||||
]
|
]
|
||||||
: esbuildPlugin({
|
: esbuildPlugin({
|
||||||
tsconfig: resolve('tsconfig.json'),
|
tsconfig: resolve('tsconfig.json'),
|
||||||
sourceMap: output.sourcemap,
|
sourceMap: output.sourcemap as boolean,
|
||||||
target: 'es2015',
|
target: 'es2015',
|
||||||
minify: true,
|
minify: true,
|
||||||
}),
|
}),
|
||||||
|
@ -51,11 +52,11 @@ function buildConfig(format) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function resolveOutput(format, isDts) {
|
function resolveOutput(format: string, isDts?: boolean) {
|
||||||
return resolve(distPath, `${pkg.name}${isDts ? '.d.ts' : `.${format}.js`}`);
|
return resolve(distPath, `${pkg.name}${isDts ? '.d.ts' : `.${format}.js`}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function compleTypePlugin(files) {
|
function compleTypePlugin(files: string[]): Plugin {
|
||||||
return {
|
return {
|
||||||
name: 'comple-type',
|
name: 'comple-type',
|
||||||
renderChunk: (code) =>
|
renderChunk: (code) =>
|
|
@ -16,7 +16,7 @@ function main() {
|
||||||
consola.info('Rollup');
|
consola.info('Rollup');
|
||||||
try {
|
try {
|
||||||
exec(
|
exec(
|
||||||
`rollup -c ${
|
`rollup -c rollup.config.ts --configPlugin typescript ${
|
||||||
watch ? '-w' : ''
|
watch ? '-w' : ''
|
||||||
} --environment SOURCE_MAP:${sourceMap},DTS:${dts}`,
|
} --environment SOURCE_MAP:${sourceMap},DTS:${dts}`,
|
||||||
);
|
);
|
||||||
|
|
|
@ -36,6 +36,7 @@ function checkBranch() {
|
||||||
const releaseBranch = 'main';
|
const releaseBranch = 'main';
|
||||||
const currentBranch = exec('git branch --show-current', {
|
const currentBranch = exec('git branch --show-current', {
|
||||||
stdio: 'pipe',
|
stdio: 'pipe',
|
||||||
|
encoding: 'utf-8',
|
||||||
})
|
})
|
||||||
.toString()
|
.toString()
|
||||||
.trim();
|
.trim();
|
||||||
|
|
|
@ -1,15 +1,25 @@
|
||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { createRequire } from 'node:module';
|
import { createRequire } from 'node:module';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import { execSync } from 'node:child_process';
|
import {
|
||||||
|
ExecSyncOptionsWithStringEncoding,
|
||||||
|
execSync,
|
||||||
|
} from 'node:child_process';
|
||||||
|
|
||||||
export const __dirname = fileURLToPath(new URL('../', import.meta.url));
|
export const __dirname = fileURLToPath(new URL('../', import.meta.url));
|
||||||
export const require = createRequire(import.meta.url);
|
export const require = createRequire(import.meta.url);
|
||||||
export const pkgPath = path.resolve(__dirname, 'package.json');
|
export const pkgPath = path.resolve(__dirname, 'package.json');
|
||||||
export const distPath = path.resolve(__dirname, 'dist');
|
export const distPath = path.resolve(__dirname, 'dist');
|
||||||
|
|
||||||
export const resolve = (...paths) => path.resolve(__dirname, ...paths);
|
export const resolve = (...paths: string[]) =>
|
||||||
export const exec = (command, options) =>
|
path.resolve(__dirname, ...paths);
|
||||||
execSync(command, { stdio: 'inherit', ...(options ?? {}) });
|
|
||||||
|
export const exec = (
|
||||||
|
command: string,
|
||||||
|
options?: ExecSyncOptionsWithStringEncoding,
|
||||||
|
) => execSync(command, { stdio: 'inherit', ...(options ?? {}) });
|
||||||
|
|
||||||
export const getPkgJSON = () => require(pkgPath);
|
export const getPkgJSON = () => require(pkgPath);
|
||||||
export const getFileName = (filePath) => filePath.match(/\/([^/]*)$/)[1];
|
|
||||||
|
export const getFileName = (filePath: string) =>
|
||||||
|
filePath.match(/\/([^/]*)$/)![1];
|
|
@ -10,10 +10,18 @@
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"skipDefaultLibCheck": true,
|
"skipDefaultLibCheck": true,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["src/*"]
|
"@/*": ["src/*"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"include": ["./src", "./test", "./global.d.ts", "./global.variables.d.ts"],
|
"include": [
|
||||||
|
"./src",
|
||||||
|
"./test",
|
||||||
|
"./rollup.config.ts",
|
||||||
|
"./vitest.config.ts",
|
||||||
|
"./global.d.ts",
|
||||||
|
"./global.variables.d.ts"
|
||||||
|
],
|
||||||
"exclude": ["node_modules", "**/*.md", "**/dist"]
|
"exclude": ["node_modules", "**/*.md", "**/dist"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue