create-electron-reactive-event 0.0.1
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/Distribution/index.d.ts +3 -0
- package/Distribution/index.d.ts.map +1 -0
- package/Distribution/index.js +95 -0
- package/Distribution/index.js.map +1 -0
- package/package.json +47 -0
- package/tsconfig.json +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/* File: index.ts
|
|
4
|
+
* Author: Gage Sorrell <gage@sorrell.sh>
|
|
5
|
+
* Copyright: (c) 2026 Gage Sorrell
|
|
6
|
+
* License: MIT
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
// @TODO Temporary.
|
|
10
|
+
/* eslint-disable jsdoc/require-jsdoc */
|
|
11
|
+
const child_process_1 = require("child_process");
|
|
12
|
+
const cli_utilities_1 = require("@sorrell/cli-utilities");
|
|
13
|
+
const listr2_1 = require("listr2");
|
|
14
|
+
const fs_1 = require("fs");
|
|
15
|
+
const utilities_1 = require("@sorrell/utilities");
|
|
16
|
+
const path_1 = require("path");
|
|
17
|
+
async function InstallElectronReactiveEventCli() {
|
|
18
|
+
return await new Promise((Resolve) => {
|
|
19
|
+
const Command = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
20
|
+
const ChildProcess = (0, child_process_1.spawn)(Command, [
|
|
21
|
+
"install",
|
|
22
|
+
"--save-dev",
|
|
23
|
+
"electron-reactive-event-cli"
|
|
24
|
+
], {
|
|
25
|
+
shell: false,
|
|
26
|
+
stdio: "ignore"
|
|
27
|
+
});
|
|
28
|
+
ChildProcess.on("error", () => {
|
|
29
|
+
Resolve(false);
|
|
30
|
+
});
|
|
31
|
+
ChildProcess.on("close", (ExitCode) => {
|
|
32
|
+
Resolve(ExitCode === 0);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
async function RunSetupWizard() {
|
|
37
|
+
return await new Promise((Resolve) => {
|
|
38
|
+
const Command = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
39
|
+
const ChildProcess = (0, child_process_1.spawn)(Command, [
|
|
40
|
+
"exec",
|
|
41
|
+
"--package=electron-reactive-event-cli",
|
|
42
|
+
"--",
|
|
43
|
+
"electron-reactive-event-cli-setup"
|
|
44
|
+
], {
|
|
45
|
+
shell: false,
|
|
46
|
+
stdio: "inherit"
|
|
47
|
+
});
|
|
48
|
+
ChildProcess.on("error", Resolve);
|
|
49
|
+
ChildProcess.on("close", Resolve);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Installs the latest version of the `electron-reactive-event-cli` package to the NodeJS
|
|
54
|
+
* project of the current working directory, then runs the CLI's `setup` command.
|
|
55
|
+
*/
|
|
56
|
+
async function Main() {
|
|
57
|
+
const InstalledSuccessfully = await InstallElectronReactiveEventCli();
|
|
58
|
+
if (!InstalledSuccessfully) {
|
|
59
|
+
console.error(`Failed to install ${(0, cli_utilities_1.Code)("electron-reactive-event-cli")}`);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
const GetRootDirectory = async (Context, Task) => {
|
|
63
|
+
Context.RootDirectory = await (0, utilities_1.GetPackageRootDirectory)();
|
|
64
|
+
const PackageJsonPath = (0, path_1.resolve)(Context.RootDirectory, "package.json");
|
|
65
|
+
const PackageJsonContent = await fs_1.promises.readFile(PackageJsonPath, { encoding: "utf-8" });
|
|
66
|
+
const PackageName = JSON.parse(PackageJsonContent).name;
|
|
67
|
+
Task.title = `Found root directory of ${PackageName}.`;
|
|
68
|
+
};
|
|
69
|
+
const InstallCli = async () => {
|
|
70
|
+
const Success = await InstallElectronReactiveEventCli();
|
|
71
|
+
if (!Success) {
|
|
72
|
+
throw new Error("Failed to install electron-reactive-event-cli. Exiting...");
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
await new listr2_1.Listr([
|
|
76
|
+
{
|
|
77
|
+
task: GetRootDirectory,
|
|
78
|
+
title: "Finding the NodeJS project in which this command was run."
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
task: InstallCli,
|
|
82
|
+
title: `Adding ${(0, cli_utilities_1.Code)("electron-reactive-event-cli")} as a devDependency.`
|
|
83
|
+
}
|
|
84
|
+
], {
|
|
85
|
+
renderer: "default"
|
|
86
|
+
}).run();
|
|
87
|
+
const Format = (0, cli_utilities_1.MakeFormatter)({
|
|
88
|
+
"electron-reactive-event-cli": cli_utilities_1.Code,
|
|
89
|
+
setup: cli_utilities_1.Code
|
|
90
|
+
});
|
|
91
|
+
console.log(Format("Running the setup wizard of electron-reactive-event-cli..."));
|
|
92
|
+
await RunSetupWizard();
|
|
93
|
+
}
|
|
94
|
+
Main();
|
|
95
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../Source/index.ts"],"names":[],"mappings":";;AAEA;;;;GAIG;;AAEH,mBAAmB;AACnB,wCAAwC;AAExC,iDAAyD;AACzD,0DAA6E;AAC7E,mCAA4E;AAC5E,2BAAoC;AACpC,kDAA6D;AAC7D,+BAA+B;AAE/B,KAAK,UAAU,+BAA+B;IAE1C,OAAO,MAAM,IAAI,OAAO,CAAU,CAAC,OAAmC,EAAE,EAAE;QAEtE,MAAM,OAAO,GAAW,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC;QAEzE,MAAM,YAAY,GAAiB,IAAA,qBAAK,EACpC,OAAO,EACP;YACI,SAAS;YACT,YAAY;YACZ,6BAA6B;SAChC,EACD;YACI,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,QAAQ;SAClB,CACJ,CAAC;QAE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E,CAAC;QACxD,MAAM,eAAe,GAAW,IAAA,cAAO,EAAC,OAAO,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;QAC/E,MAAM,kBAAkB,GACpB,MAAM,aAAE,CAAC,QAAQ,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;QAE9D,MAAM,WAAW,GAAY,IAAI,CAAC,KAAK,CAAC,kBAAkB,CAAiB,CAAC,IAAI,CAAC;QACjF,IAAI,CAAC,KAAK,GAAG,2BAA2B,WAAW,GAAG,CAAC;IAC3D,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,KAAK,IAAmB,EAAE;QAEzC,MAAM,OAAO,GAAY,MAAM,+BAA+B,EAAE,CAAC;QACjE,IAAI,CAAC,OAAO,EACZ,CAAC;YACG,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;QAClF,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,IAAI,cAAK,CAAC;QACZ;YACI,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,2DAA2D;SACrE;QACD;YACI,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,UAAW,IAAA,oBAAI,EAAC,6BAA6B,CAAE,sBAAsB;SAC/E;KACJ,EACD;QACI,QAAQ,EAAE,SAAS;KACtB,CAAC,CAAC,GAAG,EAAE,CAAC;IAET,MAAM,MAAM,GAAc,IAAA,6BAAa,EAAC;QACpC,6BAA6B,EAAE,oBAAI;QACnC,KAAK,EAAE,oBAAI;KACd,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,4DAA4D,CAAC,CAAC,CAAC;IAElF,MAAM,cAAc,EAAE,CAAC;AAC3B,CAAC;AAED,IAAI,EAAE,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-electron-reactive-event",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "The init package for using electron-reactive-event-cli.",
|
|
5
|
+
"bin": "./Distribution/index.js",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"electron-reactive-event",
|
|
8
|
+
"electron",
|
|
9
|
+
"init",
|
|
10
|
+
"create",
|
|
11
|
+
"react",
|
|
12
|
+
"reactive",
|
|
13
|
+
"event",
|
|
14
|
+
"typescript",
|
|
15
|
+
"ts",
|
|
16
|
+
"type-safety",
|
|
17
|
+
"type-safe",
|
|
18
|
+
"cli",
|
|
19
|
+
"electron-reactive-event-cli"
|
|
20
|
+
],
|
|
21
|
+
"homepage": "https://github.com/GageSorrell/SorrellWm#readme",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/GageSorrell/SorrellWm/issues"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "git+https://github.com/GageSorrell/SorrellWm.git"
|
|
28
|
+
},
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"author": "Gage Sorrell <gage@sorrell.sh>",
|
|
31
|
+
"type": "commonjs",
|
|
32
|
+
"main": "./Distribution/index.js",
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsc -p ./tsconfig.json",
|
|
35
|
+
"bin": "node ./Distribution/index.js"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@types/node": "^25.6.0",
|
|
39
|
+
"typescript": "^6.0.2"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@listr2/prompt-adapter-enquirer": "^4.2.1",
|
|
43
|
+
"@sorrell/cli-utilities": "^1.0.27",
|
|
44
|
+
"@sorrell/utilities": "^1.1.8",
|
|
45
|
+
"listr2": "^10.2.1"
|
|
46
|
+
}
|
|
47
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions":
|
|
3
|
+
{
|
|
4
|
+
"target": "ES2023",
|
|
5
|
+
"module": "NodeNext",
|
|
6
|
+
"moduleResolution": "NodeNext",
|
|
7
|
+
|
|
8
|
+
"rootDir": "./Source",
|
|
9
|
+
"outDir": "./Distribution",
|
|
10
|
+
|
|
11
|
+
"types": [ "node" ],
|
|
12
|
+
|
|
13
|
+
"lib":
|
|
14
|
+
[
|
|
15
|
+
"ES2023",
|
|
16
|
+
"DOM",
|
|
17
|
+
"DOM.Iterable"
|
|
18
|
+
],
|
|
19
|
+
|
|
20
|
+
"jsx": "react-jsx",
|
|
21
|
+
|
|
22
|
+
"declaration": true,
|
|
23
|
+
"declarationMap": true,
|
|
24
|
+
"sourceMap": true,
|
|
25
|
+
|
|
26
|
+
"strict": true,
|
|
27
|
+
"isolatedModules": true,
|
|
28
|
+
|
|
29
|
+
"noUncheckedIndexedAccess": true,
|
|
30
|
+
"exactOptionalPropertyTypes": true,
|
|
31
|
+
"noImplicitOverride": true,
|
|
32
|
+
"useUnknownInCatchVariables": true,
|
|
33
|
+
|
|
34
|
+
"skipLibCheck": true,
|
|
35
|
+
"noEmitOnError": true
|
|
36
|
+
},
|
|
37
|
+
"include": [ "Source/**/*" ],
|
|
38
|
+
"exclude":
|
|
39
|
+
[
|
|
40
|
+
"Distribution",
|
|
41
|
+
"node_modules"
|
|
42
|
+
]
|
|
43
|
+
}
|