@neoskop/dockerfile.js
Advanced tools
Comparing version 0.2.3 to 0.3.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const from_1 = require("./commands/from"); | ||
let stageUniqueId = 0; | ||
class Stage { | ||
constructor(name = 'S' + (Math.random() * 0xFFFFFFFF >>> 0).toString(16).padStart(8, '0')) { | ||
constructor(name = 'S' + (++stageUniqueId).toString(16).padStart(8, '0')) { | ||
this.name = name; | ||
@@ -39,2 +40,2 @@ this._commands = []; | ||
exports.stage = stage; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhZ2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbGliL3N0YWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsMENBQXVDO0FBZ0J2QyxNQUFhLEtBQUs7SUFJZCxZQUFzQixPQUFlLEdBQUcsR0FBRyxDQUFDLElBQUksQ0FBQyxNQUFNLEVBQUUsR0FBRyxVQUFVLEtBQUssQ0FBQyxDQUFDLENBQUMsUUFBUSxDQUFDLEVBQUUsQ0FBQyxDQUFDLFFBQVEsQ0FBQyxDQUFDLEVBQUUsR0FBRyxDQUFDO1FBQXJGLFNBQUksR0FBSixJQUFJLENBQWlGO1FBRmpHLGNBQVMsR0FBc0IsRUFBRSxDQUFDO0lBSTVDLENBQUM7SUFFRCxPQUFPO1FBQ0gsT0FBTyxJQUFJLENBQUMsSUFBSSxDQUFDO0lBQ3JCLENBQUM7SUFFRCxXQUFXO1FBQ1AsT0FBTyxJQUFJLENBQUMsSUFBSSxDQUFDO0lBQ3JCLENBQUM7SUFJRCxJQUFJLENBQUMsSUFBb0I7UUFDckIsSUFBRyxJQUFJLEVBQUU7WUFDTCxJQUFJLENBQUMsS0FBSyxHQUFHLElBQUksWUFBWSxXQUFJLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsSUFBSSxXQU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uX2Zyb20gPSBmcm9tIGluc3RhbmNlb2YgRnJvbSA/IGZyb20gOiBuZXcgRnJvbShmcm9tKTtcbiAgICAgICAgICAgIHJldHVybiB0aGlzO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiB0aGlzLl9mcm9tO1xuICAgIH1cblxuICAgIGNvbW1hbmRzKCkgOiBJRG9ja2VyQ29tbWFuZFtdO1xuICAgIGNvbW1hbmRzKGNtZDogSURvY2tlckNvbW1hbmQsIC4uLmNvbW1hbmRzIDogSURvY2tlckNvbW1hbmRbXSkgOiB0aGlzO1xuICAgIGNvbW1hbmRzKGNtZD86IElEb2NrZXJDb21tYW5kLCAuLi5jb21tYW5kcyA6IElEb2NrZXJDb21tYW5kW10pIDogdGhpcyB8IElEb2NrZXJDb21tYW5kW10ge1xuICAgICAgICBpZihjbWQpIHtcbiAgICAgICAgICAgIHRoaXMuX2NvbW1hbmRzLnB1c2goY21kLCAuLi5jb21tYW5kcyk7XG4gICAgICAgICAgICByZXR1cm4gdGhpcztcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gdGhpcy5fY29tbWFuZHM7XG4gICAgfVxuXG4gICAgdG9TdHJpbmcoY29udGV4dCA6IERvY2tlcmZpbGVCdWlsZENvbnRleHQpIHtcbiAgICAgICAgY29uc3QgYnVpbGRDb250ZXh0IDogU3RhZ2VCdWlsZENvbnRleHQgPSB7XG4gICAgICAgICAgICAuLi5jb250ZXh0LFxuICAgICAgICAgICAgc3RhZ2U6IHRoaXNcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiBbIHRoaXMuZnJvbSgpIS50b0RvY2tlckNvbW1hbmQoYnVpbGRDb250ZXh0KSwgJycsIC4uLnRoaXMuX2NvbW1hbmRzLm1hcChjbWQgPT4gY21kLnRvRG9ja2VyQ29tbWFuZChidWlsZENvbnRleHQpICkgXS5qb2luKCdcXG4nKTtcbiAgICB9XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBzdGFnZSguLi5hcmdzIDogQ29uc3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ygpIDogSURvY2tlckNvbW1hbmRbXTtcbiAgICBjb21tYW5kcyhjbWQ6IElEb2NrZXJDb21tYW5kLCAuLi5jb21tYW5kcyA6IElEb2NrZXJDb21tYW5kW10pIDogdGhpcztcbiAgICBjb21tYW5kcyhjbWQ/OiBJRG9ja2VyQ29tbWFuZCwgLi4uY29tbWFuZHMgOiBJRG9ja2VyQ29tbWFuZFtdKSA6IHRoaXMgfCBJRG9ja2VyQ29tbWFuZFtdIHtcbiAgICAgICAgaWYoY21kKSB7XG4gICAgICAgICAgICB0aGlzLl9jb21tYW5kcy5wdXNoKGNtZCwgLi4uY29tbWFuZHMpO1xuICAgICAgICAgICAgcmV0dXJuIHRoaXM7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHRoaXMuX2NvbW1hbmRzO1xuICAgIH1cblxuICAgIHRvU3RyaW5nKGNvbnRleHQgOiBEb2NrZXJmaWxlQnVpbGRDb250ZXh0KSB7XG4gICAgICAgIGNvbnN0IGJ1aWxkQ29udGV4dCA6IFN0YWdlQnVpbGRDb250ZXh0ID0ge1xuICAgICAgICAgICAgLi4uY29udGV4dCxcbiAgICAgICAgICAgIHN0YWdlOiB0aGlzXG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gWyB0aGlzLmZyb20oKSEudG9Eb2NrZXJDb21tYW5kKGJ1aWxkQ29udGV4dCksICcnLCAuLi50aGlzLl9jb21tYW5kcy5tYXAoY21kID0+IGNtZC50b0RvY2tlckNvbW1hbmQoYnVpbGRDb250ZXh0KSApIF0uam9pbignXFxuJyk7XG4gICAgfVxufVxuXG5leHBvcnQgZnVuY3Rpb24gc3RhZ2UoLi4uYXJncyA6IENvbnN0cnVjdG9yUGFyYW1ldGVyczx0eXBlb2YgU3RhZ2U+KSB7XG4gICAgcmV0dXJuIG5ldyBTdGFnZSguLi5hcmdzKTtcbn0iXX0= |
{ | ||
"name": "@neoskop/dockerfile.js", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"description": "Write configurable, scriptable, reusable dockerfiles in Typescript or plain Javascript.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -62,27 +62,28 @@ # @neoskop/dockerfile.js | ||
* [ADD](./src/lib/add.ts) | ||
* [ARG](./src/lib/arg.ts) | ||
* [CMD](./src/lib/cmd.ts) | ||
* [COPY](./src/lib/copy.ts) | ||
* [ENTRYPOINT](./src/lib/entrypoint.ts) | ||
* [ENV](./src/lib/env.ts) | ||
* [EXPOSE](./src/lib/expose.ts) | ||
* [FROM](./src/lib/from.ts) | ||
* [HEALTHCHECK](./src/lib/healthcheck.ts) | ||
* [LABEL](./src/lib/label.ts) | ||
* [ONBUILD](./src/lib/onbuild.ts) | ||
* [RUN](./src/lib/run.ts) | ||
* [STOPSIGNAL](./src/lib/stopsignal.ts) | ||
* [USER](./src/lib/user.ts) | ||
* [VOLUME](./src/lib/volume.ts) | ||
* [WORKDIR](./src/lib/workdir.ts) | ||
* [RAW](./src/lib/raw.ts) | ||
* [ADD](./src/lib/commands/add.ts) | ||
* [ARG](./src/lib/commands/arg.ts) | ||
* [CMD](./src/lib/commands/cmd.ts) | ||
* [COPY](./src/lib/commands/copy.ts) | ||
* [ENTRYPOINT](./src/lib/commands/entrypoint.ts) | ||
* [ENV](./src/lib/commands/env.ts) | ||
* [EXPOSE](./src/lib/commands/expose.ts) | ||
* [FROM](./src/lib/commands/from.ts) | ||
* [HEALTHCHECK](./src/lib/commands/healthcheck.ts) | ||
* [LABEL](./src/lib/commands/label.ts) | ||
* [ONBUILD](./src/lib/commands/onbuild.ts) | ||
* [RUN](./src/lib/commands/run.ts) | ||
* [STOPSIGNAL](./src/lib/commands/stopsignal.ts) | ||
* [USER](./src/lib/commands/user.ts) | ||
* [VOLUME](./src/lib/commands/volume.ts) | ||
* [WORKDIR](./src/lib/commands/workdir.ts) | ||
* [RAW](./src/lib/commands/raw.ts) | ||
**Misc** | ||
* [Dockfile](./src/dockerfile.ts) | ||
* [Stage](./src/stage.ts) | ||
* [Multistage](./src/multistage.ts) | ||
* [Image](./src/image.ts) | ||
* [Dockfile](./src/lib/dockerfile.ts) | ||
* [Stage](./src/lib/stage.ts) | ||
* [Multistage](./src/lib/multistage.ts) | ||
* [Image](./src/lib/image.ts) | ||
## Testing | ||
@@ -89,0 +90,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85080
927
112