Skip to content

Commit d24d57c

Browse files
committed
updated common packaging
1 parent bce16ea commit d24d57c

23 files changed

Lines changed: 5209 additions & 5672 deletions

common/config/rush/pnpm-lock.yaml

Lines changed: 5146 additions & 5650 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/common/generateSystemActionDoc.js renamed to packages/common/generateSystemActionDoc.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const { ACTION_CONFIG } = require('./lib/actionConfigs.cjs.js');
2-
const fs = require('fs');
1+
import fs from 'fs';
2+
import { ACTION_CONFIG } from './src/actionConfigs';
33

44
// print table header
55
const headers = [
@@ -23,7 +23,7 @@ const content = [
2323
const description = config.desc;
2424
const isRequestResponse = config.isRest ? '✓' : '';
2525
const relatedActions = (config.related || []).join(' ');
26-
const payload = [];
26+
const payload: string[] = [];
2727
if (config.payload) {
2828
config.payload.forEach((configPayload) => {
2929
payload.push(`**${configPayload[0]}**:${configPayload[1]}`);
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
scripts:
22
clean: rm -rf ./lib ./dist
3-
ts-check: tsc --project tsconfig-build.json
4-
build: rollup --config --silent
5-
gendoc: node ./generateSystemActionDoc.js
3+
build-umd: rollup --config --silent
4+
build-cjs: tsc --project tsconfig.buildcjs.json
5+
build-esm: tsc --project tsconfig.buildesm.json
6+
build-types: tsc --project tsconfig.buildtypes.json
7+
gendoc: ts-node -O '{"module":"commonjs"}' generateSystemActionDoc.ts

packages/common/package.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212
},
1313
"license": "MIT",
1414
"author": "Yiou Chen <chen.yiou1992@gmail.com>",
15-
"main": "./lib/index.cjs.js",
16-
"module": "./lib/index.esm.js",
17-
"browser": "./lib/index.umd.js",
18-
"types": "./dist/index.d.ts",
15+
"main": "./dist/cjs/index.js",
16+
"module": "./dist/esm/index.js",
17+
"browser": "./dist/umd/index.js",
18+
"types": "./dist/types/index.d.ts",
19+
"exports": {
20+
"import": "./dist/esm/index.js",
21+
"require": "./dist/cjs/index.js"
22+
},
1923
"directories": {
2024
"lib": "./",
2125
"test": "__test__"
@@ -24,9 +28,7 @@
2428
"lib"
2529
],
2630
"scripts": {
27-
"build": "nps clean ts-check build gendoc",
28-
"fix": "tslint --project tsconfig.json --fix",
29-
"lint": "tslint --project tsconfig.json",
31+
"build": "nps clean build-types build-cjs build-esm build-umd gendoc",
3032
"test": "jest"
3133
},
3234
"jest": {
@@ -41,6 +43,7 @@
4143
"protobufjs": "~6.11.2"
4244
},
4345
"devDependencies": {
46+
"ts-node": "^10.4.0",
4447
"@prisel/configs": "1.0.0",
4548
"@prisel/jest-preset": "0.0.0",
4649
"@types/jest": "^27.0.3",

packages/common/rollup.config.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
import { browserBuild, cjsAndEsBuild } from '@prisel/configs/rollupHelper';
22
import pkg from './package.json';
33

4-
export default [
5-
browserBuild(/* entry= */ 'dist/index.js', /* pkgJson= */ pkg),
6-
cjsAndEsBuild(/* entry= */ 'dist/index.js', /* pkgJson= */ pkg),
7-
{
8-
input: 'dist/actionConfigs.js',
9-
output: [{ file: './lib/actionConfigs.cjs.js', format: 'cjs' }],
10-
},
11-
];
4+
export default [browserBuild(/* entry= */ 'dist/cjs/index.js', /* pkgJson= */ pkg)];
File renamed without changes.

0 commit comments

Comments
 (0)