textlint-rule / textlint-rule-alex

textlint rule for alex
MIT License
11 stars 3 forks source link

Update to alex@11 #25

Closed tyler36 closed 10 months ago

tyler36 commented 10 months ago

Fixes #17

This PR bumps the dependencies required to prevent Dependabot notifications.

tyler36 commented 10 months ago

I tried the changes you suggests but I am still getting errors. My javascript skills are limited to frontend frameworks so dynamic imports and ES modules are a little over my head.

azu commented 10 months ago

Thanks.

Ah, textlint-scripts has a issue. We want to preserve import(), but it will transpile to require() function.

I've created an issue to upstream https://github.com/textlint/textlint/issues/1283

Edit: fixed in https://github.com/textlint/textlint/releases/tag/v13.4.0

tyler36 commented 10 months ago

Probably need to run following command.

package.json now includes textlint-scripts so I not sure if we need it.

Now getting error:

Still get ERR_REQUIRE_ESM error when testing locally.

azu commented 10 months ago

package.json now includes textlint-scripts so I not sure if we need it.

Yes, It is required. We need to update to v13.4.0.

Still get ERR_REQUIRE_ESM error when testing locally.

https://github.com/textlint/textlint/releases/tag/v13.4.0 fix this issue.

yarn add textlint-scripts --dev
yarn upgrade
azu commented 10 months ago

https://github.com/textlint-rule/textlint-rule-alex/actions/runs/6795156695/job/18472756945?pr=25

/home/runner/work/textlint-rule-alex/textlint-rule-alex/node_modules/cliui/build/index.cjs:293 const wrap = require('wrap-ansi'); ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/textlint-rule-alex/textlint-rule-alex/node_modules/wrap-ansi/index.js from /home/runner/work/textlint-rule-alex/textlint-rule-alex/node_modules/cliui/build/index.cjs not supported. Instead change the require of index.js in /home/runner/work/textlint-rule-alex/textlint-rule-alex/node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules. at Object. (/home/runner/work/textlint-rule-alex/textlint-rule-alex/node_modules/cliui/build/index.cjs:293:14) at Object. (/home/runner/work/textlint-rule-alex/textlint-rule-alex/node_modules/yargs/build/index.cjs:2861:12) at Object. (/home/runner/work/textlint-rule-alex/textlint-rule-alex/node_modules/yargs/yargs:3:69) at Object. (/home/runner/work/textlint-rule-alex/textlint-rule-alex/node_modules/mocha/lib/cli/cli.js:15:15) at Object. (/home/runner/work/textlint-rule-alex/textlint-rule-alex/node_modules/mocha/bin/mocha.js:141:3) { code: 'ERR_REQUIRE_ESM' }

This error caused by old wrap-ansi package. It will be resolved by run yarn upgrade and commit updated yarn.lock.

๐Ÿ“ yarn upgrade will update the version referenced by the lock file to the latest in the range of semver.

tyler36 commented 10 months ago

Hmmm ... tests passed at e27b51904d61be6ab5384877374917bf36441589.

azu commented 10 months ago

Hmmm ... tests passed at e27b519.

Yes. This workflow includes yarn upgrade before running tests. Committing the update to yarn.lock will solve the problem.

yarn upgrade
git add yarn.lock
git commit
azu commented 10 months ago

Fmm. its something wrong.

azu commented 10 months ago

I've fixed in https://github.com/textlint-rule/textlint-rule-alex/pull/25/commits/9f7a8f73f8cec06701ff5bdf6619b2775f6a4fdb

resolutions field fix version forcely.

CI is passed ๐ŸŽ‰

tyler36 commented 10 months ago

https://github.com/textlint-rule/textlint-rule-alex/commit/9f7a8f73f8cec06701ff5bdf6619b2775f6a4fdb fixes local testing for me too.

tyler36 commented 10 months ago

Yay! ๐ŸŽŠ

Thank you very much for your help, guidence and patience.

azu commented 10 months ago

4.0.0 is released ๐ŸŽ‰ https://github.com/textlint-rule/textlint-rule-alex/releases/tag/v4.0.0

tyler36 commented 10 months ago

4.0.0 fixes "Got allows a redirect to a UNIX socket" dependable alert.