Browse Source

chore(core-shared): migrate build to tsdown

pull/7666/head
xingyu4j 1 week ago
parent
commit
59912a00bc
  1. 16
      packages/@core/base/shared/package.json
  2. 4
      packages/@core/base/shared/src/utils/__tests__/date.test.ts
  3. 4
      packages/@core/base/shared/src/utils/date.ts
  4. 3
      packages/@core/base/shared/tsdown.config.ts

16
packages/@core/base/shared/package.json

@ -11,8 +11,8 @@
"license": "MIT",
"type": "module",
"scripts": {
"build": "tsdown",
"stub": "tsdown"
"build": "pnpm exec tsdown",
"stub": "pnpm exec tsdown"
},
"files": [
"dist"
@ -53,27 +53,27 @@
"publishConfig": {
"exports": {
"./constants": {
"types": "./dist/constants/index.d.mts",
"types": "./dist/constants/index.d.ts",
"default": "./dist/constants/index.mjs"
},
"./utils": {
"types": "./dist/utils/index.d.mts",
"types": "./dist/utils/index.d.ts",
"default": "./dist/utils/index.mjs"
},
"./color": {
"types": "./dist/color/index.d.mts",
"types": "./dist/color/index.d.ts",
"default": "./dist/color/index.mjs"
},
"./cache": {
"types": "./dist/cache/index.d.mts",
"types": "./dist/cache/index.d.ts",
"default": "./dist/cache/index.mjs"
},
"./store": {
"types": "./dist/store.d.mts",
"types": "./dist/store.d.ts",
"default": "./dist/store.mjs"
},
"./global-state": {
"types": "./dist/global-state.d.mts",
"types": "./dist/global-state.d.ts",
"default": "./dist/global-state.mjs"
}
}

4
packages/@core/base/shared/src/utils/__tests__/date.test.ts

@ -1,6 +1,6 @@
import dayjs from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone.js';
import utc from 'dayjs/plugin/utc.js';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import {

4
packages/@core/base/shared/src/utils/date.ts

@ -1,6 +1,6 @@
import dayjs from 'dayjs';
import timezone from 'dayjs/plugin/timezone';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone.js';
import utc from 'dayjs/plugin/utc.js';
dayjs.extend(utc);
dayjs.extend(timezone);

3
packages/@core/base/shared/tsdown.config.ts

@ -12,4 +12,7 @@ export default defineConfig({
'utils/index': 'src/utils/index.ts',
},
format: ['esm'],
outExtensions: () => ({
dts: '.d.ts',
}),
});

Loading…
Cancel
Save