@flowmetelev/wfkit 1.0.1 → 1.2.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.
Files changed (3) hide show
  1. package/README.md +2 -0
  2. package/bin/wfkit.js +24 -13
  3. package/package.json +46 -46
package/README.md CHANGED
@@ -20,6 +20,8 @@ Run:
20
20
  npm install -g @flowmetelev/wfkit
21
21
  ```
22
22
 
23
+ If your package manager blocks `postinstall` scripts, the `wfkit` launcher will download the native binary automatically on first run.
24
+
23
25
  ## Quick start
24
26
 
25
27
  Create a project:
package/bin/wfkit.js CHANGED
@@ -3,25 +3,36 @@
3
3
  const { existsSync } = require("fs");
4
4
  const { join } = require("path");
5
5
  const { spawnSync } = require("child_process");
6
+ const { downloadBinary } = require("../install.js");
6
7
 
7
8
  const platform = process.platform;
8
9
  const binaryName = platform === "win32" ? "wfkit.exe" : "wfkit";
9
10
  const binaryPath = join(__dirname, binaryName);
10
11
 
11
- if (!existsSync(binaryPath)) {
12
- console.error(
13
- `wfkit binary is missing at ${binaryPath}. Reinstall the package to run the postinstall download again.`,
14
- );
15
- process.exit(1);
16
- }
12
+ async function main() {
13
+ if (!existsSync(binaryPath)) {
14
+ console.warn("wfkit binary is missing. Attempting to download it now.");
15
+
16
+ try {
17
+ await downloadBinary();
18
+ } catch (error) {
19
+ console.error(
20
+ `Failed to download the wfkit binary on first run: ${error.message}`,
21
+ );
22
+ process.exit(1);
23
+ }
24
+ }
25
+
26
+ const result = spawnSync(binaryPath, process.argv.slice(2), {
27
+ stdio: "inherit",
28
+ });
17
29
 
18
- const result = spawnSync(binaryPath, process.argv.slice(2), {
19
- stdio: "inherit",
20
- });
30
+ if (result.error) {
31
+ console.error(`Failed to start wfkit: ${result.error.message}`);
32
+ process.exit(1);
33
+ }
21
34
 
22
- if (result.error) {
23
- console.error(`Failed to start wfkit: ${result.error.message}`);
24
- process.exit(1);
35
+ process.exit(result.status === null ? 1 : result.status);
25
36
  }
26
37
 
27
- process.exit(result.status === null ? 1 : result.status);
38
+ main();
package/package.json CHANGED
@@ -1,48 +1,48 @@
1
1
  {
2
- "name": "@flowmetelev/wfkit",
3
- "version": "1.0.1",
4
- "description": "A powerful CLI utility for securely publishing Webflow projects with live development support.",
5
- "main": "install.js",
6
- "bin": {
7
- "wfkit": "bin/wfkit.js"
8
- },
9
- "scripts": {
10
- "postinstall": "node install.js"
11
- },
12
- "os": [
13
- "darwin",
14
- "linux",
15
- "win32"
16
- ],
17
- "cpu": [
18
- "x64",
19
- "arm64"
20
- ],
21
- "repository": {
22
- "type": "git",
23
- "url": "git+https://github.com/flowmetelev/wfkit.git"
24
- },
25
- "keywords": [
26
- "webflow",
27
- "cli",
28
- "publish",
29
- "development",
30
- "deploy",
31
- "sync"
32
- ],
33
- "author": "Dmitry Metelev <mailmetelev@gmail.com>",
34
- "license": "MIT",
35
- "bugs": {
36
- "url": "https://github.com/flowmetelev/wfkit/issues"
37
- },
38
- "homepage": "https://github.com/flowmetelev/wfkit#readme",
39
- "files": [
40
- "bin/",
41
- "install.js",
42
- "package.json",
43
- "README.md"
44
- ],
45
- "engines": {
46
- "node": ">=14.0.0"
47
- }
2
+ "name": "@flowmetelev/wfkit",
3
+ "version": "1.2.0",
4
+ "description": "A powerful CLI utility for securely publishing Webflow projects with live development support.",
5
+ "main": "install.js",
6
+ "bin": {
7
+ "wfkit": "bin/wfkit.js"
8
+ },
9
+ "scripts": {
10
+ "postinstall": "node install.js"
11
+ },
12
+ "os": [
13
+ "darwin",
14
+ "linux",
15
+ "win32"
16
+ ],
17
+ "cpu": [
18
+ "x64",
19
+ "arm64"
20
+ ],
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/flowmetelev/wfkit.git"
24
+ },
25
+ "keywords": [
26
+ "webflow",
27
+ "cli",
28
+ "publish",
29
+ "development",
30
+ "deploy",
31
+ "sync"
32
+ ],
33
+ "author": "Dmitry Metelev <mailmetelev@gmail.com>",
34
+ "license": "MIT",
35
+ "bugs": {
36
+ "url": "https://github.com/flowmetelev/wfkit/issues"
37
+ },
38
+ "homepage": "https://github.com/flowmetelev/wfkit#readme",
39
+ "files": [
40
+ "bin/",
41
+ "install.js",
42
+ "package.json",
43
+ "README.md"
44
+ ],
45
+ "engines": {
46
+ "node": ">=14.0.0"
47
+ }
48
48
  }