ShaderFrog / glsl-parser

A GLSL ES 1.0 and 3.0 parser that can preserve whitespace and comments

Home Page:https://shaderfrog.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

package.json has wrong path on field "main".

dogefromage opened this issue · comments

Hey, I've stumbled across an issue, possible just with the current release on npm. In version 1.0.9, the index.js file sits directly in the root folder. However, package.json points to a "dist" folder as such.

  "main": "./dist/index.js",

This makes the package unusable (to my knowledge), if not manually adjusted in node_modules.

Weird, I'll take a look. That line isn't in the project's package.json so I need to track down what's adding it.

fwiw I'm able to import the parser, but it generates a warning:

$ node
> const a = require('@shaderfrog/glsl-parser')
undefined
> (node:82745) [DEP0128] DeprecationWarning: Invalid 'main' field in 'node_modules/@shaderfrog/glsl-parser/package.json' of './dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)

and it's defined:

> a
{
  generate: [Function: gen],
  parser: {
    SyntaxError: [Function: peg$SyntaxError] { buildMessage: [Function (anonymous)] },
    parse: [Function: peg$parse]
  }
}

I didn't notice this in my own projects because I only use named imports from the parser. The documentation only shows named imports as well.

Fixed in @shaderfrog/glsl-parser@1.1.0 by removing that line from package.json, which was leftover from the previous build process.

Thanks, I love using the package so far :)