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

Scaffolding for TypeScript CLI #198

Merged
merged 17 commits into from May 20, 2022
Merged

Scaffolding for TypeScript CLI #198

merged 17 commits into from May 20, 2022

Conversation

gimenete
Copy link
Contributor

@gimenete gimenete commented May 16, 2022

This PR is just the scaffolding of the TypeScript CLI: setting up ocliff and make it work with our eslint config, etc.

I've also added mostly empty commands to know more or less the commands we'll have.

I'll create separate PRs for each command so things can be tested and reviewed easily.

@changeset-bot
Copy link

changeset-bot bot commented May 16, 2022

⚠️ No Changeset found

Latest commit: e905071

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

💥 An error occurred when fetching the changed packages and changesets in this PR
Some errors occurred when validating the changesets config:
The package or glob expression "@xata.io/client" specified in the `linked` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.
The package or glob expression "@xata.io/codegen" specified in the `linked` option does not match any package in the project. You may have misspelled the package name or provided an invalid glob expression. Note that glob expressions must be defined according to https://www.npmjs.com/package/micromatch.

@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2022

size-limit report 📦

Path Size
packages/client/dist/index.mjs 6.84 KB (0%)
packages/client/dist/index.cjs 7.46 KB (0%)
packages/codegen/dist/index.mjs 1.95 MB (0%)
packages/codegen/dist/index.cjs 1.96 MB (0%)

@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2022

Your pull request has been published to npm.

You can install it by running:

npm install @xata.io/client@0.0.0-alpha.v236a8bd
npm install @xata.io/codegen@0.0.0-alpha.v236a8bd
npm install @xata.io/importer@0.0.0-alpha.v236a8bd
npm install @xata.io/shell@0.0.0-alpha.v236a8bd

@gimenete gimenete changed the title TypeScript CLI Scaffolding for TypeScript CLI May 16, 2022
@gimenete gimenete force-pushed the cli branch 3 times, most recently from d3e995f to 839e7fd Compare May 16, 2022 21:51
@gimenete gimenete marked this pull request as ready for review May 20, 2022 07:40
@gimenete gimenete requested a review from a team as a code owner May 20, 2022 07:40
@gimenete gimenete requested a review from a team May 20, 2022 08:37
cli/bin/dev Outdated
@@ -0,0 +1,17 @@
#!/usr/bin/env node
Copy link
Contributor

Choose a reason for hiding this comment

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

@gimenete do we want to try clipanion? It's ES ready and a bit more typesafe for parsing the options and should have the same benefit as oclif for autogenerated help and testability

Copy link
Contributor

Choose a reason for hiding this comment

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

image

The overall syntax is almost the same

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took a look to it but oclif supports many other things such as plugins, already built-in behaviours such the --json flag, generating binaries ready to be uploaded to homebrew, etc.

cli/bin/dev.cmd Outdated Show resolved Hide resolved
cli/bin/run.cmd Outdated Show resolved Hide resolved
"eslint-config-oclif-typescript": "^1.0.2",
"globby": "^11",
"oclif": "^3",
"shx": "^0.3.3",
Copy link
Member

Choose a reason for hiding this comment

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

TIL shx is a thing

Copy link
Member

@SferaDev SferaDev left a comment

Choose a reason for hiding this comment

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

LGTM. Left some minor comments, nothing blocking. Personally I'd remove all the placeholder command files to keep it clean, but it's fine as-is for the first scaffolding.

}
}
},
"scripts": {
Copy link
Member

@SferaDev SferaDev May 20, 2022

Choose a reason for hiding this comment

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

The files in bin probably make sense as scripts instead. I couldn't get to work dev one, but run works fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool. I've done that but I've removed the dev one because it doesn't read correclty the ESM commands and I think we don't need it.

@gimenete gimenete enabled auto-merge May 20, 2022 11:03
@gimenete gimenete merged commit 84980a0 into main May 20, 2022
@gimenete gimenete deleted the cli branch May 20, 2022 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants