Skip to content

Commit

Permalink
Support Run In Replit
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown committed Jan 22, 2023
1 parent 641192c commit 07e5525
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

run = "nix-shell build.nix"
entrypoint = "index.js"

language = "nodejs"

[nix]
channel="stable-21_11"

[packager]
language = "nodejs"

[packager.features]
packageSearch = true
guessImports = true

[languages.nodejs]
pattern = "**/*.js"
syntax = "nodejs"

[languages.nodejs.languageServer]
start = [ "typescript-language-server", "--stdio" ]
18 changes: 18 additions & 0 deletions build.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# DO NOT CHANGE THIS FILE

with import <nixpkgs> { };
stdenv.mkDerivation {
name = "env";
nativeBuildInputs = [ pkg-config ];
buildInputs = [
libpng
libjpeg
libuuid
];

shellHook = ''
LD=$CC
nix-shell run.nix
'';
}
10 changes: 10 additions & 0 deletions replit.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{ pkgs }: {
deps = with pkgs; [
nodejs-16_x
nodePackages.typescript-language-server
nodePackages.node-pre-gyp
libpng
libjpeg
libuuid
];
}
17 changes: 17 additions & 0 deletions run.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# DO NOT CHANGE THIS FILE

{ pkgs ? import <nixpkgs> { } }:
with pkgs; mkShell {
name = "node-dev-shell";

APPEND_LIBRARY_PATH = "${lib.makeLibraryPath [ libGL libuuid ]}";
shellHook = ''
export LD_LIBRARY_PATH="$APPEND_LIBRARY_PATH:$LD_LIBRARY_PATH"
npm i
npm start
'';

# Replace 'npm run-script run' with your run command.

}

0 comments on commit 07e5525

Please sign in to comment.