Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s0 #4964

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open

s0 #4964

Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b458c23
all
rubenfiszel Dec 10, 2024
4f134d5
Merge branch 'main' into rf/sandpack
rubenfiszel Dec 10, 2024
e8354b7
all
rubenfiszel Dec 10, 2024
980a44f
Merge branch 'main' into rf/sandpack
rubenfiszel Dec 10, 2024
736262e
all
rubenfiszel Dec 10, 2024
1ed99d9
all
rubenfiszel Dec 11, 2024
1e11a9d
all
rubenfiszel Dec 11, 2024
543f6f9
Merge branch 'main' into rf/sandpack
rubenfiszel Dec 12, 2024
42d2b06
all
rubenfiszel Dec 12, 2024
0fdf730
all
rubenfiszel Dec 13, 2024
ef2a333
Merge branch 'main' into rf/sandpack
rubenfiszel Dec 13, 2024
2749932
all
rubenfiszel Dec 14, 2024
9b23293
all
rubenfiszel Dec 14, 2024
16b7636
Merge branch 'main' into rf/sandpack
rubenfiszel Dec 14, 2024
f0185d3
Merge branch 'main' into rf/sandpack
rubenfiszel Dec 16, 2024
331d26d
all
rubenfiszel Dec 17, 2024
4b70b11
Merge branch 'main' into rf/sandpack
rubenfiszel Dec 17, 2024
97513de
all
rubenfiszel Dec 17, 2024
23388cc
all
rubenfiszel Dec 18, 2024
172a69b
all
rubenfiszel Dec 19, 2024
dd9de78
Merge branch 'main' into rf/sandpack
rubenfiszel Dec 19, 2024
b459f77
all
rubenfiszel Dec 20, 2024
7ac93eb
Merge branch 'main' into rf/sandpack
rubenfiszel Dec 20, 2024
f8e31c2
all
rubenfiszel Dec 20, 2024
3ec7bda
all
rubenfiszel Dec 20, 2024
3e3271d
all
rubenfiszel Dec 20, 2024
8a9736d
merge
rubenfiszel Dec 20, 2024
b4171be
avoid localsettings
rubenfiszel Dec 21, 2024
b0f2626
all
rubenfiszel Dec 25, 2024
6387245
all
rubenfiszel Dec 25, 2024
334a62e
merge
rubenfiszel Dec 25, 2024
a424edf
before esbuild refactor
rubenfiszel Jan 3, 2025
10b850a
before esbuild refactor
rubenfiszel Jan 3, 2025
ec9e44e
before esbuild
rubenfiszel Jan 4, 2025
b0c10c6
progress
rubenfiszel Jan 5, 2025
b02412e
progress
rubenfiszel Jan 5, 2025
f3d1c77
prevscode editor
rubenfiszel Jan 6, 2025
ea0d0f7
all
rubenfiszel Jan 8, 2025
410e03f
all
rubenfiszel Jan 8, 2025
1bba278
Merge branch 'main' into rf/sandpack
rubenfiszel Jan 8, 2025
a18edd3
all
rubenfiszel Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion backend/parsers/windmill-parser-ts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ impl Visit for ImportsFinder {
pub fn parse_expr_for_imports(code: &str) -> anyhow::Result<Vec<String>> {
let cm: Lrc<SourceMap> = Default::default();
let fm = cm.new_source_file(FileName::Custom("main.d.ts".into()).into(), code.into());
let mut tss = TsSyntax::default();
tss.disallow_ambiguous_jsx_like;
tss.tsx = true;
tss.no_early_errors = true;
let lexer = Lexer::new(
Syntax::Typescript(TsSyntax::default()),
Syntax::Typescript(tss),
// EsVersion defaults to es5
Default::default(),
StringInput::from(&*fm),
Expand Down
91 changes: 85 additions & 6 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@floating-ui/core": "^1.3.1",
"@hey-api/openapi-ts": "^0.43.0",
"@playwright/test": "^1.34.3",
"@codesandbox/sandpack-client": "^2.19.8",
"@rgossiaux/svelte-headlessui": "^2.0.0",
"@sveltejs/adapter-static": "^3.0.6",
"@sveltejs/kit": "^2.9.0",
Expand Down Expand Up @@ -148,7 +149,7 @@
"windmill-parser-wasm-py": "^1.429.0",
"windmill-parser-wasm-regex": "^1.435.2",
"windmill-parser-wasm-rust": "^1.429.0",
"windmill-parser-wasm-ts": "^1.429.0",
"windmill-parser-wasm-ts": "^1.438.2",
"windmill-parser-wasm-yaml": "^1.429.0",
"windmill-sql-datatype-parser-wasm": "^1.318.0",
"y-monaco": "^0.1.4",
Expand Down
67 changes: 41 additions & 26 deletions frontend/src/lib/ata/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,30 @@ export interface ATABootstrapConfig {

type ModuleMeta = { state: 'loading' }

export type DepsToGet = {
raw: string
module: string
version: string | undefined
}[]

function getVersionFromRaw(d: string) {
if (d.lastIndexOf('@') > 0) {
const splitted = d.split('@')
let version = splitted.pop()
if (version?.startsWith('^') || version?.startsWith('~')) {
version = version.slice(1)
}
return version
}
return 'latest'
}

export function versionRangeToVersion(version: string) {
if (version.startsWith('^') || version.startsWith('~')) {
return version.slice(1)
}
return version
}
/**
* The function which starts up type acquisition,
* returns a function which you then pass the initial
Expand All @@ -57,11 +81,11 @@ export const setupTypeAcquisition = (config: ATABootstrapConfig) => {

let resLimit = { usage: 0 }

return async (initialSourceFile: string) => {
return async (initialSourceFile: string | DepsToGet) => {
estimatedToDownload = 0
estimatedDownloaded = 0

let todo: string[] = [initialSourceFile]
let todo: (string | DepsToGet)[] = [initialSourceFile]
let next: string[] = []
let i = 0
let nb = 0
Expand All @@ -84,34 +108,25 @@ export const setupTypeAcquisition = (config: ATABootstrapConfig) => {
}
}

function getVersion(d: string) {
if (d.lastIndexOf('@') > 0) {
const splitted = d.split('@')
let version = splitted.pop()
if (version?.startsWith('^') || version?.startsWith('~')) {
version = version.slice(1)
}
return version
}
return 'latest'
}

async function resolveDeps(
initialSourceFile: string,
depsSource: string | DepsToGet,
depth: number,
resLimit: ResLimit
): Promise<string[]> {
let depsToGet = config
.depsParser(initialSourceFile)
.map((d: string) => {
let raw = mapModuleNameToModule(d)
return {
raw,
module: raw.lastIndexOf('@') > 0 ? raw.split('@').slice(0, -1).join('@') : raw,
version: getVersion(d)
}
})
.filter((f) => !moduleMap.has(f.raw))
let depsToGet =
typeof depsSource == 'object'
? depsSource
: config
.depsParser(depsSource)
.map((d: string) => {
let raw = mapModuleNameToModule(d)
return {
raw,
module: raw.lastIndexOf('@') > 0 ? raw.split('@').slice(0, -1).join('@') : raw,
version: getVersionFromRaw(raw)
}
})
.filter((f) => !moduleMap.has(f.raw))

if (depth == 0) {
const relativeDeps = depsToGet.filter((f) => isTypescriptRelativePath(f.raw))
Expand Down
Loading
Loading