Skip to content

Commit f238679

Browse files
committed
Merge remote-tracking branch 'origin/dev' into issue/LMBQ-555
2 parents da138c5 + 75e1759 commit f238679

File tree

21 files changed

+6932
-6062
lines changed

21 files changed

+6932
-6062
lines changed

.github/actions/lint/action.yml

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,40 +31,57 @@ inputs:
3131
runs:
3232
using: composite
3333
steps:
34-
- name: Setup NodeJs Extensions
34+
- name: Set up Environment
35+
id: set-up-environment
3536
shell: pwsh
3637
run: |
3738
'${{ github.action_path }}' >> $Env:GITHUB_PATH
3839
39-
$LombiqNodeJsExtensions = $(Resolve-Path '${{ github.action_path }}/../../../Lombiq.NodeJs.Extensions').Path
40-
Write-Output "LOMBIQ_NODEJS_EXTENSIONS=$LombiqNodeJsExtensions"
41-
"LOMBIQ_NODEJS_EXTENSIONS=$LombiqNodeJsExtensions" >> $Env:GITHUB_ENV
40+
$nodeJsExtensionsPath = $(Resolve-Path '${{ github.action_path }}/../../../Lombiq.NodeJs.Extensions').Path
41+
Write-Output "LOMBIQ_NODEJS_EXTENSIONS=$nodeJsExtensionsPath"
42+
"LOMBIQ_NODEJS_EXTENSIONS=$nodeJsExtensionsPath" >> $Env:GITHUB_ENV
4243
"LOMBIQ_NODEJS_EXTENSIONS_GITHUB_ACTIONS=true" >> $Env:GITHUB_ENV
4344
"LOMBIQ_NODEJS_EXTENSIONS_GITHUB_ACTIONS_ROOT=$PWD" >> $Env:GITHUB_ENV
4445
"LOMBIQ_NODEJS_EXTENSIONS_WARN_AS_ERROR=true" >> $Env:GITHUB_ENV
4546
46-
# Make sure to keep the version number in sync with the matching command in
47-
# Lombiq.NodeJs.Extensions/build/NodeJsExtensionsNpmPackage.targets.
48-
corepack enable
49-
corepack prepare pnpm@8.15.9+sha1.aa4bc353b5f59fe1f1df5d802ce049ddf7f3c60e --activate
47+
# Read the packageManager from the package.json to be able to provide it to the pnpm setup action. While it can
48+
# read it from the file, it can't access the file when the lint workflow is run from a parent workflow.
49+
$packageJsonPath = Join-Path -Path $nodeJsExtensionsPath -ChildPath 'package.json'
50+
$packageJsonContent = Get-Content -Path $packageJsonPath -Raw | ConvertFrom-Json -AsHashTable
51+
$packageManager = $packageJsonContent['packageManager']
52+
$pnpmVersion = $packageManager.Split('@')[1]
53+
Write-Output "PNPM version in Node.js Extensions: $pnpmVersion"
54+
55+
"pnpm-version=$pnpmVersion" >> $Env:GITHUB_OUTPUT
56+
57+
# Relying on corepack, and also running pnpm setup is not enough, PNPM operations will fail while telling to run
58+
# pnpm setup. Manually setting up PNPM_HOME and adding it to PATH didn't help either. So, using this action.
59+
- name: Set up PNPM
60+
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
61+
with:
62+
version: ${{ steps.set-up-environment.outputs.pnpm-version }}
63+
64+
- name: Install Dependencies
65+
shell: pwsh
66+
run: |
67+
cd $Env:LOMBIQ_NODEJS_EXTENSIONS
5068
51-
cd $LombiqNodeJsExtensions
5269
pnpm install --prefer-offline --no-frozen-lockfile
5370
pnpm link --global
5471
5572
- name: Execute Linting
5673
shell: pwsh
5774
run: |
58-
$library = $Env:LOMBIQ_NODEJS_EXTENSIONS
75+
$libraryPath = $Env:LOMBIQ_NODEJS_EXTENSIONS
5976
60-
Invoke-NodeJsLinter -LibraryPath $library -Type scripts -Paths '${{ inputs.scripts }}'
61-
Invoke-NodeJsLinter -LibraryPath $library -Type styles -Paths '${{ inputs.styles-scss }}'
62-
Invoke-NodeJsLinter -LibraryPath $library -Type styles-css -Paths '${{ inputs.styles-css }}'
77+
Invoke-NodeJsLinter -LibraryPath $libraryPath -Type scripts -Paths '${{ inputs.scripts }}'
78+
Invoke-NodeJsLinter -LibraryPath $libraryPath -Type styles -Paths '${{ inputs.styles-scss }}'
79+
Invoke-NodeJsLinter -LibraryPath $libraryPath -Type styles-css -Paths '${{ inputs.styles-css }}'
6380
6481
if ('${{ inputs.lint-markdown }}' -ieq 'true')
6582
{
6683
Write-Output 'Markdown linting is enabled.'
67-
Invoke-NodeJsLinter -LibraryPath $library -Type markdown -Paths '{ ".": { "markdown": { "source": "." } } }'
84+
Invoke-NodeJsLinter -LibraryPath $libraryPath -Type markdown -Paths '{ ".": { "markdown": { "source": "." } } }'
6885
}
6986
else
7087
{

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
with:
5151
token: ${{ secrets.CHECKOUT_TOKEN }}
5252

53+
- name: Set up Node.js
54+
uses: Lombiq/GitHub-Actions/.github/actions/setup-node@dev
55+
5356
- name: Run Linter
5457
uses: Lombiq/NodeJs-Extensions/.github/actions/lint@dev
5558
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.idea/
12
.vs/
23
obj/
34
bin/

Lombiq.NodeJs.Extensions.Samples.NuGet/Lombiq.NodeJs.Extensions.Samples.NuGet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<ItemGroup>
2020
<!-- Adding Node.js Extensions as a PackageReference will result in inclusion of its .props and .targets files
2121
during Build. -->
22-
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="2.2.1-alpha.0.osoe-954" />
22+
<PackageReference Include="Lombiq.NodeJs.Extensions" Version="3.0.0" />
2323
</ItemGroup>
2424

2525
</Project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const fs = require('fs');
2+
const { FlatCompat } = require('@eslint/eslintrc');
3+
4+
const compat = new FlatCompat({ baseDirectory: __dirname });
5+
6+
let eslintrc = compat.config({
7+
// The following path may have to be adjusted to your directory structure.
8+
extends: './node_modules/nodejs-extensions/config/.eslintrc.lombiq-base.js',
9+
10+
// Add custom rules and overrides here.
11+
rules: {
12+
},
13+
});
14+
15+
if (fs.existsSync('./.eslintrc.js')) {
16+
// eslint-disable-next-line global-require, import/extensions -- Special conditional require.
17+
eslintrc = require('./.eslintrc.js');
18+
}
19+
20+
module.exports = [...eslintrc];

Lombiq.NodeJs.Extensions.Samples.NuGet/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"watch": "npm explore nodejs-extensions -- pnpm watch"
66
},
77
"devDependencies": {
8-
"eslint": "9.37.0",
8+
"@eslint/eslintrc": "3.3.1",
9+
"eslint": "9.39.1",
910
"eslint-config-airbnb-base": "15.0.0",
1011
"eslint-plugin-import": "2.32.0",
1112
"eslint-plugin-n": "17.23.1",

Lombiq.NodeJs.Extensions.Samples/pnpm-lock.yaml

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lombiq.NodeJs.Extensions.SolutionMarkdownAnalysis/Lombiq.NodeJs.Extensions.SolutionMarkdownAnalysis.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<PropertyGroup>
66
<TargetFramework>netstandard2.0</TargetFramework>
7-
<DefaultItemExcludes>.git*;$(DefaultItemExcludes)</DefaultItemExcludes>
7+
<DefaultItemExcludes>.git*;node_modules\**;$(DefaultItemExcludes)</DefaultItemExcludes>
88
<IsPublishable>false</IsPublishable>
99
</PropertyGroup>
1010

Lombiq.NodeJs.Extensions.SolutionMarkdownAnalysis/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
}
1010
},
1111
"devDependencies": {
12-
"eslint": "9.37.0",
12+
"eslint": "9.39.1",
1313
"eslint-config-airbnb-base": "15.0.0",
1414
"eslint-plugin-import": "2.32.0",
1515
"eslint-plugin-n": "17.23.1",

0 commit comments

Comments
 (0)