Notable:
- vitest `1.5.0` which solves some issues with running in the extension
- remove `sinon` from compiler which is not needed anymore as vitest
provide spies built-in
- Use corepack to install pnpm: Faster and respect the pnpm version set
in package.json instead of having another place to keep up to date
- dependency cache
- upgrade to new code coverage task
- Move all consitency check to independent github action workflow(Makes
it easier to see which one failed immediately without having to open
devops and dig into the steps)
Note this is added to `tspd` which is not published yet so this can be
iterated over without any issues.
Adds a decorator signature generator. Generates 2 files:
- `<namespace>.ts` : Contains the decorator signatures that can be
imported and when declaring the decorators functions
- `<namespace>.ts-test.ts`: Contains some test using typescript type
system to make sure the package does reexport the right `$<name>` for
each decorator
---------
Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
Add vitest ui package and `test:ui` command to popup the vitest UI
https://vitest.dev/guide/ui
Import the common vitest config from the workspace so each package
doesn't need to define all of it.
Added `watchExclude: []` to the common config to preven vitest from
excluding dist and node_modules folder which is required so it can auto
rerun the test on when a dependency (monorepo dep) rebuilds
Added debug config to debug the current test. As the vitest extensions
is quite unreliable this should help
Get rid of mocha and upgrade to vitest which is a more modern
alternative providing, watch, direct typescript compilation out of the
box, expect library and more.
Advantage over mocha:
- Much better cli
- watch mode
- better diff
- Better extension:
- tree organization for files too (not everything flattened)
- update in real time the test(no more need to refresh manually to
discover where are the tests)
- just a little buggy
- Compiles typescript directly
- provides more expectation apis(like jest)
Cons over mocha:
- Slower(about 2x) but that means we don't need to build the test as
part of build which would speed up that part(not as much as is lost)
Todo:
- typespec-azure migration
`default` entry must be last in `exports`. Most tools do not care but it
seems like webpack and docusaurus do. This is causing issue when trying
to imoport the playground directly there.
Copying changes from https://github.com/Azure/typespec-azure/pull/3731/
Note: I added the following files as they were missing but the
corresponding `.mocharc.yaml` files already exist:
- packages/protobuf/mocha.reporter.config.json
- packages/samples/mocha.reporter.config.json
- packages/typespec-vscode/mocha.reporter.config.json
Same pr in typespec-azure
https://github.com/Azure/typespec-azure/pull/3641
Migrate to use the `types` entry under `exports` instead of hte legacy
typesVersions. This was a leftover to when es modules where not
completely supported in typescript and using typesVersions was a
workaround.
### ℹ️ Overview
Includes two commits, one to fix#2391 and a second related to the same
issue.
#### Correct rest → http peer dependency
Fixes#2391
Updates `@typespec/rest` to have a `peerDependency` on `@typespec/http`.
Leftover from the rest/http split.
#### OpenAPI does not depend on REST
Relates to #2391.
Removes `@typespec/rest` as a `peerDependency` for `@typespec/openapi`
and `@typespec/openapi3`. The OpenAPI packages only depend on HTTP
functionality, not the higher-level REST concepts.
The packages still have `@typespec/rest` as a `devDependency` for test
cases (test host).
### 📝 Notes
N/A - Commit message suffices
### 🧪 Testing
Ran rush scripts. Did not attempt an `npm link` and install or
something. (So, no testing really.)
fix#2130
Generate the README.md for typespec libraries automatically using the
subset of the content as what gets included in the ref doc
To achieve this I reoganized the markdown rendering to be able to
provide a reusable system that can be cusomized for different markdown
engines.
- The markdown renderer will render a markdown compatible with Github
Flavored Markdown.
- The docusuaurs rendererer extends the markdown renderer and include a
few extra metadata.
Progress towards providing the ref doc generation as a usable tool by
any typespec library.
Detach the generation from the website, instead each package define
where they want their doc and we generate it.
This adds a new `tspd` package and CLI tool that is meant to be used by
library authors. It will have the following functionalities
- generate docs
- generate TS signatures
- lint library?
---------
Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
This change fixes#1978 by deprecating the virtually-unused `@list`
decorator in favor of the `@listsResource` decorator in
`@typespec/rest`. I'm also deprecating the associated `isListOperation`
and `getListOperationType` functions in `@typespec/compiler` and moving
`isListOperation` to the REST library.
The corresponding `typespec-azure` PR is here:
https://github.com/Azure/typespec-azure/pull/3200
---------
Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>