Skip to content

Commit

Permalink
feat(core): switch to using a parser for imports
Browse files Browse the repository at this point in the history
  • Loading branch information
FrozenPandaz committed Jul 14, 2023
1 parent d165196 commit 9f27c9c
Show file tree
Hide file tree
Showing 9 changed files with 1,151 additions and 167 deletions.
63 changes: 33 additions & 30 deletions Cargo.lock

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

9 changes: 5 additions & 4 deletions packages/nx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ watchexec-filterer-ignore = "1.2.1"
watchexec-signals = "1.0.0"
xxhash-rust = { version = '0.8.5', features = ['xxh3', 'xxh64'] }

swc_common = "0.31.12"
swc_ecma_parser = { version = "0.136.0", features = ["typescript"] }
swc_ecma_visit = "0.92.0"
swc_ecma_ast = "0.106.0"
swc_common = "0.31.16"
swc_ecma_parser = { version = "0.137.1", features = ["typescript"] }
swc_ecma_visit = "0.93.0"
swc_ecma_ast = "0.107.0"
swc_ecma_dep_graph = "0.109.1"

[lib]
crate-type = ['cdylib']
Expand Down
6 changes: 4 additions & 2 deletions packages/nx/src/native/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface NxWorkspaceFiles {
projectConfigurations: Record<string, object>
}
export function getWorkspaceFilesNative(workspaceRoot: string, globs: Array<string>, parseConfigurations: (arg0: Array<string>) => Record<string, object>): NxWorkspaceFiles
export function findImports(filePaths: Array<string>, callback: (obj: null, result: {file: string, importExpr: string}) => void): void
export function findImports(projectFileMap: Record<string, Array<string>>): Array<ImportResult>
export class Watcher {
origin: string
/**
Expand All @@ -57,5 +57,7 @@ export class Watcher {
}
export class ImportResult {
file: string
importExpr: string
sourceProject: string
dynamicImportExpressions: Array<string>
staticImportExpressions: Array<string>
}
2 changes: 1 addition & 1 deletion packages/nx/src/native/logger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ where

pub(crate) fn enable_logger() {
let env_filter =
EnvFilter::try_from_env("NX_NATIVE_LOGGING").unwrap_or_else(|_| EnvFilter::new("INFO"));
EnvFilter::try_from_env("NX_NATIVE_LOGGING").unwrap_or_else(|_| EnvFilter::new("ERROR"));
_ = tracing_subscriber::fmt()
.with_env_filter(env_filter)
.event_format(NxLogFormatter)
Expand Down
Loading

0 comments on commit 9f27c9c

Please sign in to comment.