sm-crypto-v2 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sm-crypto-v2",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "sm-crypto-v2",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -9,9 +9,10 @@
9
9
  "scripts": {
10
10
  "prepublish": "npm run build",
11
11
  "lint": "eslint \"src/**/*.js\" --fix",
12
- "prerelease": "vitest run && npm run build && npm run build-mp",
12
+ "prerelease": "vitest run && npm run build && npm run build-mp && npm run build-umd",
13
13
  "build": "tsup",
14
14
  "build-mp": "tsup --config=tsup.config.miniprogram.ts",
15
+ "build-umd": "tsup --config=tsup.config.umd.ts && esm2umd SmCryptoV2 dist/index.umd.mjs > dist/index.umd.js && rm -rf dist/index.umd.mjs && rm -rf dist/index.umd.d.mts",
15
16
  "watch": "tsup --watch",
16
17
  "test": "vitest",
17
18
  "release": "npm run prerelease && standard-version && git push --follow-tags origin master",
@@ -55,6 +56,7 @@
55
56
  "eslint": "^8.15.0",
56
57
  "eslint-config-prettier": "^8.3.0",
57
58
  "eslint-plugin-prettier": "^4.0.0",
59
+ "esm2umd": "^0.3.1",
58
60
  "prettier": "^2.6.2",
59
61
  "standard-version": "^9.5.0",
60
62
  "tsup": "^8.0.1",
@@ -0,0 +1,20 @@
1
+ import { defineConfig } from 'tsup';
2
+
3
+ export default defineConfig({
4
+ entry: {
5
+ 'index.umd': './src/index.ts'
6
+ },
7
+ clean: false,
8
+ outDir: 'dist',
9
+ dts: true,
10
+ // we need to keep minify false, since webpack magic comments
11
+ // will be stripped if minify.
12
+ minify: false,
13
+ format: ['esm'],
14
+ target: 'es5',
15
+ noExternal: ['@noble/curves', '@noble/ciphers'],
16
+ tsconfig: 'tsconfig.json',
17
+ esbuildOptions(options) {
18
+ options.define.__BUILD_TS__ = Date.now().toString();
19
+ }
20
+ });