@wocker/core 1.1.3 → 1.1.4-beta.0

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/lib/makes/File.js CHANGED
@@ -103,7 +103,7 @@ class File {
103
103
  throw new Error("Line number must be a non-zero");
104
104
  }
105
105
  const bufferSize = 1024, isForward = line > 0, targetLine = Math.abs(line), stats = this.stat();
106
- let position = isForward ? 0 : stats.size, currentLine = 0, currentOffset = isForward ? 0 : stats.size + 1, stump = "";
106
+ let position = isForward ? 0 : stats.size, currentLine = 0, currentOffset = isForward ? 0 : stats.size + 1, stump = "", isFirstChunk = true;
107
107
  while (isForward ? position < stats.size : position > 0) {
108
108
  const readSize = isForward
109
109
  ? Math.min(bufferSize, stats.size - position)
@@ -115,6 +115,11 @@ class File {
115
115
  if (isForward) {
116
116
  position += readSize;
117
117
  }
118
+ if (!isForward && isFirstChunk && lines[lines.length - 1] === "") {
119
+ lines.pop();
120
+ currentOffset -= 1;
121
+ }
122
+ isFirstChunk = false;
118
123
  if (isForward ? position === stats.size : position === 0) {
119
124
  stump = "";
120
125
  }
@@ -1,6 +1,8 @@
1
+ import { Version } from "./Version";
1
2
  import { VersionRule } from "./VersionRule";
2
3
  export declare class VersionRange {
3
4
  protected rules: VersionRule[][];
4
5
  constructor(rules: VersionRule[][]);
6
+ match(version: string | Version, withTag?: boolean): boolean;
5
7
  static parse(range: string): VersionRange;
6
8
  }
@@ -1,17 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VersionRange = void 0;
4
+ const Version_1 = require("./Version");
4
5
  const VersionRule_1 = require("./VersionRule");
5
6
  class VersionRange {
6
7
  constructor(rules) {
7
8
  this.rules = rules;
8
9
  }
9
- static parse(range) {
10
- const rules = range.split("||").map((range) => {
11
- return range.split(" ").map((rule) => {
12
- return VersionRule_1.VersionRule.parse(rule);
10
+ match(version, withTag) {
11
+ if (typeof version === "string") {
12
+ version = Version_1.Version.parse(version);
13
+ }
14
+ return this.rules.some((rules) => {
15
+ return rules.every((rule) => {
16
+ return rule.match(version, withTag);
13
17
  });
14
18
  });
19
+ }
20
+ static parse(range) {
21
+ const rules = range.split("||").map((group) => {
22
+ return group
23
+ .trim()
24
+ .split(/\s+/)
25
+ .filter((rule) => rule.length > 0)
26
+ .map((rule) => VersionRule_1.VersionRule.parse(rule));
27
+ });
15
28
  return new VersionRange(rules);
16
29
  }
17
30
  }
@@ -53,5 +53,6 @@ export declare namespace ContainerService {
53
53
  };
54
54
  type LogsParams = {
55
55
  signal?: AbortSignal;
56
+ tail?: number;
56
57
  };
57
58
  }
@@ -27,8 +27,8 @@ export type PresetVariableConfig = TextOption | ConfirmOption | SelectOption;
27
27
  export type PresetProperties = PickProperties<Preset>;
28
28
  export declare abstract class Preset {
29
29
  name: string;
30
- source?: PresetSource;
31
30
  version: string;
31
+ source?: PresetSource;
32
32
  type?: string;
33
33
  image?: string;
34
34
  dockerfile?: string;
@@ -119,6 +119,7 @@ let AppService = class AppService {
119
119
  return [
120
120
  "projectComposeType",
121
121
  "buildKit",
122
+ "presetV2",
122
123
  "dns"
123
124
  ];
124
125
  }
@@ -38,10 +38,13 @@ let LogService = class LogService {
38
38
  const logData = data.map((item) => {
39
39
  return typeof item !== "string" ? JSON.stringify(item) : item;
40
40
  }).join(" ");
41
+ const escapedLogData = logData
42
+ .replace(/\\/g, "\\\\")
43
+ .replace(/\r\n|\r|\n/g, "\\n");
41
44
  if (!this.fs.exists(this.logName)) {
42
45
  this.fs.writeFile(this.logName, "");
43
46
  }
44
- this.fs.appendFile(this.logName, `[${time}] ${type}: ${logData}\n`);
47
+ this.fs.appendFile(this.logName, `[${time}] ${type}: ${escapedLogData}\n`);
45
48
  }
46
49
  debug(...data) {
47
50
  this._log(types_1.LogLevel.DEBUG, ...data);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wocker/core",
3
3
  "type": "commonjs",
4
- "version": "1.1.3",
4
+ "version": "1.1.4-beta.0",
5
5
  "author": "Kris Papercut <krispcut@gmail.com>",
6
6
  "description": "Core of the Wocker",
7
7
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/docker-modem": "^3.0.6",
40
- "@types/dockerode": "^3.3.23",
40
+ "@types/dockerode": "^4.0.1",
41
41
  "@types/jest": "^30.0.0",
42
42
  "@types/node": "^24.5.2",
43
43
  "jest": "^30.1.3",