Skip to content

Commit

Permalink
fix: known Windows issues
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed May 8, 2022
1 parent 4d8b081 commit fb2bc0c
Show file tree
Hide file tree
Showing 7 changed files with 11,245 additions and 11,153 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-ladybugs-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'synckit': patch
---

fix: known Windows issues
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coverage
lib
CHANGELOG.md
!/.*.js
!/.*.cjs
5 changes: 1 addition & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"extends": "@1stg",
"rules": {
"unicorn/require-post-message-target-origin": 0
}
"extends": "@1stg"
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@
"lint": "run-p lint:*",
"lint:es": "eslint . --cache -f friendly --max-warnings 10",
"lint:tsc": "tsc --noEmit",
"prepare": "simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"prepare": "patch-package && simple-git-hooks && yarn-deduplicate --strategy fewer || exit 0",
"prerelease": "npm run build",
"pretest": "yarn build",
"release": "clean-publish && changeset publish",
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"typecov": "type-coverage"
},
"dependencies": {
Expand All @@ -63,6 +63,7 @@
"@types/node": "^17.0.31",
"clean-publish": "^4.0.0",
"deasync": "^0.1.26",
"patch-package": "^6.4.7",
"sync-threads": "^1.0.1",
"ts-expect": "^1.3.0",
"ts-jest": "^28.0.1",
Expand Down
21 changes: 21 additions & 0 deletions patches/eslint-mdx+2.0.0-next.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/node_modules/eslint-mdx/lib/worker.js b/node_modules/eslint-mdx/lib/worker.js
index 7dd21a5..adaabcc 100644
--- a/node_modules/eslint-mdx/lib/worker.js
+++ b/node_modules/eslint-mdx/lib/worker.js
@@ -8,6 +8,7 @@ const path_1 = tslib_1.__importDefault(require("path"));
const cosmiconfig_1 = require("cosmiconfig");
const synckit_1 = require("synckit");
const helpers_1 = require("./helpers");
+const { pathToFileURL } = require("url");
let acorn;
let tokTypes;
let jsxTokTypes;
@@ -129,7 +130,7 @@ exports.getRemarkProcessor = getRemarkProcessor;
})(acorn.Parser).acornJsx.tokTypes;
}
if (!TokenTranslator) {
- TokenTranslator = (yield (0, helpers_1.loadEsmModule)(path_1.default.resolve(require.resolve('espree/package.json'), '../lib/token-translator.js'))).default;
+ TokenTranslator = (yield (0, helpers_1.loadEsmModule)(pathToFileURL(path_1.default.resolve(require.resolve('espree/package.json'), '../lib/token-translator.js')))).default;
}
const tokenTranslator = new TokenTranslator(Object.assign(Object.assign({}, tokTypes), jsxTokTypes), fileOptions.value);
const root = processor.parse(fileOptions);
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ function startWorkerThread<R, T extends AnyAsyncFn<R>>(
isTs
? tsUseEsm
? dataUrl(`import '${String(pathToFileURL(finalWorkerPath))}'`)
: `require('ts-node/register');require('${finalWorkerPath}')`
: `require('ts-node/register');require('${finalWorkerPath.replaceAll(
'\\',
'\\\\',
)}')`
: pathToFileURL(finalWorkerPath),
{
eval: isTs && !tsUseEsm,
Expand Down
Loading

0 comments on commit fb2bc0c

Please sign in to comment.