oclif / hello-world Goto Github PK
View Code? Open in Web Editor NEWTemplate repository for generating CJS oclif plugins
License: MIT License
Template repository for generating CJS oclif plugins
License: MIT License
I did the following:
So far works fine.
Now I added launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}\\bin\\run",
"args": [
"hello",
"world",
],
}
]
}
and set a breakpoint in world.ts:17 (run()).
The debugger never hits the breakpoint in the TS file.
How can I debug oclif projects in vs code?
Every time a open the CLI package the VSCode warns me about an incorrect tsconfig.json
that uses project references without having composite enabled. After looking at the docs I've confirmed that VSCode is right.
Link of TS's project references docs:
https://www.typescriptlang.org/docs/handbook/project-references.html#composite
Since tests/tsconfig.json
is only used by test runner we don't see any error in the console, but for long term this may cause some troube.
Some part of the template seems to be useless:
devDependencies tslib
is not referenced by any files
The cli seems to work without src/index.ts
I've generated a CLI inside my mono-repository, and it seems like @types/mocha
type declarations conflict with jest
ones I use in another package. It only happens because of my environment, but it could be avoided by using the skipLibCheck
option in tsconfig.json
.
skipLibCheck
also saves compilation time by skipping type checking dependencies.
../../../node_modules/@types/mocha/index.d.ts(2642,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'beforeEach' must be of type 'Lifecycle', but here has type 'HookFunction'.
../../../node_modules/@types/mocha/index.d.ts(2660,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'afterEach' must be of type 'Lifecycle', but here has type 'HookFunction'.
../../../node_modules/@types/mocha/index.d.ts(2676,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'describe' must be of type 'Describe', but here has type 'SuiteFunction'.
../../../node_modules/@types/mocha/index.d.ts(2697,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'xdescribe' must be of type 'Describe', but here has type 'PendingSuiteFunction'.
../../../node_modules/@types/mocha/index.d.ts(2711,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'it' must be of type 'It', but here has type 'TestFunction'.
../../../node_modules/@types/mocha/index.d.ts(2725,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'test' must be of type 'It', but here has type 'TestFunction'.
../../../node_modules/@types/mocha/index.d.ts(2732,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'xit' must be of type 'It', but here has type 'PendingTestFunction'.
../../../node_modules/@types/sass-loader/interfaces.d.ts(410,43): error TS2314: Generic type 'Options<sync>' requires 1 type argument(s).
Current template is specifically for CJS and requires modifications by the user to convert it to ESM. There are issues even after following the docs, like the tests don't pass.
We need to add a template that supports ESM without any modifications by the user and with tests that pass
The new template should be accessible through oclif
's generator
This is a bug.
Command ./bin/run hello:world
not working.
Commands fired -
$ oclif generate stream
$ ./bin/run hello:world
Error: command hello:world not found
generate command pulls oclif/hello-world repo as a template.
hello world! (./src/commands/hello/world.ts)
versions-
oclif: 2.1.0
oclif/core: 1.1.0
OS: OSX 11.5.2
Node: 14.17.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.