tunnckoCore/monorepo

v4.0.1 of parse-commit-message is missing its dist directory

Closed this issue · 7 comments

Started in intuit/auto#244

This one has kinda thrown me for a loop tonight.

I use https://github.com/intuit/auto to do automated releases. In circleci I've been using npx auto shipit to trigger that process. That started failing when @hipstersmoothie release v3. The error was pretty vague...

Cannot find module './dist/cjs'

The stack trace pointed to this library, but I ended up on the other version of it (because I referenced the latest tag from npm). The error was on line 4 of index.js so I thought somehow the esm import in the other module was causing problems. Thus the conversation here: tunnckoCoreLabs/parse-commit-message#55.

Once I figured out that I'm just sleep deprived and there's a 4+ version release and found the source it all started making more sense. The line failing was here. Requiring dist/cjs.

Long story short, v4.0.0 has a dist directory but v4.0.1 does not.

There's v4.0.1? ;dd Sorry im trying and playing with lerna. But I think the v4.0.0 is only on the beta-x. :D

After the beta-x publish I tried it - installed it and used it and it was working. Can u look at the node modules dir what we have there? There should have type files and two dirs - cjs and esm.

Fack. Im now seeing prs from renovate, and it seems there was actual publish to packages latest tag?! damn. lerna sucks haha

Nope.

Okey, why I don't have that problem?

~/develop
❯ mkdir barry
mkdir: created directory 'barry'

~/develop
❯ cd barry

~/develop/barry
❯ yarn init -y
yarn init v1.13.0
warning The yes flag has been set. This will automatically answer yes to all questions, which may have security implications.
success Saved package.json
Done in 0.12s.

~/develop/barry
❯ yarn add parse-commit-message@beta-x
yarn add v1.13.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
└─ parse-commit-message@4.0.0
info All dependencies
└─ parse-commit-message@4.0.0
Done in 1.65s.

~/develop/barry
❯ nano index.js

~/develop/barry 26s
❯ node index.js
[ { header: { type: 'fix', scope: null, subject: 'bar qux' },
    body: null,
    footer: null } ]

~/develop/barry
❯ cat index.js
const {parse} = require('parse-commit-message')

console.log(parse('fix: bar qux'))
~/develop/barry
❯

~/develop/barry
❯ ls node_modules/parse-commit-message/
dist/  CHANGELOG.md  index.js  package.json

~/develop/barry
❯ ls node_modules/parse-commit-message/dist
cjs/  esm/  plugins/  commit.d.ts  header.d.ts  index.d.ts  main.d.ts  types.d.ts  utils.d.ts

~/develop/barry
❯ ls node_modules/parse-commit-message/dist/cjs
index.js

~/develop/barry
❯ ls node_modules/parse-commit-message/dist/esm
plugins/  commit.js  header.js  index.js  main.js  types.js  utils.js

screen shot 2019-01-23 at 8 48 30 am

you are installing 4.0.0. That works on first install. But after that if my app has "parse-commmit-message": "^4.0.0" it will install the latest version. so if you try to install npm i parse-commit-message@4.0.1 you will see the problem

to demonstrate I just did the following

# install latest
npm i -g parse-commit-message@4.1.2                                                
# open directory
c /Users/alisowski/.nvm/versions/node/v8.11.0/lib/node_modules/parse-commit-message

screen shot 2019-01-23 at 8 51 07 am

You can see that your packages currently don't include the dist/ folder. so they don't work at all

Oh yea, of course. For now you can set beta-x instead of version, until the things are more stable.

I definitely don't like how Lerna works, but I'll probably land them to latest soon. But that might be at the end of the week or the early next week.

I cleaned up the dist-tag last night and published 2 stable v4 RCs on the next dist-tag.