Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the stability of the tokenizer #134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mabels
Copy link

@mabels mabels commented Dec 3, 2024

Due to some oddities with esm.sh, the object compare of the tokens could fail.
To fix this, make use of cborg provided Type.compare method.

I'm sorry for the package.json changes but they are needed if I want to run the tests locally.

       of the tokens could fail. To fix this move to the
       cborg provided compare method.
Comment on lines +170 to +171
"eslint-config-ipfs": "^7.0.6",
"eslint-plugin-n": "^17.14.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aegir should be contributing what it needs for linting, no? does it fail without these?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does fails without on my side.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try removing these and push again, this changeset works for me locally without them and pushing a new commit might wake CI up, something odd going in GitHub Actions even after a re-start attempt

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ npm ls --all | grep 'eslint-config-ipfs\|eslint-plugin-n'
│ │ ├─┬ [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ ├── [email protected] deduped
│ │ ├── [email protected]
│ │ ├── [email protected] deduped
│ ├─┬ [email protected]

this is from a freshly installed tree without them, so they're there already from aegir.

@mabels
Copy link
Author

mabels commented Dec 4, 2024

The failures in the CI i don't understand --- they are all released to the git checkouts --- any ideas.

@mabels
Copy link
Author

mabels commented Dec 4, 2024

that's what happens here if i remove the eslint deps:

rm -rf dist node_modules
npm i%

❯ npm i
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Renamed to read-package-up
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-catch-binding instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated [email protected]: Glob versions prior to v9 are no longer supported
npm warn deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm warn deprecated [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1431 packages, and audited 1657 packages in 9s

369 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

❯ npm run build

> @ipld/[email protected] build
> aegir build

[09:13:04] tsc [started]
[09:13:05] tsc [completed]
[09:13:05] esbuild [started]
[09:13:05] esbuild [completed]

❯ npm run test

> @ipld/[email protected] test
> npm run lint && aegir test


> @ipld/[email protected] lint
> aegir lint

[09:13:10] eslint [started]
[09:13:11] eslint [failed]
[09:13:11] → Failed to load plugin 'n' declared in 'package.json » eslint-config-ipfs#overrides[0] » ./js.js » eslint-config-standard': Cannot find module 'eslint-plugin-n'
Require stack:
- /Users/xxxxxx/Software/fproof/js-dag-json/__placeholder__.js
Failed to load plugin 'n' declared in 'package.json » eslint-config-ipfs#overrides[0] » ./js.js » eslint-config-standard': Cannot find module 'eslint-plugin-n'
Require stack:
- /Users/xxxxxx/Software/fproof/js-dag-json/__placeholder__.js
❯

@rvagg
Copy link
Member

rvagg commented Dec 5, 2024

Sorry, if I run the exact same commands I don't get that error. What version of Node.js and npm are you doing this on?

$ npm -v
10.9.0
$ node -v
v23.3.0

@mabels
Copy link
Author

mabels commented Dec 5, 2024

Sorry, if I run the exact same commands I don't get that error. What version of Node.js and npm are you doing this on?

$ npm -v
10.9.0
$ node -v
v23.3.0

$ node -v
v20.15.1
$ npm -v
10.8.2

if i use:
$ node -v
v23.3.0
$ npm -v
10.9.0

and remove the additional deps --- i get the same error as with the other versions.

my .npmrc a almost clean:
engine-strict=true

that's enough investigation for me now --- I will just remove these imports
but first, we have to wait for a working cborg to implement .equals.
I didn't look into @ipld/dag-cbor if there is also a .equals update needed.

@vmx
Copy link
Member

vmx commented Dec 6, 2024

I've tried it locally on a fresh checkout without the additional deps. It works for me.

$ node -v
v20.13.1
$ npm -v
10.5.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants