@xfe-repo/web-app 1.2.3 → 1.2.5

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.
@@ -10,11 +10,11 @@ virtualService:
10
10
  enabled: true
11
11
  hosts:
12
12
  test:
13
- - '<<HOST_PREFIX>>.erpnew-o.t.zhixiangyao.com'
13
+ - '<<HOST_PREFIX>>.exam.t.eshetang.com'
14
14
  stage:
15
- - 'stage.erpnew-o.t.zhixiangyao.com'
15
+ - 'stage.exam.t.eshetang.com'
16
16
  prod:
17
- - 'erpnew-o.zhixiangyao.com'
17
+ - 'exam.eshetang.com'
18
18
  gateways:
19
- - 'common-gateway-zhixiangyao'
19
+ - 'common-gateway-eshetang'
20
20
  targetK8s: 'saas'
package/dist/cli.js CHANGED
@@ -51,11 +51,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
51
51
  var __getOwnPropNames = Object.getOwnPropertyNames;
52
52
  var __getProtoOf = Object.getPrototypeOf;
53
53
  var __hasOwnProp = Object.prototype.hasOwnProperty;
54
- var __esm = function(fn, res) {
55
- return function __init() {
56
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
57
- };
58
- };
59
54
  var __copyProps = function(to, from, except, desc) {
60
55
  if (from && typeof from === "object" || typeof from === "function") {
61
56
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
@@ -97,53 +92,49 @@ var __toESM = function(mod, isNodeMode, target) {
97
92
  enumerable: true
98
93
  }) : target, mod);
99
94
  };
100
- // src/config.ts
101
- var config_exports = {};
102
- var import_path, import_fs, import_yaml, configDeploy;
103
- var init_config = __esm({
104
- "src/config.ts": function() {
105
- "use strict";
106
- import_path = __toESM(require("path"));
107
- import_fs = __toESM(require("fs"));
108
- import_yaml = __toESM(require("yaml"));
109
- configDeploy = function() {
110
- var xfeConfig = JSON.parse(import_fs.default.readFileSync("./xfe.json", "utf8"));
111
- if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.deploy)) return;
112
- var droneConfigFilePath = import_path.default.resolve(__dirname, "../deploy/.drone.yml");
113
- import_fs.default.cpSync(droneConfigFilePath, xfeConfig.deploy.droneConfigPath || "./.drone.yml");
114
- var valuesYamlFilePath = import_path.default.resolve(__dirname, "../deploy/helm/values.yaml");
115
- var valuesYamlFile = import_fs.default.readFileSync(valuesYamlFilePath, "utf8");
116
- var valuesYaml = import_yaml.default.parse(valuesYamlFile);
117
- if (!valuesYaml.virtualService) valuesYaml.virtualService = {};
118
- if (!valuesYaml.virtualService.hosts) valuesYaml.virtualService.hosts = {
119
- test: [],
120
- stage: [],
121
- prod: []
122
- };
123
- var _xfeConfig_deploy = xfeConfig.deploy, _xfeConfig_deploy_virtualServiceEnabled = _xfeConfig_deploy.virtualServiceEnabled, virtualServiceEnabled = _xfeConfig_deploy_virtualServiceEnabled === void 0 ? true : _xfeConfig_deploy_virtualServiceEnabled, _xfeConfig_deploy_hostsProd = _xfeConfig_deploy.hostsProd, hostsProd = _xfeConfig_deploy_hostsProd === void 0 ? [] : _xfeConfig_deploy_hostsProd, _xfeConfig_deploy_hostsStage = _xfeConfig_deploy.hostsStage, hostsStage = _xfeConfig_deploy_hostsStage === void 0 ? [] : _xfeConfig_deploy_hostsStage, _xfeConfig_deploy_hostsTest = _xfeConfig_deploy.hostsTest, hostsTest = _xfeConfig_deploy_hostsTest === void 0 ? [] : _xfeConfig_deploy_hostsTest, _xfeConfig_deploy_gateways = _xfeConfig_deploy.gateways, gateways = _xfeConfig_deploy_gateways === void 0 ? [
124
- "common-gateway-eshetang"
125
- ] : _xfeConfig_deploy_gateways;
126
- var _xfeConfig_deploy1 = xfeConfig.deploy, _xfeConfig_deploy_targetK8s = _xfeConfig_deploy1.targetK8s, targetK8s = _xfeConfig_deploy_targetK8s === void 0 ? "saas" : _xfeConfig_deploy_targetK8s, _xfeConfig_deploy_targetNamespace = _xfeConfig_deploy1.targetNamespace, targetNamespace = _xfeConfig_deploy_targetNamespace === void 0 ? "" : _xfeConfig_deploy_targetNamespace;
127
- valuesYaml.virtualService.enabled = virtualServiceEnabled;
128
- valuesYaml.virtualService.gateways = gateways;
129
- valuesYaml.virtualService.hosts.prod = hostsProd;
130
- valuesYaml.virtualService.hosts.stage = hostsStage;
131
- valuesYaml.virtualService.hosts.test = hostsTest;
132
- valuesYaml.targetK8s = targetK8s;
133
- valuesYaml.namespace = targetNamespace;
134
- var valuesYamlStr = import_yaml.default.stringify(valuesYaml, {
135
- defaultStringType: "QUOTE_SINGLE",
136
- defaultKeyType: "PLAIN"
137
- });
138
- import_fs.default.writeFileSync(valuesYamlFilePath, valuesYamlStr, "utf8");
139
- };
140
- configDeploy();
141
- }
142
- });
143
95
  // src/cli.ts
144
96
  var import_minimist = __toESM(require("minimist"));
145
97
  var import_child_process = require("child_process");
146
98
  var import_path2 = __toESM(require("path"));
99
+ // src/config.ts
100
+ var import_path = __toESM(require("path"));
101
+ var import_fs = __toESM(require("fs"));
102
+ var import_yaml = __toESM(require("yaml"));
103
+ var configDeploy = function() {
104
+ var xfeConfig = JSON.parse(import_fs.default.readFileSync("./xfe.json", "utf8"));
105
+ if (!(xfeConfig === null || xfeConfig === void 0 ? void 0 : xfeConfig.deploy)) return;
106
+ var droneConfigFilePath = import_path.default.resolve(__dirname, "../deploy/.drone.yml");
107
+ import_fs.default.cpSync(droneConfigFilePath, xfeConfig.deploy.droneConfigPath || "./.drone.yml");
108
+ var valuesYamlFilePath = import_path.default.resolve(__dirname, "../deploy/helm/values.yaml");
109
+ var valuesYamlFile = import_fs.default.readFileSync(valuesYamlFilePath, "utf8");
110
+ var valuesYaml = import_yaml.default.parse(valuesYamlFile);
111
+ if (!valuesYaml.virtualService) valuesYaml.virtualService = {};
112
+ if (!valuesYaml.virtualService.hosts) valuesYaml.virtualService.hosts = {
113
+ test: [],
114
+ stage: [],
115
+ prod: []
116
+ };
117
+ var _xfeConfig_deploy = xfeConfig.deploy, _xfeConfig_deploy_virtualServiceEnabled = _xfeConfig_deploy.virtualServiceEnabled, virtualServiceEnabled = _xfeConfig_deploy_virtualServiceEnabled === void 0 ? true : _xfeConfig_deploy_virtualServiceEnabled, _xfeConfig_deploy_hostsProd = _xfeConfig_deploy.hostsProd, hostsProd = _xfeConfig_deploy_hostsProd === void 0 ? [] : _xfeConfig_deploy_hostsProd, _xfeConfig_deploy_hostsStage = _xfeConfig_deploy.hostsStage, hostsStage = _xfeConfig_deploy_hostsStage === void 0 ? [] : _xfeConfig_deploy_hostsStage, _xfeConfig_deploy_hostsTest = _xfeConfig_deploy.hostsTest, hostsTest = _xfeConfig_deploy_hostsTest === void 0 ? [] : _xfeConfig_deploy_hostsTest, _xfeConfig_deploy_gateways = _xfeConfig_deploy.gateways, gateways = _xfeConfig_deploy_gateways === void 0 ? [
118
+ "common-gateway-eshetang"
119
+ ] : _xfeConfig_deploy_gateways;
120
+ var _xfeConfig_deploy1 = xfeConfig.deploy, _xfeConfig_deploy_targetK8s = _xfeConfig_deploy1.targetK8s, targetK8s = _xfeConfig_deploy_targetK8s === void 0 ? "saas" : _xfeConfig_deploy_targetK8s, _xfeConfig_deploy_targetNamespace = _xfeConfig_deploy1.targetNamespace, targetNamespace = _xfeConfig_deploy_targetNamespace === void 0 ? "" : _xfeConfig_deploy_targetNamespace;
121
+ valuesYaml.virtualService.enabled = virtualServiceEnabled;
122
+ valuesYaml.virtualService.gateways = gateways;
123
+ valuesYaml.virtualService.hosts.prod = hostsProd;
124
+ valuesYaml.virtualService.hosts.stage = hostsStage;
125
+ valuesYaml.virtualService.hosts.test = hostsTest;
126
+ valuesYaml.targetK8s = targetK8s;
127
+ valuesYaml.namespace = targetNamespace;
128
+ var valuesYamlStr = import_yaml.default.stringify(valuesYaml, {
129
+ defaultStringType: "QUOTE_SINGLE",
130
+ defaultKeyType: "PLAIN"
131
+ });
132
+ import_fs.default.writeFileSync(valuesYamlFilePath, valuesYamlStr, "utf8");
133
+ };
134
+ var config = function() {
135
+ configDeploy();
136
+ };
137
+ // src/cli.ts
147
138
  var argv = (0, import_minimist.default)(process.argv.slice(2));
148
139
  var commands = argv._;
149
140
  var _commands = _sliced_to_array(commands, 1), command = _commands[0];
@@ -157,7 +148,5 @@ if (command === "dev") {
157
148
  stdio: "inherit"
158
149
  });
159
150
  } else if (command === "config") {
160
- Promise.resolve().then(function() {
161
- return init_config();
162
- });
151
+ config();
163
152
  }
package/dist/config.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ declare const config: () => void;
1
2
 
2
- export { }
3
+ export { config };
package/dist/config.js CHANGED
@@ -5,6 +5,12 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = function(target, all) {
9
+ for(var name in all)__defProp(target, name, {
10
+ get: all[name],
11
+ enumerable: true
12
+ });
13
+ };
8
14
  var __copyProps = function(to, from, except, desc) {
9
15
  if (from && typeof from === "object" || typeof from === "function") {
10
16
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
@@ -46,7 +52,19 @@ var __toESM = function(mod, isNodeMode, target) {
46
52
  enumerable: true
47
53
  }) : target, mod);
48
54
  };
55
+ var __toCommonJS = function(mod) {
56
+ return __copyProps(__defProp({}, "__esModule", {
57
+ value: true
58
+ }), mod);
59
+ };
49
60
  // src/config.ts
61
+ var config_exports = {};
62
+ __export(config_exports, {
63
+ config: function() {
64
+ return config;
65
+ }
66
+ });
67
+ module.exports = __toCommonJS(config_exports);
50
68
  var import_path = __toESM(require("path"));
51
69
  var import_fs = __toESM(require("fs"));
52
70
  var import_yaml = __toESM(require("yaml"));
@@ -81,4 +99,10 @@ var configDeploy = function() {
81
99
  });
82
100
  import_fs.default.writeFileSync(valuesYamlFilePath, valuesYamlStr, "utf8");
83
101
  };
84
- configDeploy();
102
+ var config = function() {
103
+ configDeploy();
104
+ };
105
+ // Annotate the CommonJS export names for ESM import in node:
106
+ 0 && (module.exports = {
107
+ config: config
108
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfe-repo/web-app",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
4
4
  "bin": {
5
5
  "xfe-web": "./bin/index.js"
6
6
  },