From 9509e228acf8bb7c1f5e44a7741207e9c4d60975 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Wed, 23 Oct 2024 14:42:10 -0700 Subject: [PATCH 1/2] update build script to account for configuration files --- build.ps1 | 6 +-- configurations/windows/copy_files.txt | 2 + .../{ => windows}/windows_baseline.dsc.yaml | 0 .../{ => windows}/windows_inventory.dsc.yaml | 0 tree-sitter-dscexpression/package.json | 52 +++++++++++++++++++ 5 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 configurations/windows/copy_files.txt rename configurations/{ => windows}/windows_baseline.dsc.yaml (100%) rename configurations/{ => windows}/windows_inventory.dsc.yaml (100%) create mode 100644 tree-sitter-dscexpression/package.json diff --git a/build.ps1 b/build.ps1 index 5201bf11..09e848df 100644 --- a/build.ps1 +++ b/build.ps1 @@ -45,8 +45,8 @@ $filesForWindowsPackage = @( 'windowspowershell.dsc.resource.json', 'wmi.dsc.resource.json', 'wmi.resource.ps1', - 'configurations/windows_baseline.dsc.yaml', - 'configurations/windows_inventory.dsc.yaml' + 'windows_baseline.dsc.yaml', + 'windows_inventory.dsc.yaml' ) $filesForLinuxPackage = @( @@ -211,7 +211,7 @@ if (!$SkipBuild) { } # make sure dependencies are built first so clippy runs correctly - $windows_projects = @("pal", "registry", "reboot_pending", "wmi-adapter") + $windows_projects = @("pal", "registry", "reboot_pending", "wmi-adapter", "configurations/windows") $macOS_projects = @("resources/brew") $linux_projects = @("resources/apt") diff --git a/configurations/windows/copy_files.txt b/configurations/windows/copy_files.txt new file mode 100644 index 00000000..fd024cfb --- /dev/null +++ b/configurations/windows/copy_files.txt @@ -0,0 +1,2 @@ +windows_baseline.dsc.yaml +windows_inventory.dsc.yaml \ No newline at end of file diff --git a/configurations/windows_baseline.dsc.yaml b/configurations/windows/windows_baseline.dsc.yaml similarity index 100% rename from configurations/windows_baseline.dsc.yaml rename to configurations/windows/windows_baseline.dsc.yaml diff --git a/configurations/windows_inventory.dsc.yaml b/configurations/windows/windows_inventory.dsc.yaml similarity index 100% rename from configurations/windows_inventory.dsc.yaml rename to configurations/windows/windows_inventory.dsc.yaml diff --git a/tree-sitter-dscexpression/package.json b/tree-sitter-dscexpression/package.json new file mode 100644 index 00000000..b4b41da7 --- /dev/null +++ b/tree-sitter-dscexpression/package.json @@ -0,0 +1,52 @@ +{ + "name": "tree-sitter-dscexpression", + "version": "1.0.0", + "description": "Dscexpression grammar for tree-sitter", + "repository": "github:tree-sitter/tree-sitter-dscexpression", + "license": "MIT", + "main": "bindings/node", + "types": "bindings/node", + "keywords": [ + "incremental", + "parsing", + "tree-sitter", + "dscexpression" + ], + "files": [ + "grammar.js", + "binding.gyp", + "prebuilds/**", + "bindings/node/*", + "queries/*", + "src/**", + "*.wasm" + ], + "dependencies": { + "node-addon-api": "^8.1.0", + "node-gyp-build": "^4.8.2" + }, + "devDependencies": { + "prebuildify": "^6.0.1", + "tree-sitter-cli": "^0.24.3" + }, + "peerDependencies": { + "tree-sitter": "^0.21.1" + }, + "peerDependenciesMeta": { + "tree-sitter": { + "optional": true + } + }, + "scripts": { + "install": "node-gyp-build", + "prestart": "tree-sitter build --wasm", + "start": "tree-sitter playground", + "test": "node --test bindings/node/*_test.js" + }, + "tree-sitter": [ + { + "scope": "source.dscexpression", + "injection-regex": "^dscexpression$" + } + ] +} From e35d416026b5b84c70ec58fab102aac63b2f1e19 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Wed, 23 Oct 2024 15:07:45 -0700 Subject: [PATCH 2/2] fix path --- wmi-adapter/Tests/wmi.tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wmi-adapter/Tests/wmi.tests.ps1 b/wmi-adapter/Tests/wmi.tests.ps1 index 6ad3971a..b0cea8f7 100644 --- a/wmi-adapter/Tests/wmi.tests.ps1 +++ b/wmi-adapter/Tests/wmi.tests.ps1 @@ -47,7 +47,7 @@ Describe 'WMI adapter resource tests' { } It 'Example config works' -Skip:(!$IsWindows) { - $configPath = Join-Path $PSScriptRoot '..\..\configurations\windows_inventory.dsc.yaml' + $configPath = Join-Path $PSScriptRoot '..\..\configurations\windows\windows_inventory.dsc.yaml' $r = dsc config get -p $configPath $LASTEXITCODE | Should -Be 0 $r | Should -Not -BeNullOrEmpty