@wocker/core 1.0.26-beta.1 → 1.0.26-beta.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.
@@ -2,7 +2,7 @@ import { EnvConfig, PackageManagerType } from "../types";
2
2
  import { PluginRef } from "../types/PluginRef";
3
3
  import { PresetRef } from "../types/PresetRef";
4
4
  import { ProjectRef, ProjectOldRef } from "../types/ProjectRef";
5
- import { PresetSource } from "./Preset";
5
+ import { PresetSource } from "../types/PresetSource";
6
6
  export type AppConfigProperties = {
7
7
  debug?: boolean;
8
8
  pm?: PackageManagerType;
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
14
  exports.AppConfig = void 0;
15
- const Preset_1 = require("./Preset");
15
+ const PresetSource_1 = require("../types/PresetSource");
16
16
  class AppConfig {
17
17
  constructor(data) {
18
18
  this.logLevel = "off";
@@ -83,11 +83,11 @@ class AppConfig {
83
83
  });
84
84
  }
85
85
  registerPreset(name, source, path) {
86
- if (source === Preset_1.PRESET_SOURCE_INTERNAL) {
86
+ if (source === PresetSource_1.PRESET_SOURCE_INTERNAL) {
87
87
  return;
88
88
  }
89
89
  let presetData = this.presets.find((preset) => {
90
- if (source === Preset_1.PRESET_SOURCE_EXTERNAL && preset.path === path) {
90
+ if (source === PresetSource_1.PRESET_SOURCE_EXTERNAL && preset.path === path) {
91
91
  return true;
92
92
  }
93
93
  return preset.name === name;
@@ -100,7 +100,7 @@ class AppConfig {
100
100
  this.presets.push(presetData);
101
101
  }
102
102
  presetData.source = source;
103
- if (presetData.source === Preset_1.PRESET_SOURCE_EXTERNAL) {
103
+ if (presetData.source === PresetSource_1.PRESET_SOURCE_EXTERNAL) {
104
104
  presetData.path = path;
105
105
  }
106
106
  else if (presetData.path) {
@@ -1,4 +1,5 @@
1
1
  import { PickProperties } from "../types/PickProperties";
2
+ import { PresetSource } from "../types/PresetSource";
2
3
  type TextOption = {
3
4
  type: "text" | "string" | "number" | "int" | "password";
4
5
  message?: string;
@@ -50,8 +51,4 @@ export declare abstract class Preset {
50
51
  toJSON(): PresetProperties;
51
52
  toObject(): PresetProperties;
52
53
  }
53
- export declare const PRESET_SOURCE_INTERNAL: "internal";
54
- export declare const PRESET_SOURCE_EXTERNAL: "external";
55
- export declare const PRESET_SOURCE_GITHUB: "github";
56
- export type PresetSource = typeof PRESET_SOURCE_INTERNAL | typeof PRESET_SOURCE_EXTERNAL | typeof PRESET_SOURCE_GITHUB;
57
54
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PRESET_SOURCE_GITHUB = exports.PRESET_SOURCE_EXTERNAL = exports.PRESET_SOURCE_INTERNAL = exports.Preset = void 0;
3
+ exports.Preset = void 0;
4
4
  class Preset {
5
5
  constructor(data) {
6
6
  this.name = data.name;
@@ -36,6 +36,3 @@ class Preset {
36
36
  }
37
37
  }
38
38
  exports.Preset = Preset;
39
- exports.PRESET_SOURCE_INTERNAL = "internal";
40
- exports.PRESET_SOURCE_EXTERNAL = "external";
41
- exports.PRESET_SOURCE_GITHUB = "github";
@@ -6,12 +6,15 @@ export declare class Project {
6
6
  name: string;
7
7
  type: ProjectType;
8
8
  path: string;
9
+ cmd?: string[];
9
10
  imageName?: string;
10
11
  dockerfile?: string;
11
12
  composefile?: string;
12
13
  preset?: string;
13
14
  presetMode?: "global" | "project";
14
- scripts?: string[];
15
+ scripts?: {
16
+ [script: string]: string;
17
+ };
15
18
  services: {
16
19
  [name: string]: ServiceProperties;
17
20
  };
@@ -267,6 +267,7 @@ class Project {
267
267
  composefile: this.composefile,
268
268
  preset: this.preset,
269
269
  presetMode: this.presetMode,
270
+ cmd: this.cmd,
270
271
  scripts: this.scripts,
271
272
  services: Object.keys(this.services).length > 0 ? this.services : undefined,
272
273
  buildArgs: Object.keys(this.buildArgs).length > 0 ? this.buildArgs : undefined,
@@ -10,7 +10,10 @@ export type ProjectV1 = {
10
10
  composefile?: string;
11
11
  preset?: string;
12
12
  presetMode?: "global" | "project";
13
- scripts?: string[];
13
+ cmd?: string[];
14
+ scripts?: {
15
+ [script: string]: string;
16
+ };
14
17
  services?: {
15
18
  [service: string]: ServiceProperties;
16
19
  };
@@ -1,7 +1,8 @@
1
1
  import { AppConfig } from "../makes/AppConfig";
2
- import { PresetSource } from "../makes/Preset";
2
+ import { PresetRef } from "../types/PresetRef";
3
3
  import { ProjectRef } from "../types/ProjectRef";
4
4
  import { PluginRef } from "../types/PluginRef";
5
+ import { PresetSource } from "../types/PresetSource";
5
6
  import { AppFileSystemService } from "./AppFileSystemService";
6
7
  import { ProcessService } from "./ProcessService";
7
8
  type TypeMap = {
@@ -19,6 +20,7 @@ export declare class AppConfigService {
19
20
  get debug(): boolean;
20
21
  set debug(debug: boolean);
21
22
  get config(): AppConfig;
23
+ get presets(): PresetRef[];
22
24
  get projects(): ProjectRef[];
23
25
  get plugins(): PluginRef[];
24
26
  /**
@@ -90,6 +90,9 @@ let AppConfigService = class AppConfigService {
90
90
  }
91
91
  return this._config;
92
92
  }
93
+ get presets() {
94
+ return this.config.presets;
95
+ }
93
96
  get projects() {
94
97
  return this.config.projects;
95
98
  }
@@ -1,4 +1,4 @@
1
- import { PresetSource } from "../makes/Preset";
1
+ import { PresetSource } from "./PresetSource";
2
2
  export type PresetRef = {
3
3
  name: string;
4
4
  source: PresetSource;
@@ -0,0 +1,4 @@
1
+ export declare const PRESET_SOURCE_INTERNAL: "internal";
2
+ export declare const PRESET_SOURCE_EXTERNAL: "external";
3
+ export declare const PRESET_SOURCE_GITHUB: "github";
4
+ export type PresetSource = typeof PRESET_SOURCE_INTERNAL | typeof PRESET_SOURCE_EXTERNAL | typeof PRESET_SOURCE_GITHUB;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PRESET_SOURCE_GITHUB = exports.PRESET_SOURCE_EXTERNAL = exports.PRESET_SOURCE_INTERNAL = void 0;
4
+ exports.PRESET_SOURCE_INTERNAL = "internal";
5
+ exports.PRESET_SOURCE_EXTERNAL = "external";
6
+ exports.PRESET_SOURCE_GITHUB = "github";
@@ -6,6 +6,8 @@ export * from "./ModuleMetadata";
6
6
  export * from "./PackageManagerType";
7
7
  export * from "./PickProperties";
8
8
  export * from "./PluginMetadata";
9
+ export * from "./PresetRef";
10
+ export * from "./PresetSource";
9
11
  export * from "./Type";
10
12
  export * from "./Volume";
11
13
  export * from "./ProviderType";
@@ -22,6 +22,8 @@ __exportStar(require("./ModuleMetadata"), exports);
22
22
  __exportStar(require("./PackageManagerType"), exports);
23
23
  __exportStar(require("./PickProperties"), exports);
24
24
  __exportStar(require("./PluginMetadata"), exports);
25
+ __exportStar(require("./PresetRef"), exports);
26
+ __exportStar(require("./PresetSource"), exports);
25
27
  __exportStar(require("./Type"), exports);
26
28
  __exportStar(require("./Volume"), exports);
27
29
  __exportStar(require("./ProviderType"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wocker/core",
3
3
  "type": "commonjs",
4
- "version": "1.0.26-beta.1",
4
+ "version": "1.0.26-beta.3",
5
5
  "author": "Kris Papercut <krispcut@gmail.com>",
6
6
  "description": "Core of the Wocker",
7
7
  "license": "MIT",