Comments (10)
Ok cool. Looks like everyone is on the same page then.
I can take this up mid next week.
from civet.
An update on this: if you use Vite, Rollup, ESBuild, or Webpack to build your Civet code, our new unplugin for these systems now has a typecheck: true
option that will do typechecking. So we now have a reasonable way to do type checking in CLI!
from civet.
We should try to extract the typecheck: true
feature from the unplugin into a module that the CLI could directly call. This would still require installing typescript
locally (or globally?), but would make it easy to integrate into the existing CLI with a command-line option like civet --typecheck
or civet -t
.
from civet.
Agreed. I was imagining a civetsc
CLI tool (or something like that) that runs TypeScript on the transpiled files, following tsconfig.json
(or maybe even tsconfig.civet
?).
Perhaps it should be a second bin
for the main Civet package. Or perhaps it should be its own NPM package, given that it would have a typescript
peer dependency?
from civet.
runs TypeScript on the transpiled files
That may not be a great idea. Ideally we'd non-interactively do what the lsp client already does so that any errors etc. have correct source line numbers.
@STRd6 Are you open to bin/civettsc (or maybe just civetc) ? I think keeping this outside may be a maintenance burden because I think tsserver integration is still early and keeping the two in sync may need more work.
from civet.
I agree that this should be part of this repo (but maybe separate NPM package), and wyen I said "run TypeScript" I meant the same thing as the LSP (not running tsc).
from civet.
Having an additional civetc
build product in bin
makes sense. I also agree that making use of the same TSServer wrapping is important so that the editor error messages match the cli error messages exactly. I'm in support of anyone who wants to work towards this.
from civet.
Feel free to refactor out the TSServer wrapping from lsp into a shared lib if it makes things easier.
from civet.
Surely the bin should be called tscivet
… or tscvt
?
from civet.
I guess it's a tradeoff on whether to have just one bin
or multiple. I don't have a strong feeling, but most of the code would be shared with the CLI so I think allowing for civet -t
at least makes sense. We could also add an alias of tscivet
or civetsc
if we want.
from civet.
Related Issues (20)
- Matching nested property with same name generates invalid JS
- Ampersand bugs HOT 1
- `.#x` shorthand for private properties HOT 1
- Missing parens in `.-1` access in certain contexts
- Attempted pattern matching ternary HOT 1
- Finishing civetconfig
- `get #x` requires newline, not semicolon HOT 1
- coffeeDo bug
- Use `{}` instead of `;` for empty block
- `for`/`else` HOT 2
- Generator operators
- Cannot shadow operator with argument HOT 1
- Sourcemaps are off when used with @propName HOT 1
- Add source location to error nodes
- `-o dist/.js` errors if the `dist` folder doesn't already exist HOT 2
- `-version` with only one hyphen throws a ReferenceError HOT 1
- "Invalid command-line argument" error includes stack dump
- Splice assignment with loop
- Empty block following pattern in switch expression generates invalid JS
- hoistDec bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from civet.