-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnodejs.win32.nexss.config.js
More file actions
108 lines (105 loc) · 3.29 KB
/
nodejs.win32.nexss.config.js
File metadata and controls
108 lines (105 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
let languageConfig = Object.assign(
{},
require(`../config.${process.platform}`)
);
languageConfig.title = "NodeJS";
languageConfig.description =
"Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.";
languageConfig.url = "https://nodejs.org";
languageConfig.founders = ["Ryan Dahl"];
languageConfig.developers = [
"https://github.com/nodejs/node/blob/master/AUTHORS",
];
languageConfig.years = ["2009"];
languageConfig.extensions = [".js", ".mjs"];
languageConfig.licenses = [
"MIT https://github.com/nodejs/node/blob/master/LICENSE",
];
languageConfig.editors = {
vscode: {
extensions: ["ms-vscode.node-debug2"],
},
}; // defined in \.nexss\languages\config.win32.js (copy from .nexssCli\nexss-language\languages\)
languageConfig.run = "node -e";
languageConfig.printCommandLine = "node -p"; //no console.log() needed to display result eg node -p "4+6"
languageConfig.checkSyntax = "node -c";
languageConfig.interactiveShell = "node";
languageConfig.builders = {
pkg: {
install: "npm install -g pkg",
command: "pkg",
//build: "pkg --output <destinationFile> --out-path <destinationPath> <file>",
build: "pkg",
args: "--target host --output <destinationFile> <file>",
help: ``,
},
};
languageConfig.compilers = {
node: {
install: "scoop install nodejs-lts",
command: "node",
args: "<file>",
help: ``,
},
bun: {
install: "scoop install bun",
command: "bun",
args: "run <file>",
help: ``,
},
deno: {
install: "scoop install deno",
command: "deno",
args: "run <file>",
help: ``,
templates: "templates_deno",
},
};
languageConfig.errors = require("./nexss.nodejs.errors");
languageConfig.languagePackageManagers = {
npm: {
installation: "installed.",
messageAfterInstallation: null, // sometimes there is need of add something to the files can be add here eg php for composer.
installed: "npm list",
search: "npm search",
install: "npm install",
uninstall: "npm remove",
help: "npm help",
version: "npm --version",
init: () => {
const { existsSync } = require("fs");
const { join } = require("path");
const { execSync } = require("child_process");
if (!existsSync(join(process.cwd(), "package.json"))) {
console.log("Setup npm project");
execSync("npm init -y");
console.log("Setup npm project: done.");
} else {
console.log("npm project already initialized.");
}
if (!existsSync(join(process.cwd(), ".gitignore"))) {
console.log("Creating .gitignore");
execSync("npx gitignore node"); // creates tsconfig.json with all the descriptions
} else {
console.log(".gitignore is already setup");
}
},
// if command not found in specification
// run directly on package manager
else: "npm",
},
yarn: {
installation: "scoop install yarn",
list: "yarn list",
search: "yarn search",
install: "yarn list",
uninstall: "yarn remove",
help: "yarn help",
version: "yarn help",
},
};
module.exports = languageConfig;
// console.log(languageConfig.get(`errors`));
// console.log(languageConfig.get("author"));
// console.log(Object.keys(languageConfig.get("osPackageManagers")));
// console.log(Object.keys(languageConfig.get("languagePackageManagers")));