Starting to thing about package management
This commit is contained in:
parent
8a1465b924
commit
a641af7510
|
@ -11,6 +11,12 @@ export interface LangConfig {
|
||||||
createEmpty?: string;
|
createEmpty?: string;
|
||||||
compile?: string;
|
compile?: string;
|
||||||
run: string;
|
run: string;
|
||||||
|
pkg?: {
|
||||||
|
install: string;
|
||||||
|
uninstall?: string;
|
||||||
|
all?: string;
|
||||||
|
search?: string;
|
||||||
|
};
|
||||||
lspSetup?: string;
|
lspSetup?: string;
|
||||||
lsp?: string;
|
lsp?: string;
|
||||||
lspDisableDynamicRegistration?: boolean;
|
lspDisableDynamicRegistration?: boolean;
|
||||||
|
@ -19,6 +25,9 @@ export interface LangConfig {
|
||||||
lspLang?: string;
|
lspLang?: string;
|
||||||
template: string;
|
template: string;
|
||||||
hacks?: "ghci-config"[];
|
hacks?: "ghci-config"[];
|
||||||
|
test?: {
|
||||||
|
ensure?: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export const langs: { [key: string]: LangConfig } = {
|
export const langs: { [key: string]: LangConfig } = {
|
||||||
|
@ -395,9 +404,14 @@ output = "Hello, world!"
|
||||||
aliases: ["emacslisp", "elisp", "gnuemacs", "xemacs", "ielm"],
|
aliases: ["emacslisp", "elisp", "gnuemacs", "xemacs", "ielm"],
|
||||||
name: "Emacs Lisp",
|
name: "Emacs Lisp",
|
||||||
monacoLang: "plaintext",
|
monacoLang: "plaintext",
|
||||||
repl: "emacs --eval '(ielm)'",
|
repl: `emacs --eval "(progn (require 'package) (push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) (package-initialize) (ielm))"`,
|
||||||
main: "main.el",
|
main: "main.el",
|
||||||
run: "emacs --load main.el --eval '(ielm)'",
|
run: `emacs --load main.el --eval "(progn (require 'package) (push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) (package-initialize) (ielm))"`,
|
||||||
|
pkg: {
|
||||||
|
install: `emacs -Q --batch --eval "(progn (require 'package) (push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) (package-initialize) (unless (ignore-errors (>= (length (directory-files \"~/.emacs.d/elpa/archives\")) 4)) (package-refresh-contents)) (package-install 'NAME))"`,
|
||||||
|
uninstall: `ls ~/.emacs.d/elpa | grep -- - | grep '^NAME-[0-9]' | while read pkg; do emacs -Q --batch --eval "(progn (require 'package) (push '(\"melpa\" . \"https://melpa.org/packages/\") package-archives) (package-initialize) (unless (ignore-errors (>= (length (directory-files \"~/.emacs.d/elpa/archives\")) 4)) (package-refresh-contents)) (call-interactively 'package-delete))" <<< "$pkg"; done`,
|
||||||
|
all: `set -o pipefail; (curl -sS https://elpa.gnu.org/packages/ | grep '<td>' | grep -Eo '[^>]+</a>' | grep -Eo '^[^<]+' && curl -sS https://melpa.org/archive.json | jq -r 'keys | .[]') | sort | uniq`,
|
||||||
|
},
|
||||||
template: `(message "Hello, world!")
|
template: `(message "Hello, world!")
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
@ -797,6 +811,12 @@ message:
|
||||||
eval.apply(this, [require("fs").readFileSync("main.js", {encoding: "utf-8"})])
|
eval.apply(this, [require("fs").readFileSync("main.js", {encoding: "utf-8"})])
|
||||||
require("repl").start()
|
require("repl").start()
|
||||||
'`,
|
'`,
|
||||||
|
pkg: {
|
||||||
|
install: "yarn add NAME",
|
||||||
|
uninstall: "yarn remove NAME",
|
||||||
|
search:
|
||||||
|
"curl -sS 'https://registry.npmjs.org/-/v1/search?text=NAME' | jq -r '.objects | map(.package.name) | .[]'",
|
||||||
|
},
|
||||||
template: `console.log("Hello, world!")
|
template: `console.log("Hello, world!")
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
@ -946,6 +966,11 @@ main = do
|
||||||
repl: "python3 -u",
|
repl: "python3 -u",
|
||||||
main: "main.py",
|
main: "main.py",
|
||||||
run: "python3 -u -i main.py",
|
run: "python3 -u -i main.py",
|
||||||
|
pkg: {
|
||||||
|
install: "pip3 install --user NAME",
|
||||||
|
uninstall: "pip3 uninstall NAME",
|
||||||
|
search: `python3 -c 'import json; from xmlrpc import client; print(json.dumps(client.ServerProxy("https://pypi.org/pypi").search({"name": "NAME"})))' | jq -r 'map(.name) | .[]'`,
|
||||||
|
},
|
||||||
lsp: "Microsoft.Python.LanguageServer",
|
lsp: "Microsoft.Python.LanguageServer",
|
||||||
lspInit: {
|
lspInit: {
|
||||||
interpreter: {
|
interpreter: {
|
||||||
|
@ -1061,9 +1086,17 @@ binding_irb = IRB::Irb.new(workspace)
|
||||||
binding_irb.run(IRB.conf)
|
binding_irb.run(IRB.conf)
|
||||||
`,
|
`,
|
||||||
run: "ruby main.rb",
|
run: "ruby main.rb",
|
||||||
|
pkg: {
|
||||||
|
install: "gem install --user-install NAME",
|
||||||
|
uninstall: "gem uninstall --user-install NAME",
|
||||||
|
search: `curl -sS 'https://rubygems.org/api/v1/search.json?query=NAME' | jq -r 'map(.name) | .[]'`,
|
||||||
|
},
|
||||||
lsp: "solargraph stdio",
|
lsp: "solargraph stdio",
|
||||||
template: `puts "Hello, world!"
|
template: `puts "Hello, world!"
|
||||||
`,
|
`,
|
||||||
|
test: {
|
||||||
|
ensure: `ruby -e 'raise "version mismatch, expected #{RUBY_VERSION}" unless ENV["PATH"].include? ".gem/ruby/#{RUBY_VERSION}/bin"'`,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rust: {
|
rust: {
|
||||||
aliases: ["rs", "rustc"],
|
aliases: ["rs", "rustc"],
|
||||||
|
|
|
@ -19,12 +19,22 @@ export const rijuSystemPrivileged = appRoot.resolve(
|
||||||
|
|
||||||
export function getEnv(uuid: string) {
|
export function getEnv(uuid: string) {
|
||||||
const cwd = `/tmp/riju/${uuid}`;
|
const cwd = `/tmp/riju/${uuid}`;
|
||||||
|
const path = [
|
||||||
|
`${cwd}/.gem/ruby/2.7.0/bin`,
|
||||||
|
`${cwd}/.local/bin`,
|
||||||
|
`${cwd}/node_modules/.bin`,
|
||||||
|
`/usr/local/sbin`,
|
||||||
|
`/usr/local/bin`,
|
||||||
|
`/usr/sbin`,
|
||||||
|
`/usr/bin`,
|
||||||
|
`/bin`,
|
||||||
|
];
|
||||||
return {
|
return {
|
||||||
HOME: cwd,
|
HOME: cwd,
|
||||||
HOSTNAME: "riju",
|
HOSTNAME: "riju",
|
||||||
LANG: process.env.LANG || "",
|
LANG: process.env.LANG || "",
|
||||||
LC_ALL: process.env.LC_ALL || "",
|
LC_ALL: process.env.LC_ALL || "",
|
||||||
PATH: "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin",
|
PATH: path.join(":"),
|
||||||
PWD: cwd,
|
PWD: cwd,
|
||||||
SHELL: "/usr/bin/bash",
|
SHELL: "/usr/bin/bash",
|
||||||
TERM: "xterm-color",
|
TERM: "xterm-color",
|
||||||
|
|
|
@ -20,6 +20,7 @@ bsdmainutils
|
||||||
curl
|
curl
|
||||||
emacs-nox
|
emacs-nox
|
||||||
git
|
git
|
||||||
|
httpie
|
||||||
htop
|
htop
|
||||||
jq
|
jq
|
||||||
lsof
|
lsof
|
||||||
|
|
Loading…
Reference in New Issue