plccheck 0.0.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/README.md ADDED
@@ -0,0 +1,27 @@
1
+ # plccheck
2
+
3
+ CLI wrapper for the Siemens PLC checker/LSP written in Go.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npx plccheck check ./path/to/project
9
+ ```
10
+
11
+ ## Commands
12
+
13
+ - `plccheck serve` (LSP server over stdio)
14
+ - `plccheck check <files-or-folders...>`
15
+ - `plccheck emit --target <language> <file>`
16
+ - `plccheck version`
17
+
18
+ ## Publishing (maintainers)
19
+
20
+ Initial publish requires npm auth once (to create the package entries in the registry). After that, releases use GitHub Actions + npm Trusted Publishing.
21
+
22
+ From the repo root:
23
+
24
+ ```bash
25
+ npm adduser
26
+ node npm/scripts/bootstrap-publish-plccheck.mjs
27
+ ```
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ const { spawn } = require('node:child_process');
5
+
6
+ function platformPackageName() {
7
+ const platform = process.platform;
8
+ const arch = process.arch;
9
+
10
+ if (platform === 'win32' && arch === 'x64') return '@danielv123/plccheck-win-x64';
11
+ if (platform === 'win32' && arch === 'arm64') return '@danielv123/plccheck-win-arm64';
12
+
13
+ if (platform === 'linux' && arch === 'x64') return '@danielv123/plccheck-linux-x64';
14
+ if (platform === 'linux' && arch === 'arm64') return '@danielv123/plccheck-linux-arm64';
15
+
16
+ if (platform === 'darwin' && arch === 'x64') return '@danielv123/plccheck-darwin-x64';
17
+ if (platform === 'darwin' && arch === 'arm64') return '@danielv123/plccheck-darwin-arm64';
18
+
19
+ return null;
20
+ }
21
+
22
+ const pkg = platformPackageName();
23
+ if (!pkg) {
24
+ console.error(`plccheck: unsupported platform/arch: ${process.platform}/${process.arch}`);
25
+ process.exit(1);
26
+ }
27
+
28
+ let binaryPath;
29
+ try {
30
+ binaryPath = require(pkg);
31
+ } catch (err) {
32
+ console.error(`plccheck: failed to resolve platform binary package: ${pkg}`);
33
+ console.error('plccheck: try reinstalling, or ensure optionalDependencies are being installed.');
34
+ if (err && err.stack) console.error(err.stack);
35
+ process.exit(1);
36
+ }
37
+
38
+ const child = spawn(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
39
+
40
+ child.on('error', (err) => {
41
+ console.error(`plccheck: failed to start binary: ${binaryPath}`);
42
+ console.error(err && err.stack ? err.stack : String(err));
43
+ process.exit(1);
44
+ });
45
+
46
+ child.on('exit', (code, signal) => {
47
+ if (signal) process.kill(process.pid, signal);
48
+ process.exit(code == null ? 1 : code);
49
+ });
50
+
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "plccheck",
3
+ "version": "0.0.0",
4
+ "description": "Siemens PLC language checker + LSP CLI (SCL/ST/LAD/FBD, etc.)",
5
+ "license": "CC-BY-NC-4.0",
6
+ "bin": {
7
+ "plccheck": "bin/plccheck.js"
8
+ },
9
+ "files": [
10
+ "bin/plccheck.js",
11
+ "README.md"
12
+ ],
13
+ "optionalDependencies": {
14
+ "@danielv123/plccheck-win-x64": "0.0.0",
15
+ "@danielv123/plccheck-win-arm64": "0.0.0",
16
+ "@danielv123/plccheck-linux-x64": "0.0.0",
17
+ "@danielv123/plccheck-linux-arm64": "0.0.0",
18
+ "@danielv123/plccheck-darwin-x64": "0.0.0",
19
+ "@danielv123/plccheck-darwin-arm64": "0.0.0"
20
+ },
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/danielv/vscode_siemens.git"
24
+ }
25
+ }