ql-publish 0.0.1 → 0.0.3

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/cdn/index.js CHANGED
@@ -1,4 +1,9 @@
1
1
  const refreshCdn = require('./refresh');
2
+ const logger = require("../utils/logger");
2
3
  const config = require('../config/config')[process.env.NODE_ENV];
3
4
 
4
- refreshCdn(config.cdn.list);
5
+ if (config && config.cdn && config.cdn.list) {
6
+ refreshCdn(config.cdn.list);
7
+ } else {
8
+ logger.error(`❌ ${process.env.NODE_ENV}环境没有配置cdn`);
9
+ }
package/config/config.js CHANGED
@@ -1,4 +1,4 @@
1
- const { _config, coreConfig } = require('./index');
1
+ const { _config, coreConfig } = require('./index')._;
2
2
 
3
3
  const ossConfigCdn = () => {
4
4
  if (!_config[process.env.NODE_ENV].cdn) return {};
package/config/index.js CHANGED
@@ -1,7 +1,8 @@
1
- let _config = {};
2
- let coreConfig = {};
1
+ let _ = {
2
+ _config: {},
3
+ coreConfig: {}
4
+ }
3
5
 
4
6
  module.exports = {
5
- _config,
6
- coreConfig
7
+ _
7
8
  }
package/index.js CHANGED
@@ -1,17 +1,17 @@
1
- let { _config, coreConfig } = require('./config/index')
1
+ let { _ } = require('./config/index')
2
2
 
3
3
  module.exports = {
4
4
  initConfig: (config, _coreConfig) => {
5
- _config = config;
6
- coreConfig = _coreConfig;
5
+ _._config = config;
6
+ _.coreConfig = _coreConfig;
7
7
  },
8
8
  clear: () => {
9
-
9
+ require('./upload/clear');
10
10
  },
11
11
  upload: () => {
12
12
  return require('./upload/index')();
13
13
  },
14
14
  refresh: () => {
15
-
15
+ require('./cdn/index')
16
16
  }
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ql-publish",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "scripts": {},
5
5
  "dependencies": {
6
6
  "@alicloud/cdn20180510": "^7.0.1",