-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes issue #6
- Loading branch information
Showing
13 changed files
with
229 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
hidden=[".config", ".gitignore", ".github", "node_modules", "pnpm-lock.yaml", "tsconfig.json", "tsconfig.node.json", "vite.config.ts"] | ||
|
||
# onBoot=['echo', '$PATH'] # ⚠ node is not in env, yet | ||
# onBoot=['echo', 'rebooted..'] # Runs on reboot, very limited ENV vars | ||
# compile="npm i" # No runtime ENV vars | ||
# run = ["npm", "run", "dev"] # Use TOML's """ for a multiline bash script | ||
run = """ | ||
echo NodeJS Version: $(node --version) "\n" | ||
pnpm run dev | ||
bash --norc | ||
""" # " | ||
|
||
compile = """ | ||
pnpm i | ||
""" | ||
|
||
entrypoint = ".replit" | ||
|
||
[[ports]] | ||
localPort = 5101 | ||
remotePort = 80 | ||
|
||
[nix] | ||
channel = "stable-22_11" | ||
|
||
[env] | ||
PATH = "/home/runner/$REPL_SLUG/.config/npm/node_global/bin:/home/runner/$REPL_SLUG/node_modules/.bin:./node_modules/.bin:/home/runner/$REPL_SLUG/.config/pnpm" | ||
npm_config_prefix = "/home/runner/$REPL_SLUG/.config/npm/node_global" # Global install support | ||
npm_config_yes="true" # This is a safe space, don't ask stupid questions | ||
PNPM_HOME = "/home/runner/$REPL_SLUG/.config/pnpm" | ||
VITE_HOST = "0.0.0.0" | ||
# NODE_OPTIONS="--max_old_space_size=384" | ||
# EDITOR="replit-git-editor" # Not reliable, use curl replspace instead | ||
#NODE_NO_WARNINGS="1" | ||
|
||
# Helper for Replit's git importer | ||
[gitHubImport] | ||
requiredFiles = ["package.json", "tsconfig.json", "pnpm-lock.yaml"] | ||
|
||
# Disables UPM, which BREAKS with PNPM, NPM v9, PNPM/Turbo/Yarn/Deno/Bun etc | ||
[packager] | ||
language = "no" # nodejs-npm / nodejs-yarn | ||
ignoredPaths = ["."] # disables guessImports | ||
|
||
[languages.typescript] | ||
pattern = "**/{*.ts,*.js,*.tsx,*.jsx}" | ||
syntax = "typescript" | ||
|
||
[languages.typescript.languageServer] | ||
start = [ "typescript-language-server", "--stdio" ] | ||
|
||
# CWD is not supported | ||
# As a workaround, use Node 19 with --import and a helper script that CD's to a directory based on env vars | ||
[debugger] | ||
support = true | ||
|
||
[debugger.interactive] | ||
transport = "localhost:0" | ||
startCommand = [ "dap-node" ] | ||
|
||
[debugger.interactive.initializeMessage] | ||
command = "initialize" | ||
type = "request" | ||
|
||
[debugger.interactive.initializeMessage.arguments] | ||
clientID = "replit" | ||
clientName = "replit.com" | ||
columnsStartAt1 = true | ||
linesStartAt1 = true | ||
locale = "en-us" | ||
pathFormat = "path" | ||
supportsInvalidatedEvent = true | ||
supportsProgressReporting = true | ||
supportsRunInTerminalRequest = true | ||
supportsVariablePaging = true | ||
supportsVariableType = true | ||
|
||
[debugger.interactive.launchMessage] | ||
command = "launch" | ||
type = "request" | ||
|
||
[debugger.interactive.launchMessage.arguments] | ||
runtimeArgs = ["--loader", "ts-node/esm/transpile-only"] | ||
args = [] | ||
console = "externalTerminal" | ||
cwd = "." # Broken | ||
environment = [] # Broken | ||
pauseForSourceMap = false | ||
program = "index.ts" | ||
request = "launch" | ||
sourceMaps = true | ||
stopOnEntry = false | ||
type = "pwa-node" | ||
|
||
[debugger.interactive.launchMessage.arguments.env] | ||
IS_RAY_AWESOME = "yes" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ pkgs }: { deps = with pkgs; [ | ||
less | ||
bashInteractive | ||
nodejs-18_x | ||
nodePackages.typescript-language-server # Add nodePackages.typescript if not in node_modules | ||
nodePackages.pnpm # Best of YARN 2, but as easy to run as NPM | ||
]; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// https://gist.github.com/ca0v/73a31f57b397606c9813472f7493a940 | ||
export function debounce<T extends Function>(cb: T, wait = 150) { | ||
let h: NodeJS.Timeout; | ||
let callable = (...args: any) => { | ||
clearTimeout(h); | ||
h = setTimeout(() => cb(...args), wait); | ||
}; | ||
return <T>(<any>callable); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Isomorphic minimal debug package compatible with npm:debug | ||
// TODO: Vite uses picomatch... we could borrow it | ||
export const NS = 'vslite' | ||
const CONFIG = globalThis.localStorage?.debug ? | ||
globalThis.localStorage?.debug : | ||
globalThis.process?.env.DEBUG || '' | ||
const isEnabled = CONFIG.split(',').find((m: string) => m.startsWith(NS) || m === '*') | ||
|
||
const Debug = (name: string) => { | ||
const prefix = `[${NS}/${name}]` | ||
const debug = (...all: any) => { | ||
if (isEnabled) { | ||
console.debug(prefix, ...all) | ||
} | ||
} | ||
return debug | ||
} | ||
|
||
export default Debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.