@tsplc/build 0.5.3 → 0.5.4
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/dist/cli.js.map +15 -15
- package/dist/images.js.map +2 -2
- package/dist/index.js.map +13 -13
- package/docker/runner.ts +2 -2
- package/package.json +4 -4
- package/src/build.ts +2 -2
- package/src/builder-image.ts +3 -3
- package/src/cli.ts +7 -7
- package/src/controller-online.ts +6 -6
- package/src/docker-build.ts +4 -4
- package/src/docker-context.ts +1 -1
- package/src/docker-run.ts +1 -1
- package/src/engineering-settings.ts +1 -1
- package/src/images.ts +2 -2
- package/src/index.ts +9 -9
- package/src/io.ts +2 -2
- package/src/project-operations.ts +3 -3
- package/src/run.ts +1 -1
- package/src/sources.ts +1 -1
package/docker/runner.ts
CHANGED
|
@@ -18,12 +18,12 @@ import {
|
|
|
18
18
|
buildFailureFile,
|
|
19
19
|
controllerFailureFile,
|
|
20
20
|
describeBuildFailure,
|
|
21
|
-
} from "../src/diagnostics
|
|
21
|
+
} from "../src/diagnostics";
|
|
22
22
|
import {
|
|
23
23
|
createCodesysWorker,
|
|
24
24
|
withWorkerShutdown,
|
|
25
25
|
} from "../src/host/codesys-worker";
|
|
26
|
-
import { resolveContainerConfig } from "./config
|
|
26
|
+
import { resolveContainerConfig } from "./config";
|
|
27
27
|
|
|
28
28
|
const operations = [
|
|
29
29
|
"build",
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"url": "git+https://github.com/rip-technologies/tsplc.git",
|
|
16
16
|
"directory": "packages/build"
|
|
17
17
|
},
|
|
18
|
-
"version": "0.5.
|
|
18
|
+
"version": "0.5.4",
|
|
19
19
|
"type": "module",
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
@@ -54,9 +54,9 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"zod": "4.3.6",
|
|
57
|
-
"@tsplc/config": "0.5.
|
|
58
|
-
"@tsplc/typegen": "0.5.
|
|
59
|
-
"@tsplc/iec": "0.5.
|
|
57
|
+
"@tsplc/config": "0.5.4",
|
|
58
|
+
"@tsplc/typegen": "0.5.4",
|
|
59
|
+
"@tsplc/iec": "0.5.4"
|
|
60
60
|
},
|
|
61
61
|
"bin": {
|
|
62
62
|
"tsplc-build": "./dist/cli.js"
|
package/src/build.ts
CHANGED
|
@@ -12,9 +12,9 @@ import type { ResolvedConfig } from "@tsplc/config/build";
|
|
|
12
12
|
import { buildFiles, publishBuild, readBuild } from "./artifacts";
|
|
13
13
|
import { writeDeviceTree } from "./device-tree";
|
|
14
14
|
import { buildInDocker } from "./docker-build";
|
|
15
|
-
import type { ProgressOptions } from "./docker-run
|
|
15
|
+
import type { ProgressOptions } from "./docker-run";
|
|
16
16
|
import { createCodesysWorker, withWorkerLock } from "./host/codesys-worker";
|
|
17
|
-
import { builderImage } from "./images
|
|
17
|
+
import { builderImage } from "./images";
|
|
18
18
|
import { importRequest } from "./import-request";
|
|
19
19
|
import { loadSources } from "./sources";
|
|
20
20
|
|
package/src/builder-image.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isDeepStrictEqual } from "node:util";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { builderRecipe, containerManifest } from "./docker-context
|
|
4
|
-
import { captureDocker } from "./docker-run
|
|
5
|
-
import { builderImage, recipeLabel } from "./images
|
|
3
|
+
import { builderRecipe, containerManifest } from "./docker-context";
|
|
4
|
+
import { captureDocker } from "./docker-run";
|
|
5
|
+
import { builderImage, recipeLabel } from "./images";
|
|
6
6
|
|
|
7
7
|
/** Where the image's recipe wrote the manifest of the third-party packages it installed. */
|
|
8
8
|
const imageManifest = "/opt/codesys-build/package.json";
|
package/src/cli.ts
CHANGED
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import { parseArgs } from "node:util";
|
|
3
3
|
import { loadTsplcConfig } from "@tsplc/config";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import { buildProject } from "./build
|
|
6
|
-
import { updateController } from "./controller-online
|
|
7
|
-
import { configureDocker, configureRuntime } from "./docker-build
|
|
8
|
-
import { rawEngineeringSettings } from "./engineering-settings
|
|
9
|
-
import { installLibraries } from "./libraries
|
|
5
|
+
import { buildProject } from "./build";
|
|
6
|
+
import { updateController } from "./controller-online";
|
|
7
|
+
import { configureDocker, configureRuntime } from "./docker-build";
|
|
8
|
+
import { rawEngineeringSettings } from "./engineering-settings";
|
|
9
|
+
import { installLibraries } from "./libraries";
|
|
10
10
|
import {
|
|
11
11
|
checkRawSources,
|
|
12
12
|
inspectProjectController,
|
|
13
|
-
} from "./project-operations
|
|
14
|
-
import { runProject } from "./run
|
|
13
|
+
} from "./project-operations";
|
|
14
|
+
import { runProject } from "./run";
|
|
15
15
|
|
|
16
16
|
const commandSchema = z.enum([
|
|
17
17
|
"configure",
|
package/src/controller-online.ts
CHANGED
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
tracebackFailure,
|
|
26
26
|
transferRollback,
|
|
27
27
|
type warmOperationSchema,
|
|
28
|
-
} from "./controller-protocol
|
|
29
|
-
import { controllerDirectory, jobProgressLog } from "./controller-session
|
|
30
|
-
import { controllerFailureFile } from "./diagnostics
|
|
31
|
-
import { containerCodeDigest } from "./docker-context
|
|
28
|
+
} from "./controller-protocol";
|
|
29
|
+
import { controllerDirectory, jobProgressLog } from "./controller-session";
|
|
30
|
+
import { controllerFailureFile } from "./diagnostics";
|
|
31
|
+
import { containerCodeDigest } from "./docker-context";
|
|
32
32
|
import {
|
|
33
33
|
type ContainerEnvironment,
|
|
34
34
|
captureDocker,
|
|
@@ -37,8 +37,8 @@ import {
|
|
|
37
37
|
prepareContainerRun,
|
|
38
38
|
runDocker,
|
|
39
39
|
writeOperationRequest,
|
|
40
|
-
} from "./docker-run
|
|
41
|
-
import { builderImage } from "./images
|
|
40
|
+
} from "./docker-run";
|
|
41
|
+
import { builderImage } from "./images";
|
|
42
42
|
|
|
43
43
|
/** Where an operation reads the controller user's environment variables from; this process's environment by default. */
|
|
44
44
|
export interface CredentialSource {
|
package/src/docker-build.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { tmpdir } from "node:os";
|
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
5
|
import type { ResolvedConfig } from "@tsplc/config/build";
|
|
6
6
|
import { readBuild } from "./artifacts";
|
|
7
|
-
import { builderImageStatus, setupReason } from "./builder-image
|
|
7
|
+
import { builderImageStatus, setupReason } from "./builder-image";
|
|
8
8
|
import {
|
|
9
9
|
buildFailureFile,
|
|
10
10
|
buildFailureSchema,
|
|
11
11
|
CodesysCompilerError,
|
|
12
|
-
} from "./diagnostics
|
|
12
|
+
} from "./diagnostics";
|
|
13
13
|
import {
|
|
14
14
|
captureDocker,
|
|
15
15
|
type ProgressOptions,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
prepareContainerRun,
|
|
18
18
|
progressLog,
|
|
19
19
|
runDocker,
|
|
20
|
-
} from "./docker-run
|
|
20
|
+
} from "./docker-run";
|
|
21
21
|
import {
|
|
22
22
|
buildBuilderImage,
|
|
23
23
|
builderImage,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
publishedImage,
|
|
29
29
|
runtimeImage,
|
|
30
30
|
setupPlatformFor,
|
|
31
|
-
} from "./images
|
|
31
|
+
} from "./images";
|
|
32
32
|
|
|
33
33
|
/** Pulls `published` and tags it as the local `image`; false when it isn't available, so the caller builds it. */
|
|
34
34
|
const pullPublished = async (
|
package/src/docker-context.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { createRequire } from "node:module";
|
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
14
14
|
import { basename, dirname, posix, relative, resolve, sep } from "node:path";
|
|
15
15
|
import { z } from "zod";
|
|
16
|
-
import { packageDirectory } from "./package-path
|
|
16
|
+
import { packageDirectory } from "./package-path";
|
|
17
17
|
|
|
18
18
|
const includeSource = (source: string) => {
|
|
19
19
|
const name = basename(source);
|
package/src/docker-run.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { copyFile, cp, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
|
4
4
|
import { basename, posix, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { promisify } from "node:util";
|
|
6
6
|
import type { ResolvedConfig } from "@tsplc/config/build";
|
|
7
|
-
import { containerCode } from "./docker-context
|
|
7
|
+
import { containerCode } from "./docker-context";
|
|
8
8
|
|
|
9
9
|
const execute = promisify(execFile);
|
|
10
10
|
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { resolveConfig } from "@tsplc/config/build";
|
|
8
8
|
import { deviceTree } from "@tsplc/typegen";
|
|
9
9
|
import { loadHardware, resolveIo } from "@tsplc/typegen/hardware";
|
|
10
|
-
import { installLibraries } from "./libraries
|
|
10
|
+
import { installLibraries } from "./libraries";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* The settings a raw Structured Text project builds, runs and updates its controller with:
|
package/src/images.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { copyFile, cp, mkdir, mkdtemp, rm } from "node:fs/promises";
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { dockerImage } from "@tsplc/config/build";
|
|
5
|
-
import { builderRecipe, prepareDockerContext } from "./docker-context
|
|
6
|
-
import { packageDirectory } from "./package-path
|
|
5
|
+
import { builderRecipe, prepareDockerContext } from "./docker-context";
|
|
6
|
+
import { packageDirectory } from "./package-path";
|
|
7
7
|
|
|
8
8
|
export const builderImage = dockerImage;
|
|
9
9
|
|
package/src/index.ts
CHANGED
|
@@ -7,13 +7,13 @@ export {
|
|
|
7
7
|
type ResolvedConfig,
|
|
8
8
|
resolveConfig,
|
|
9
9
|
} from "@tsplc/config/build";
|
|
10
|
-
export { readBuild } from "./artifacts
|
|
10
|
+
export { readBuild } from "./artifacts";
|
|
11
11
|
export { buildProject } from "./build";
|
|
12
12
|
export {
|
|
13
13
|
type BuilderImageStatus,
|
|
14
14
|
builderImageStatus,
|
|
15
15
|
setupReason,
|
|
16
|
-
} from "./builder-image
|
|
16
|
+
} from "./builder-image";
|
|
17
17
|
export {
|
|
18
18
|
type ControllerLogin,
|
|
19
19
|
findControllerLogin,
|
|
@@ -38,7 +38,7 @@ export {
|
|
|
38
38
|
TransferFailedError,
|
|
39
39
|
transferRollback,
|
|
40
40
|
} from "./controller-protocol";
|
|
41
|
-
export { controllerBaseline } from "./controller-session
|
|
41
|
+
export { controllerBaseline } from "./controller-session";
|
|
42
42
|
export {
|
|
43
43
|
type CodesysCompilerDiagnostic,
|
|
44
44
|
CodesysCompilerError,
|
|
@@ -47,26 +47,26 @@ export {
|
|
|
47
47
|
configureDocker,
|
|
48
48
|
configureGateway,
|
|
49
49
|
configureRuntime,
|
|
50
|
-
} from "./docker-build
|
|
50
|
+
} from "./docker-build";
|
|
51
51
|
export {
|
|
52
52
|
captureDocker,
|
|
53
53
|
type ProgressOptions,
|
|
54
54
|
type ProgressStream,
|
|
55
55
|
progressLog,
|
|
56
|
-
} from "./docker-run
|
|
56
|
+
} from "./docker-run";
|
|
57
57
|
export { rawEngineeringSettings } from "./engineering-settings";
|
|
58
|
-
export { workerScriptsDigest } from "./host/codesys-worker
|
|
59
|
-
export { gatewayImage } from "./images
|
|
58
|
+
export { workerScriptsDigest } from "./host/codesys-worker";
|
|
59
|
+
export { gatewayImage } from "./images";
|
|
60
60
|
export {
|
|
61
61
|
type InstalledLibrary,
|
|
62
62
|
installLibraries,
|
|
63
63
|
libraryIndex,
|
|
64
64
|
validateLibrary,
|
|
65
|
-
} from "./libraries
|
|
65
|
+
} from "./libraries";
|
|
66
66
|
export {
|
|
67
67
|
checkRawSources,
|
|
68
68
|
inspectProjectController,
|
|
69
|
-
} from "./project-operations
|
|
69
|
+
} from "./project-operations";
|
|
70
70
|
export { runProject } from "./run";
|
|
71
71
|
export { loadSources, type SourceObject } from "./sources";
|
|
72
72
|
export { StSyntaxError } from "./st/lexer";
|
package/src/io.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ioArray, ioScalarBits, sizePrefix } from "@tsplc/iec";
|
|
2
2
|
import { qualifiers, variableSections } from "@tsplc/iec/st";
|
|
3
|
-
import type { SourceObject } from "./sources
|
|
4
|
-
import { type Token, tokenize } from "./st/lexer
|
|
3
|
+
import type { SourceObject } from "./sources";
|
|
4
|
+
import { type Token, tokenize } from "./st/lexer";
|
|
5
5
|
|
|
6
6
|
export interface DirectIoBinding {
|
|
7
7
|
address: string;
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
} from "@tsplc/config";
|
|
6
6
|
import { resolveConfig } from "@tsplc/config/build";
|
|
7
7
|
import { loadHardware, resolveIo } from "@tsplc/typegen/hardware";
|
|
8
|
-
import { inspectController } from "./controller-online
|
|
9
|
-
import type { ProgressOptions } from "./docker-run
|
|
10
|
-
import { loadSources } from "./sources
|
|
8
|
+
import { inspectController } from "./controller-online";
|
|
9
|
+
import type { ProgressOptions } from "./docker-run";
|
|
10
|
+
import { loadSources } from "./sources";
|
|
11
11
|
|
|
12
12
|
/** Parses a raw Structured Text project's sources with its IO bound, without installing libraries or building. */
|
|
13
13
|
export const checkRawSources = async ({
|
package/src/run.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { z } from "zod";
|
|
|
7
7
|
import { readBuild } from "./artifacts";
|
|
8
8
|
import { captureDocker, type ProgressOptions, progressLog } from "./docker-run";
|
|
9
9
|
import { withWorkerLock } from "./host/codesys-worker";
|
|
10
|
-
import { runtimeImage } from "./images
|
|
10
|
+
import { runtimeImage } from "./images";
|
|
11
11
|
import { getApplicationStatus } from "./runtime-status";
|
|
12
12
|
|
|
13
13
|
const stateSchema = z.object({
|
package/src/sources.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { readdir, readFile } from "node:fs/promises";
|
|
|
2
2
|
import { basename, resolve } from "node:path";
|
|
3
3
|
import type { ResolvedConfig } from "@tsplc/config/build";
|
|
4
4
|
import { identifierPattern } from "@tsplc/iec/st";
|
|
5
|
-
import { bindStructuredTextIo } from "./io
|
|
5
|
+
import { bindStructuredTextIo } from "./io";
|
|
6
6
|
import { type ObjectKind, type ParsedSource, parseSource } from "./st/parse";
|
|
7
7
|
|
|
8
8
|
export type SourceObject = ParsedSource & {
|