Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgarciab authored Jul 18, 2023
2 parents ba6291a + b1a9ae7 commit 3135b92
Show file tree
Hide file tree
Showing 17 changed files with 1,937 additions and 49 deletions.
588 changes: 576 additions & 12 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"packages": ["build/packages/*", "build/packages/nx/native-packages/*"],
"version": "16.6.0-beta.3",
"version": "16.6.0-beta.4",
"granularPathspec": false,
"command": {
"publish": {
Expand Down
7 changes: 7 additions & 0 deletions packages/nx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +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.16"
swc_ecma_parser = { version = "0.137.1", features = ["typescript"] }
swc_ecma_visit = "0.93.0"
swc_ecma_ast = "0.107.0"

[lib]
crate-type = ['cdylib']

Expand All @@ -35,3 +40,5 @@ napi-build = '2.0.1'

[dev-dependencies]
assert_fs = "1.0.10"
# This is only used for unit tests
swc_ecma_dep_graph = "0.109.1"
1 change: 1 addition & 0 deletions packages/nx/src/adapter/angular-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export function shouldMergeAngularProjects(

export function isAngularPluginInstalled() {
try {
// nx-ignore-next-line
require.resolve('@nx/angular');
return true;
} catch {
Expand Down
7 changes: 7 additions & 0 deletions packages/nx/src/native/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export function hashArray(input: Array<string>): string
export function hashFile(file: string): FileData | null
export function hashFiles(workspaceRoot: string): Record<string, string>
export function hashFilesMatchingGlobs(directory: string, globPatterns: Array<string>): string | null
export function findImports(projectFileMap: Record<string, Array<string>>): Array<ImportResult>
export interface FileData {
file: string
hash: string
Expand Down Expand Up @@ -44,6 +45,12 @@ export interface NxWorkspaceFiles {
projectConfigurations: Record<string, object>
}
export function getWorkspaceFilesNative(workspaceRoot: string, globs: Array<string>, parseConfigurations: (arg0: Array<string>) => Record<string, object>): NxWorkspaceFiles
export class ImportResult {
file: string
sourceProject: string
dynamicImportExpressions: Array<string>
staticImportExpressions: Array<string>
}
export class Watcher {
origin: string
/**
Expand Down
4 changes: 3 additions & 1 deletion packages/nx/src/native/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ if (!nativeBinding) {
throw new Error(`Failed to load native binding`)
}

const { expandOutputs, remove, copy, hashArray, hashFile, hashFiles, hashFilesMatchingGlobs, EventType, Watcher, WorkspaceErrors, getProjectConfigurations, getWorkspaceFilesNative } = nativeBinding
const { expandOutputs, remove, copy, hashArray, hashFile, hashFiles, hashFilesMatchingGlobs, ImportResult, findImports, EventType, Watcher, WorkspaceErrors, getProjectConfigurations, getWorkspaceFilesNative } = nativeBinding

module.exports.expandOutputs = expandOutputs
module.exports.remove = remove
Expand All @@ -255,6 +255,8 @@ module.exports.hashArray = hashArray
module.exports.hashFile = hashFile
module.exports.hashFiles = hashFiles
module.exports.hashFilesMatchingGlobs = hashFilesMatchingGlobs
module.exports.ImportResult = ImportResult
module.exports.findImports = findImports
module.exports.EventType = EventType
module.exports.Watcher = Watcher
module.exports.WorkspaceErrors = WorkspaceErrors
Expand Down
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
1 change: 1 addition & 0 deletions packages/nx/src/native/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
pub mod cache;
pub mod hasher;
mod logger;
pub mod plugins;
mod types;
mod utils;
mod walker;
Expand Down
1 change: 1 addition & 0 deletions packages/nx/src/native/plugins/js.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod ts_import_locators;
Loading

0 comments on commit 3135b92

Please sign in to comment.