Skip to content

Commit

Permalink
AG-29284 AGLint module import problem
Browse files Browse the repository at this point in the history
Merge in ADGUARD-FILTERS/vscode-adblock-syntax from fix/AG-29284 to master

Squashed commit of the following:

commit 89ba0e9
Author: scripthunter7 <[email protected]>
Date:   Thu Jan 4 13:50:44 2024 +0100

    Bump version

commit dc4d7f7
Author: scripthunter7 <[email protected]>
Date:   Thu Jan 4 13:50:32 2024 +0100

    Update changelog

commit 713d107
Author: scripthunter7 <[email protected]>
Date:   Thu Jan 4 13:50:16 2024 +0100

    Fix dynamic module import
  • Loading branch information
scripthunter7 committed Jan 4, 2024
1 parent 2be06fb commit 941c86a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog][keepachangelog], and this project adheres to [Semantic Versioning][semver].


## 1.1.6 - 2024-01-04

### Fixed

- AGLint module import problem: [#113]

## 1.1.5 - 2023-11-10

### Added
Expand Down Expand Up @@ -347,6 +353,7 @@ The format is based on [Keep a Changelog][keepachangelog], and this project adhe
[#105]: https://github.com/AdguardTeam/VscodeAdblockSyntax/issues/105
[#107]: https://github.com/AdguardTeam/VscodeAdblockSyntax/issues/107
[#108]: https://github.com/AdguardTeam/VscodeAdblockSyntax/issues/108
[#113]: https://github.com/AdguardTeam/VscodeAdblockSyntax/issues/113
[#114]: https://github.com/AdguardTeam/VscodeAdblockSyntax/issues/114
[#115]: https://github.com/AdguardTeam/VscodeAdblockSyntax/issues/115
[#119]: https://github.com/AdguardTeam/VscodeAdblockSyntax/issues/119
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "adblock",
"displayName": "Adblock/AdGuard/uBlock filters grammar",
"description": "VS code extension that adds support for ad blocking rules syntax.",
"version": "1.1.5",
"version": "1.1.6",
"publisher": "adguard",
"icon": "icons/aglint_128x128.png",
"main": "./client/out/extension",
Expand Down
5 changes: 5 additions & 0 deletions server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ async function loadAglintModule(
// Import corresponding AGLint module
AGLintModule = await import(externalAglintPath || BUNDLED_AGLINT_PATH);

// Module may have a default export
if ('default' in AGLintModule) {
AGLintModule = AGLintModule.default as typeof AGLint;
}

// TODO: Another way to import the module, since we use CJS bundles
// eslint-disable-next-line import/no-dynamic-require, global-require
// AGLintModule = require(externalAglintPath || bundledAglintPath);
Expand Down

0 comments on commit 941c86a

Please sign in to comment.