调试 github workflow

This commit is contained in:
liaoxuezhi 2022-06-02 19:05:30 +08:00
parent dd8ab4fdae
commit 50f4e9eecc
7 changed files with 36 additions and 55 deletions

View File

@ -41,9 +41,6 @@ jobs:
- name: Run All Tests AND Generate coverage report
run: |
npm run coverage --workspaces
with:
verbose: true # optional (default = false)
fail_ci_if_error: false
- name: Upload amis-formula coverage to Codecov
uses: codecov/codecov-action@v2
with:

View File

@ -2,4 +2,5 @@
/node_modules
/esm
/.rollup.cache
/tsconfig.tsbuildinfo
/tsconfig.tsbuildinfo
/coverage

View File

@ -0,0 +1 @@
/coverage

View File

@ -47,12 +47,12 @@
"moment-timezone": "^0.5.33",
"rimraf": "^3.0.2",
"rollup": "^2.60.2",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@rollup/plugin-typescript": "^8.3.2",
"rollup-plugin-license": "^2.6.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript": "^1.0.1",
"sass": "^1.36.0",
"sass-loader": "^12.1.0",
"style-loader": "^3.2.1",

View File

@ -1,24 +1,29 @@
// rollup.config.js
import commonjs from 'rollup-plugin-commonjs';
import json from 'rollup-plugin-json';
import resolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript';
import commonjs from '@rollup/plugin-commonjs';
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import typescript from '@rollup/plugin-typescript';
import {terser} from 'rollup-plugin-terser';
import license from 'rollup-plugin-license';
import {name, version, main, module, browser, author} from './package.json';
import {name, version, main, author, dependencies} from './package.json';
import path from 'path';
const isProduction = process.env.NODE_ENV === 'production';
const isForLib = process.env.NODE_ENV === 'lib';
const settings = {
globals: {
lodash: 'lodash',
moment: 'moment',
tslib: 'tslib'
}
globals: {}
};
const external = id =>
new RegExp(
`^(?:${Object.keys(dependencies)
.concat([])
.map(value =>
value.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d')
)
.join('|')})`
).test(id);
export default {
input: isForLib ? './scripts/lib.ts' : './src/index.ts',
output: [
@ -27,42 +32,16 @@ export default {
name: isForLib ? 'formula' : main,
...settings,
format: isForLib ? 'iife' : 'cjs',
plugins: [
isForLib && terser()
],
plugins: [isForLib && terser()],
strict: !isForLib,
footer: isForLib ? `var evaluate = formula.evaluate;
footer: isForLib
? `var evaluate = formula.evaluate;
var momentFormat = formula.momentFormat;
var parse = formula.parse;` : '',
var parse = formula.parse;`
: ''
}
// {
// file: module,
// ...settings,
// name: name,
// format: 'es'
// },
// {
// file: browser,
// ...settings,
// name: name,
// format: 'umd'
// }
],
external: isForLib ? [] : [
'lodash',
'lodash/transform',
'lodash/groupBy',
'lodash/uniqBy',
'lodash/uniq',
'lodash/isPlainObject',
'lodash/padStart',
'lodash/upperFirst',
'lodash/capitalize',
'lodash/escape',
'lodash/truncate',
'moment',
'tslib'
],
external: isForLib ? [] : external,
plugins: [
json(),
@ -72,7 +51,9 @@ export default {
browser: true
}),
typescript({
typescript: require('typescript')
typescript: require('typescript'),
sourceMap: false,
outputToFilesystem: true
}),
commonjs({
include: 'node_modules/**',

View File

@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src",
"rootDir": "./",
"outDir": "./dist",
"typeRoots": [
"../../types",

View File

@ -2,4 +2,5 @@
/node_modules
/esm
/.rollup.cache
/tsconfig.tsbuildinfo
/tsconfig.tsbuildinfo
/coverage