Files
windmill/cli/test.nu
T
pyranota a3faea16e7 feat: add nu-lang support (#5217)
* feat: add nu (nushell) support

* add worker tests

* deactivate tables and non-any types below top-level

full support will come in V1
for V0 it's better to keep things minimal and simple

* add syntax highlighting

used python's grammar, since nushell isn't supported by monaco nor svelte-highlights

for V1 nu will get it`s own grammar

* add logo

* partially implement plugin support

* change logo + ability to deploy + nsjail draft

* static variables + get_resource + get_variable

* lsp/dev.nu + initial nu lsp (not working yet)

* make it work with nsjail

* nullguard

* Much more flexible signature parsing and better error-messages

* add init script

* rename nulsp to nu

* install nu to dockerfile

* fix merge

* implement Default for MainArgSignature

* stage NU_CACHE_DIR

* improve dockerfiles

* dev.nu for parser-wasm + flake.nix

* update code for windows

* add nushell to flake

* upload Cargo.lock

* make build.sh work on nixos

* build wasm cli parsers

* add docs to README_DEV.md

* add helper script docker/dev.nu

* improve docker/dev.nu

* fix windows

* commit frontend/package(lock).json

* update cargo.lock

* correctly update cargo.lock

* remove lsp

* update flake.nix to include svelte server and nushell

* Revert base.sql to main

* remove PLUGIN_USE_RE

* make CARGO_PATH private

* add nu to cli

* Change flags to build wasm-nu-parser

* remove flake.nix from parser-wasm

* update wasm-build target

* remove unused import

* add cli support for nu

* update github workflows

* wasm-build 0.17 -> 0.19

* update build script

* update cargo.lock

* Fix typographical error

* update Cargo.lock

* update ENV_SETTINGS

* use published nu parser

* update package.lock

* rewrite parser in tree-sitter

* implement parser from scratch

* polishing

* change init script to match new parser

* fix imports

* fix cli build

* fix cli build

* merge

* update wasm

* use MiniPulledJob

* update cli

* change cli wasm schema

* change cli

* update deno.json

* make wasm modules load lazily

* regenerate parsers

* remove leftover

* update cargo.lock

* clean up dnt.ts

* add docs to cli/test.nu

* add schema validation option

* add Nu to try_validate_schema

* reference frontend to new parser version
2025-03-20 16:45:21 +01:00

89 lines
1.7 KiB
Nu
Executable File

#!/usr/bin/env nu
# NOTE: Not polished yet
# This script supposed to test wasm parsers in cli
# Currently you would need to create local dir in repo root (it is ignored by git)
# In there init windmill workspace
#
# Start instance with languages features on
# Invoke this script from local: ../cli/test.nu test deno
const languages = [
"python3",
"nativets",
"bun",
"deno",
"go",
"mysql",
"bigquery",
"oracledb",
"snowflake",
"mssql",
"postgresql",
"graphql",
"bash",
"powershell",
# "php",
"rust",
"csharp",
"nu",
"ansible",
];
def main [] {
main test deno;
main build;
main test node;
}
def 'main test deno' [] {
main clean;
$languages | each { |l|
print $"+ ($l)"
deno run -A ../cli/main.ts script bootstrap $"f/tests/(random uuid)" $l
}
deno run -A ../cli/main.ts script generate-metadata
}
def 'main test node' [] {
# TODO: Use node
main clean;
$languages | each { |l|
print $"+ ($l)"
node ../cli/npm/esm/main.js script bootstrap $"f/tests/(random uuid)" $l
}
node ../cli/npm/esm/main.js script generate-metadata
}
def 'main clean' [] {
rm -rf f/tests/*
}
def 'main build' [] {
../cli/build.sh
}
# def main [] {
# main clean;
# $languages | each { |l|
# print $"+ ($l)"
# # deno run -A ../cli/main.ts script bootstrap $"f/tests/(random uuid)" $l
# #
# let cmd = r#'
# import { inferSchema } from '../cli/metadata.ts';
# await inferSchema("LANG", "", undefined, "f/tests/NAME)")
# '#
# | str replace "LANG" $l
# | str replace "NAME" (random uuid);
# deno eval $cmd
# }
# # deno run -A ../cli/main.ts script generate-metadata
# }
# def 'main clean' [] {
# rm -rf f/tests/*
# }