@wocker/core 1.1.0-beta.6 → 1.1.0-beta.7

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.
@@ -16,6 +16,7 @@ export declare class Project {
16
16
  get presetMode(): PresetMode;
17
17
  set presetMode(mode: PresetMode);
18
18
  get image(): string | undefined;
19
+ set image(image: string | undefined);
19
20
  /** @deprecated */
20
21
  get imageName(): string | undefined;
21
22
  /** @deprecated */
@@ -56,13 +56,20 @@ class Project {
56
56
  get image() {
57
57
  return this.configs.app.image || this.configs.project.image;
58
58
  }
59
+ set image(image) {
60
+ if (!image) {
61
+ delete this.configs.app.image;
62
+ return;
63
+ }
64
+ this.configs.app.image = image;
65
+ }
59
66
  /** @deprecated */
60
67
  get imageName() {
61
- return this.configs.app.image || this.configs.project.image;
68
+ return this.image;
62
69
  }
63
70
  /** @deprecated */
64
71
  set imageName(image) {
65
- this.configs.app.image = image;
72
+ this.image = image;
66
73
  }
67
74
  get dockerfile() {
68
75
  return this.configs.app.dockerfile || this.configs.project.dockerfile;
@@ -171,7 +178,7 @@ class Project {
171
178
  this.configs.app.unsetEnv(key, service);
172
179
  }
173
180
  hasMeta(key) {
174
- return this.configs.app.metadata.hasOwnProperty(key) || this.configs.project.metadata.hasOwnProperty(key);
181
+ return key in this.configs.app.metadata || key in this.configs.project.metadata;
175
182
  }
176
183
  getMeta(key, byDefault) {
177
184
  return this.configs.app.metadata[key] || this.configs.project.metadata[key] || byDefault;
@@ -102,7 +102,7 @@ class ProjectConfig extends JsonEditor_1.JsonEditor {
102
102
  return this.state.cmd;
103
103
  }
104
104
  set cmd(cmd) {
105
- this.state.cmd = cmd;
105
+ this.set(["cmd"], cmd);
106
106
  }
107
107
  get scripts() {
108
108
  return this.createProxy(["scripts"], {
@@ -146,7 +146,10 @@ class ProjectConfig extends JsonEditor_1.JsonEditor {
146
146
  this.set(["services", service, "buildArgs", key], value);
147
147
  return;
148
148
  }
149
- this.buildArgs[key] = value;
149
+ if (!this.state.buildArgs) {
150
+ this.set(["buildArgs"], {});
151
+ }
152
+ this.set(["buildArgs", key], value);
150
153
  }
151
154
  unsetBuildArg(key, service) {
152
155
  if (service) {
@@ -162,7 +165,6 @@ class ProjectConfig extends JsonEditor_1.JsonEditor {
162
165
  return byDefault;
163
166
  }
164
167
  hasEnv(key) {
165
- // return this.env.hasOwnProperty(key);
166
168
  return key in this.env;
167
169
  }
168
170
  setEnv(key, value, service) {
@@ -173,6 +175,9 @@ class ProjectConfig extends JsonEditor_1.JsonEditor {
173
175
  this.set(["services", service, "env", key], sValue);
174
176
  return;
175
177
  }
178
+ if (!this.state.env) {
179
+ this.set(["env"], {});
180
+ }
176
181
  this.set(["env", key], sValue);
177
182
  }
178
183
  unsetEnv(key, service) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wocker/core",
3
3
  "type": "commonjs",
4
- "version": "1.1.0-beta.6",
4
+ "version": "1.1.0-beta.7",
5
5
  "author": "Kris Papercut <krispcut@gmail.com>",
6
6
  "description": "Core of the Wocker",
7
7
  "license": "MIT",