Граф коммитов

225 Коммитов

Автор SHA1 Сообщение Дата
Timothee Guerin 49004b60d5
Update dependencies (#3948)
New pr from this branch as it had some weird docusaurus issue not
reproducable anywhere else and just changing branch fixes it somehow
https://github.com/microsoft/typespec/pull/3934
Notable:
- vitest: 2.x
- prettier update that does a minor formatting change by adding
parentheses in some ternary expression
2024-07-23 21:02:34 +00:00
Timothee Guerin af65ce9220
Bump versions for release 0.57 (#3855) 2024-07-17 00:10:54 +00:00
Timothee Guerin 56b456d75e
Import openapi3 document in playground (#3750)
<img width="364" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/e9597497-97c3-4103-b0df-acf553e5af78">

<img width="726" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/00511247-8f95-4839-99a0-4d14c03b24b6">
2024-07-08 18:20:12 +00:00
Timothee Guerin 4553419b75
Enable react hooks linting and fix issues (#3761)
fix #3745
2024-07-08 17:10:06 +00:00
Timothee Guerin e54a7f8fd0
TypeGraph Viewer V2 (#3713)
https://cadlplayground.z22.web.core.windows.net/prs/3713/
<img width="1155" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/6adfa086-fc97-4ab8-8557-a5e50a291a57">
2024-07-03 20:18:39 +00:00
Timothee Guerin f3c2c9b67c
Dependency updates July 2024 (#3718)
Notable: Typescript 5.5
2024-07-01 21:42:11 +00:00
Timothee Guerin 216f423a8c
Fix crash in program viewer when trying to display new value type (#3585)
fix https://github.com/Azure/typespec-azure/issues/1016
### Fix crash in the program viewer
When we were trying to display a value(only case right now is using a
default value as property) it would blow up

### Add error boundary to only crash the output view and ability to
retry so the entire UI is not lost

![image](https://github.com/microsoft/typespec/assets/1031227/d856c8c9-41d9-4c86-9c6b-432e60a12d53)
2024-06-14 18:20:30 +00:00
Allen Zhang 9c701cc272
TypeSpec 0.57 - June 2024 Release publish branch (#3578)
Co-authored-by: Timothee Guerin <tiguerin@microsoft.com>
2024-06-13 21:47:55 +00:00
Rodge Fu 35e8625014
support loglevel filter in playground (#3569)
support loglevel filter in playground to avoid too many verbose log as
well as user can filter logs as needed.

fixes #3554
2024-06-12 14:54:50 +00:00
Timothee Guerin dae5e20157
Fix swagger UI missing (#3552)
Recent regression with the new program viewer refactoring
2024-06-10 17:47:53 +00:00
Timothee Guerin 0f344accd6
Fix some styles in the playground with overflow (#3542)
FIx: 
- Hover popup would get croped 


![image](https://github.com/microsoft/typespec/assets/1031227/a2b975d5-47af-4e4a-b547-f56b8c4e3668)
- tabs overlap

![image](https://github.com/microsoft/typespec/assets/1031227/8919ec99-eb15-4197-a6c2-817f8d29fd17)
2024-06-06 20:18:46 +00:00
Timothee Guerin 1d668673c3
Fix playground crashing (#3529)
Issue is that we were returning before the hook declarations when there
was no output files which cause react to crash due to number of hook
running changing
2024-06-06 00:19:37 +00:00
Timothee Guerin 12e26a35fa
Custom output viewer (#3465)
Provide a way to pass a custom program viewer to the playground. This
should enable scnearios like having a `TypeSpec UI` viewer similar to
swagger UI.
Moved the viewer selection to be some vertical tabs with icons to the
right instead

File output viewer
<img width="723" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/e58caee7-8df5-4a9a-be16-9d6fec6701b4">

Type graph viewer

<img width="713" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/8bc2c4a0-42dc-4f91-a9ed-7b52bcad3692">


Also fix issues related to the playground build not validating the
typesript
2024-06-05 22:56:54 +00:00
Timothee Guerin 42e72b813d
Add storybook for playground library (#3412)
Don't include it anwhere but this will help showcasing all the
components available in the playground.


![image](https://github.com/microsoft/typespec/assets/1031227/8a7e130f-2e3f-4149-9f33-ed8991950ea2)
2024-05-24 02:37:11 +00:00
Timothee Guerin 71784e2bc2
Simplify to use vite for building playground library (#3403)
Using rollup wasn't working super well when running in watch mode with
the playground-website package refresh and needed some restart.

Unfortunatelly can't seem to find a good way to just run `pnpm start` in
`/playground-website` and have that working so still have to do `pnpm
watch` in `/playground` as well.
2024-05-20 22:07:51 +00:00
Timothee Guerin e316792dcd
Update dependencies - May 2024 (#3401) 2024-05-20 16:31:39 +00:00
Timothee Guerin 8c44c3a89d
Remove all circular references in TypeSpec Compiler (#3308)
They cause vitest to not be happy randomly. This is only a problem with
non type import so adding `type` helps finding which ones are a real
problem

Use madge with this command to find them
```
npx madge --circular --extensions ts ./src/
```

with this config
```
{
  "detectiveOptions": {
    "ts": {
      "skipTypeImports": true,
      "skipAsyncImports": true
    }
  }
}
```
2024-05-09 22:56:46 +00:00
Timothee Guerin dec504364c
Bump versions for 0.56.0 release (#3298) 2024-05-08 00:34:05 +00:00
Timothee Guerin df4dac296d
Blog redo with fixes (#3236)
- old date
- merge conflict that drop `diff` support
- non needed export
- broken playground class
2024-04-26 14:37:48 +00:00
Timothee Guerin fa540a97ba
Split intrinsic from std lib (#3170)
fix https://github.com/microsoft/typespec/issues/3171
Currently the `--nostdlib` option is just useless, here splitting the
intrinsic types from the rest of the std lib.

Intrinsic types will always be loaded regardless of what `nostdlib`
says.


Being able to disable that can be useful in the compiler test to not be
polluted by some extra elements.
2024-04-18 20:51:52 +00:00
Timothee Guerin d290c17b5e
Update dependencies - april 2024 (#3169)
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
2024-04-15 10:24:38 -07:00
Timothee Guerin b4caac6425
Fix completion of keywords (#3151) 2024-04-12 23:55:59 +00:00
Timothee Guerin 35f5c90343
Migrate to eslint flat config (#3123)
resolve https://github.com/microsoft/typespec/issues/3121
same change in typespec-azure
https://github.com/Azure/typespec-azure/pull/620

## Single top level config
This makes it a little nicer to run as you know get the absolute path
for errors
No need to have the hacky rushstack dependency to allow using the same
shared config.

## Able to lint the projects that are outside of the pnpm workspace
<img width="1054" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/f88691d9-1bf2-4140-ba2b-533207b15f9d">


## Eslint 9 -no yet

eslint 9 was just released firday which makes this config the new
default however it does include breaking changes and not all our plugins
have updated
2024-04-08 09:58:19 -07:00
Timothee Guerin 6cae42529c
Fix playground wrong copy (#3126) 2024-04-06 00:24:04 +00:00
Timothee Guerin 51b2e57ac7
Pass compiler options for samples (#3124) 2024-04-05 15:00:39 -07:00
Timothee Guerin 0c1b96be47
Ci improvements (#3099)
- 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)
2024-04-03 16:19:59 -07:00
Timothee Guerin 2f53533d94
Bump versions for release 0.55.0 - april 2024 (#3096) 2024-04-02 14:55:47 -07:00
Timothee Guerin d4823c089b
Fix swagger ui build (#3091)
Missed that when doing the PR, the default import tries to load the
`path` library, recommendation is just to import the right bundle
directly.
2024-04-02 09:33:15 -07:00
Timothee Guerin cda7ccf4d9
Playground: Migrate from swagger-ui-react to swagger-ui-dist (#3089)
swagger-ui-react pull in all the swagger ui dependencies which is a bit
anyoing as they are mostly optional and with pnpm requires you to build
native dependencies.
2024-04-01 17:13:08 -07:00
Timothee Guerin 0dea649cd7
Update dependencies to resolve vulnerabilities and license issue (#3081)
- Remove unused rollup-plugin-dts dep that had problematic license
- Update dependencies to fix vulnerabilies
2024-03-29 21:22:06 +00:00
Timothee Guerin 743c4b0a39
Fix another set of accessibility issues (#3031) 2024-03-19 18:57:02 +00:00
Timothee Guerin 4199f83575
Upgrade dependencies march 2024 (#3027)
General update of all dependencies, notable
- typescript 5.4
- vitest 1.4
2024-03-18 10:52:06 -07:00
Timothee Guerin 7312314bcb
Remove old message burried in changelog (#2989) 2024-03-05 16:05:57 -08:00
Timothee Guerin 9881002f1c
Bump versions for release march 2024 (#2988) 2024-03-05 15:31:47 -08:00
Timothee Guerin 6a9c62ad24
Feature: Code fixes (#2888)
closes #615

## Code fixes added

### Suppress
![Kapture 2024-02-05 at 15 16
22](https://github.com/microsoft/typespec/assets/1031227/644014a3-9352-4bd4-b1b8-0d314c627405)

### `number` -> `float64` typo fix

![Kapture 2024-02-06 at 09 50
28](https://github.com/microsoft/typespec/assets/1031227/65b2e9aa-c510-440f-a1c6-7851611b65a2)

### Enum to extensible enum in typespec-azure

https://github.com/Azure/typespec-azure/pull/258

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
2024-03-05 11:51:21 -08:00
Timothee Guerin 753ca1ad9b
Improvement to the import auto complete (#2936)
- fix #2481 Autocomplete directive names
- Stop crashing when completing invalid dir
- Autocompleting dir with non letter char (e.g. `-`) will autocomplete
correctly
- Playground autocomplete imports
<img width="579" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/08e9e516-6472-4ab2-b3a5-30b4a8ce722d">
2024-02-20 13:49:56 -08:00
Timothee Guerin 7452fe9a57
Update dependencies - feb 2024 (#2900)
General dependency updates, notable:
- typescript 5.3
- chronus 0.6.0 (BREAKING  THE CHANGELOG FORMAT)
2024-02-08 15:14:01 -08:00
Timothee Guerin 173c0de73c
Merge hotfix back into main (#2899) 2024-02-08 11:37:38 -08:00
Timothee Guerin ad74773b53
Bump version for February release (#2890) 2024-02-06 16:14:38 -08:00
Timothee Guerin be9f6d8145
Rename references from microsoft.github.io/typespec to typespec.io (#2858)
All reference but the README as it is being rewritten here
https://github.com/microsoft/typespec/pull/2855
2024-01-30 12:58:42 -08:00
Jordan Danford 9f556004ec
Clean up capitalization, parentheses, and phrasing in docs (#2817)
I updated library documentation links
(https://microsoft.github.io/typespec/libraries =>
https://typespec.io/docs/libraries), should I update the other
https://microsoft.github.io links as well?
2024-01-25 10:40:16 -08:00
dependabot[bot] 5b44d6e52d
Bump vite from 5.0.10 to 5.0.12 (#2825)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite)
from 5.0.10 to 5.0.12.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/vitejs/vite/blob/v5.0.12/packages/vite/CHANGELOG.md">vite's
changelog</a>.</em></p>
<blockquote>
<h2><!-- raw HTML omitted -->5.0.12 (2024-01-19)<!-- raw HTML omitted
--></h2>
<ul>
<li>fix: await <code>configResolved</code> hooks of worker plugins (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15597">#15597</a>)
(<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15605">#15605</a>)
(<a href="https://github.com/vitejs/vite/commit/ef89f80">ef89f80</a>),
closes <a
href="https://redirect.github.com/vitejs/vite/issues/15597">#15597</a>
<a
href="https://redirect.github.com/vitejs/vite/issues/15605">#15605</a></li>
<li>fix: fs deny for case insensitive systems (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15653">#15653</a>)
(<a href="https://github.com/vitejs/vite/commit/91641c4">91641c4</a>),
closes <a
href="https://redirect.github.com/vitejs/vite/issues/15653">#15653</a></li>
</ul>
<h2><!-- raw HTML omitted -->5.0.11 (2024-01-05)<!-- raw HTML omitted
--></h2>
<ul>
<li>fix: don't pretransform classic script links (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15361">#15361</a>)
(<a href="https://github.com/vitejs/vite/commit/19e3c9a">19e3c9a</a>),
closes <a
href="https://redirect.github.com/vitejs/vite/issues/15361">#15361</a></li>
<li>fix: inject <code>__vite__mapDeps</code> code before sourcemap file
comment (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15483">#15483</a>)
(<a href="https://github.com/vitejs/vite/commit/d2aa096">d2aa096</a>),
closes <a
href="https://redirect.github.com/vitejs/vite/issues/15483">#15483</a></li>
<li>fix(assets): avoid splitting <code>,</code> inside base64 value of
<code>srcset</code> attribute (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15422">#15422</a>)
(<a href="https://github.com/vitejs/vite/commit/8de7bd2">8de7bd2</a>),
closes <a
href="https://redirect.github.com/vitejs/vite/issues/15422">#15422</a></li>
<li>fix(html): handle offset magic-string slice error (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15435">#15435</a>)
(<a href="https://github.com/vitejs/vite/commit/5ea9edb">5ea9edb</a>),
closes <a
href="https://redirect.github.com/vitejs/vite/issues/15435">#15435</a></li>
<li>chore(deps): update dependency strip-literal to v2 (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15475">#15475</a>)
(<a href="https://github.com/vitejs/vite/commit/49d21fe">49d21fe</a>),
closes <a
href="https://redirect.github.com/vitejs/vite/issues/15475">#15475</a></li>
<li>chore(deps): update tj-actions/changed-files action to v41 (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15476">#15476</a>)
(<a href="https://github.com/vitejs/vite/commit/2a540ee">2a540ee</a>),
closes <a
href="https://redirect.github.com/vitejs/vite/issues/15476">#15476</a></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="ee81e19676"><code>ee81e19</code></a>
release: v5.0.12</li>
<li><a
href="91641c4da0"><code>91641c4</code></a>
fix: fs deny for case insensitive systems (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15653">#15653</a>)</li>
<li><a
href="ef89f8092f"><code>ef89f80</code></a>
fix: await <code>configResolved</code> hooks of worker plugins (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15597">#15597</a>)
(<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15605">#15605</a>)</li>
<li><a
href="b44c49302f"><code>b44c493</code></a>
release: v5.0.11</li>
<li><a
href="d2aa0969ee"><code>d2aa096</code></a>
fix: inject <code>__vite__mapDeps</code> code before sourcemap file
comment (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15483">#15483</a>)</li>
<li><a
href="2a540eee82"><code>2a540ee</code></a>
chore(deps): update tj-actions/changed-files action to v41 (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15476">#15476</a>)</li>
<li><a
href="5ea9edbc9c"><code>5ea9edb</code></a>
fix(html): handle offset magic-string slice error (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15435">#15435</a>)</li>
<li><a
href="49d21fe1fe"><code>49d21fe</code></a>
chore(deps): update dependency strip-literal to v2 (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15475">#15475</a>)</li>
<li><a
href="8de7bd2b68"><code>8de7bd2</code></a>
fix(assets): avoid splitting <code>,</code> inside base64 value of
<code>srcset</code> attribute (#...</li>
<li><a
href="19e3c9a8a1"><code>19e3c9a</code></a>
fix: don't pretransform classic script links (<a
href="https://github.com/vitejs/vite/tree/HEAD/packages/vite/issues/15361">#15361</a>)</li>
<li>See full diff in <a
href="https://github.com/vitejs/vite/commits/v5.0.12/packages/vite">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=vite&package-manager=npm_and_yarn&previous-version=5.0.10&new-version=5.0.12)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/typespec/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-24 21:57:59 +00:00
Timothee Guerin 842405e8d1
Get rid of rush and move to pnpm (#2775)
Remove the opinionated (wrongly so most of the time) middleman that
brings more config pain than value.

Things to check:
- [x] Parallel build performance vs rush
- [ ] Publishing with submodule
- [x] Changesets
2024-01-24 13:37:34 -08:00
Mark Cowlishaw 345cd594da
Prepare Publish for January Release (#2816) 2024-01-24 11:14:23 -08:00
Timothee Guerin 55ea44250d
Vitest improvements: vitest-ui, watch mode for deps, debug config (#2791)
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
2024-01-22 09:56:55 -08:00
Timothee Guerin 0d5be4f6c9
playground more generic file bug mechanism (#2807)
fix #2803
2024-01-19 14:56:43 -08:00
Timothee Guerin 5af94f0762
Website public beta (#2418)
This is a feature branch containing the progress for the website

URL: https://tspwebsitepr.z22.web.core.windows.net/prs/2418/
2024-01-19 09:42:25 -08:00
Timothee Guerin 563df8bd2a
Fixes to the playground usage (#2750)
Add `styles.css` exports as an altenative to `style.css` as this name
makes more sense and is what the README.md documents
2024-01-04 10:00:40 -08:00
Timothee Guerin 9c7bf80187
Migrate test framework to vitest (#2769)
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
2024-01-02 11:40:29 -08:00
Timothee Guerin da99aa955b
Detach linter from `$lib` and add state declaration to `$lib` (#2773)
fix #2301 

## Deteach the linter from `$lib`

Having the linter rules defined in `$lib` caused this circular reference
where the rules would call to some accessor that needed the $lib
diagnostics.

With this we keep $lib as manifest and helper functions only.

## Add state key declaration
```ts
export const internalLib = createTypeSpecLibrary({
 state: {
    authentication: { description: "State for the @auth decorator" },
    header: { description: "State for the @header decorator" },
    ...
});

// use with StateKeys.authentication
```
2023-12-22 17:27:00 -08:00