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

Move cli to into class package that can be published to npmjs.com #67

Merged
merged 19 commits into from
Oct 24, 2024

Conversation

sverhoeven
Copy link
Collaborator

@sverhoeven sverhoeven commented Oct 21, 2024

Follow of #57

Bin in package,json is also known as package executables or package binaries.

JSR and bin does not work in same package as installing the package from JSR is missing bin entry.

TODO

  • Dev version working
  • Production version working
    • Merge Prep new release #66 and publish class package to jsr
    • Make sure packaged cli depends on correct class package from npmjs, currently is doesnt, see comment below
    • Publish cli package to npmjs
    • Run npx @classmodel/cli config.json

@sverhoeven sverhoeven marked this pull request as draft October 21, 2024 13:20
@sverhoeven
Copy link
Collaborator Author

Currently package to publish has wrong dep

pnpm pack
tar -vx -O -f ./classmodel-cli-0.0.3.tgz package/package.json |grep /class
package/package.json
    "@classmodel/class": "0.0.3"

Which is incorrect, it should be something like "npm:@jsr/classmodel__class@^0.0.3"

Make sure version of lock file is compatible with installed pnpm
@sverhoeven
Copy link
Collaborator Author

Maybe setting alias will help.

@sverhoeven
Copy link
Collaborator Author

Maybe setting alias will help.

That does not work because then someone using the cli will need to add @jsr:registry=https://npm.jsr.io their .npmrc file. So I think its better if we switch to the publishing of @classmodel/class from jsr to npmjs.
This will make it also easier to use the package as a dependency.

@sverhoeven
Copy link
Collaborator Author

sverhoeven commented Oct 24, 2024

Decided to have one package, by merging the class and cli package that is published to npmjs.
Also

  • Will need to also update GH workflow.
  • jsr had api docs will need api docs elsewhere (docs dir on github pages) with typedoc

@sverhoeven sverhoeven changed the title Move cli to own package that can be published to npmjs.com Move cli to into class package that can be published to npmjs.com Oct 24, 2024
@sverhoeven sverhoeven marked this pull request as ready for review October 24, 2024 15:11
@sverhoeven sverhoeven merged commit 1ae532a into 51-cli Oct 24, 2024
@sverhoeven sverhoeven deleted the cli-own-package branch October 24, 2024 15:11
@Peter9192
Copy link
Member

Tried running pnpm i at top level of repo, now gives:

Failed to create bin at /home/peter/classmodel/class-web/apps/class-solid/node_modules/.bin/class. ENOENT: no such file or directory, open '/home/peter/classmodel/class-web/packages/class/dist/cli.js'
...
Failed to create bin at /home/peter/classmodel/class-web/apps/class-solid/node_modules/.bin/class. ENOENT: no such file or directory, open '/home/peter/classmodel/class-web/apps/class-solid/node_modules/@classmodel/class/dist/cli.js'

@sverhoeven
Copy link
Collaborator Author

Those are warnings, after a pnpm build or pnpm dev the warnings should not show.

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.

2 participants