Skip to content

Commit

Permalink
resolve fixmes
Browse files Browse the repository at this point in the history
  • Loading branch information
scripthunter7 committed Sep 18, 2024
1 parent 88dc173 commit 98f5bb4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ AdGuard's Scriptlets and Redirect resources library which provides extended capa
- [Development](#development)
- [How to build](#how-to-build)
- [How to test](#how-to-test)
- [How to link packages](#how-to-link-packages)
- [How to update wiki](#how-to-update-wiki)
- [Usage](#usage)
- [CoreLibs](#corelibs)
Expand Down Expand Up @@ -328,6 +329,20 @@ yarn test
and open needed HTML file from `tests/dist` in your browser with devtools


### <a name="how-to-link-packages"></a> How to link packages

Scriptlets library relies on external packages, such as `@adguard/agtree`.
During development, you might need to link these packages using `yarn link`.
**When you do this, make sure to install dependencies in the `tsurlfilter` monorepo with `pnpm i --shamefully-hoist`**,
otherwise you will encounter issues during tests and builds, because we use Babel runtime and in the nested structure,
the program will try to resolve it from the `node_modules` folder of the linked package, not from the `node_modules`
in the Scriptlets library.

The reason behind this is that `pnpm` creates a nested `node_modules` structure,
while `yarn` and `npm` create a flat structure. By adding `--shamefully-hoist`,
you force `pnpm` to create a flat structure, which is required for the Babel runtime to work correctly.


### <a name="how-to-update-wiki"></a> How to update wiki

There are two scripts to update wiki:
Expand Down
2 changes: 0 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ module.exports = (api) => {
'@babel/plugin-transform-arrow-functions',
'@babel/plugin-transform-function-name',
],
// FIXME
ignore: [/agtree.js$/, /csstokenizer.js$/],
};

return config;
Expand Down
2 changes: 0 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ const config = {
testEnvironment: 'jsdom',
silent: true,
testRegex: '.spec.js',
// FIXME
transformIgnorePatterns: ['agtree.js', 'csstokenizer.js'],
};

module.exports = config;

0 comments on commit 98f5bb4

Please sign in to comment.