@qn-pandora/pandora-tools 2.0.16 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -2,13 +2,13 @@
2
2
  "name": "@qn-pandora/pandora-tools",
3
3
  "entries": [
4
4
  {
5
- "version": "2.0.16",
6
- "tag": "@qn-pandora/pandora-tools_v2.0.16",
7
- "date": "Tue, 29 Aug 2023 06:22:20 GMT",
5
+ "version": "2.1.0",
6
+ "tag": "@qn-pandora/pandora-tools_v2.1.0",
7
+ "date": "Fri, 05 Jan 2024 07:56:00 GMT",
8
8
  "comments": {
9
- "patch": [
9
+ "minor": [
10
10
  {
11
- "comment": "2023-08-29发包"
11
+ "comment": "2024-01-05发包"
12
12
  }
13
13
  ]
14
14
  }
package/CHANGELOG.md CHANGED
@@ -1,13 +1,13 @@
1
1
  # Change Log - @qn-pandora/pandora-tools
2
2
 
3
- This log was last generated on Tue, 29 Aug 2023 06:22:20 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 05 Jan 2024 07:56:00 GMT and should not be manually modified.
4
4
 
5
- ## 2.0.16
6
- Tue, 29 Aug 2023 06:22:20 GMT
5
+ ## 2.1.0
6
+ Fri, 05 Jan 2024 07:56:00 GMT
7
7
 
8
- ### Patches
8
+ ### Minor changes
9
9
 
10
- - 2023-08-29发包
10
+ - 2024-01-05发包
11
11
 
12
12
  ## 2.0.15
13
13
  Fri, 25 Aug 2023 10:29:46 GMT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qn-pandora/pandora-tools",
3
- "version": "2.0.16",
3
+ "version": "2.1.0",
4
4
  "description": "Pandora Lib 常用开发&打包工具集",
5
5
  "author": "pandora <pandora@qiniu.com>",
6
6
  "homepage": "https://github.com/qbox/phoenix#readme",
package/src/gulpfile.js CHANGED
@@ -1,5 +1,6 @@
1
1
  const gulp = require('gulp')
2
2
  const clear = require('./tasks/clear')
3
+ const copyJSON = require('./tasks/json')
3
4
  const compileLess = require('./tasks/less')
4
5
  const compileTs = require('./tasks/ts')
5
6
  const {
@@ -13,6 +14,16 @@ process.on('uncaughtException', function (err) {
13
14
  process.exit(1)
14
15
  })
15
16
 
17
+ function copyJSONToEsm() {
18
+ const { srcDir, esmDir } = getToolsConfig()
19
+ return copyJSON(srcDir, esmDir)
20
+ }
21
+
22
+ function copyJSONToCjs() {
23
+ const { srcDir, libDir } = getToolsConfig()
24
+ return copyJSON(srcDir, libDir)
25
+ }
26
+
16
27
  function compileLessToEsm() {
17
28
  const { srcDir, esmDir } = getToolsConfig()
18
29
  return compileLess(srcDir, esmDir)
@@ -52,6 +63,7 @@ gulp.task(
52
63
  compileTs(getProjectRoot(), getToolsConfig().esmDir, {
53
64
  module: 'esnext'
54
65
  }),
66
+ copyJSONToEsm,
55
67
  compileLessToEsm
56
68
  )
57
69
  )
@@ -64,6 +76,7 @@ gulp.task(
64
76
  compileTs(getProjectRoot(), getToolsConfig().libDir, {
65
77
  module: 'commonjs'
66
78
  }),
79
+ copyJSONToCjs,
67
80
  compileLessToCjs
68
81
  )
69
82
  )
@@ -0,0 +1,12 @@
1
+ const gulp = require('gulp')
2
+
3
+ module.exports = function (srcDir, outDir) {
4
+ return new Promise((resolve, reject) => {
5
+ gulp
6
+ .src(`${srcDir}/**/*.json`)
7
+ .on('error', reject)
8
+ .pipe(gulp.dest(outDir))
9
+ .on('error', reject)
10
+ .on('finish', resolve)
11
+ })
12
+ }