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

[compiler] Enum-driven visibility #4825

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c1667c2
WIP
willmtemple Sep 22, 2024
8f6beed
Merge remote-tracking branch 'upstream/main' into witemple-msft/visib…
willmtemple Sep 26, 2024
7ac53e5
WIP
willmtemple Oct 10, 2024
fc849f7
Nearly code complete
willmtemple Oct 22, 2024
3115040
Merge remote-tracking branch 'upstream/main' into witemple-msft/visib…
willmtemple Oct 22, 2024
b6f893c
Fix issue with resource create operations
willmtemple Oct 28, 2024
c883c9f
Merge remote-tracking branch 'upstream/main' into witemple-msft/visib…
willmtemple Oct 28, 2024
c68c2c9
Fix circular reference issue
timotheeguerin Oct 28, 2024
b06b4da
Implement visibility transform decorators
willmtemple Oct 29, 2024
649e5e4
Merge remote-tracking branch 'origin/witemple-msft/visibility-enum' i…
willmtemple Oct 29, 2024
50743ca
Lint/format
willmtemple Oct 30, 2024
62dfafb
Clean API surface
willmtemple Oct 30, 2024
35d8400
Test new core visibility functionality.
willmtemple Oct 30, 2024
1145808
Format
willmtemple Oct 30, 2024
f6930b1
Test legacy visibility string coercion in core APIs.
willmtemple Oct 30, 2024
b26a77e
Fix an issue with recursive transforms
willmtemple Oct 30, 2024
5b1705c
Fix issue with module instancing for tests, allowing running mutators…
willmtemple Oct 31, 2024
37a2941
Actually fix visibility transform mutators and consolidate implementa…
willmtemple Nov 1, 2024
8f3cce5
Separate mutators into model/property
willmtemple Nov 1, 2024
2f18683
Finally, realy fix the mutator
willmtemple Nov 1, 2024
bc9b464
Lint/format
willmtemple Nov 1, 2024
660e1a3
Merge remote-tracking branch 'upstream/main' into witemple-msft/visib…
willmtemple Nov 1, 2024
f013701
Revert change to openapi visibility computation
willmtemple Nov 4, 2024
e0c677e
Merge remote-tracking branch 'upstream/main' into witemple-msft/visib…
willmtemple Nov 4, 2024
7f88db0
satisfy vitest obsession with circular module imports
willmtemple Nov 4, 2024
d1b4c70
Enhance mutator to walk more indirect types.
willmtemple Nov 6, 2024
d77ace7
Add visibility reference documentation
willmtemple Nov 6, 2024
3872973
Merge remote-tracking branch 'upstream/main' into witemple-msft/visib…
willmtemple Nov 6, 2024
bc5320a
Update generated-defs
willmtemple Nov 6, 2024
acc25c0
Chronus
willmtemple Nov 6, 2024
e7d92bc
Chronus 2
willmtemple Nov 6, 2024
4ce30a5
fix chronus
willmtemple Nov 6, 2024
436627b
Merge remote-tracking branch 'upstream/main' into witemple-msft/visib…
willmtemple Nov 6, 2024
3cf29bc
JSDoc improvement
willmtemple Nov 6, 2024
a584fcb
Improve legacy backcompat for empty @visibility decorator
willmtemple Nov 7, 2024
6f00136
Merge remote-tracking branch 'upstream/main' into witemple-msft/visib…
willmtemple Nov 7, 2024
e85bda6
Allow recasting legacy visibility through explicitly calling $visibil…
willmtemple Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- "@typespec/compiler"
---

Adds support for enum-driven visibility in the compiler core.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
changeKind: internal
packages:
- "@typespec/http"
- "@typespec/openapi"
---

Mask deprecation on getVisibility
5 changes: 4 additions & 1 deletion packages/compiler/.scripts/gen-extern-signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ for (const [namespace, diagnostics] of resolved) {

const files = await generateExternDecorators(program, "@typespec/compiler", { namespaces });
for (const [name, content] of Object.entries(files)) {
const updatedContent = content.replace(/from "\@typespec\/compiler"/g, `from "../src/index.js"`);
const updatedContent = content.replace(
/from "\@typespec\/compiler"/g,
name.endsWith(".ts-test.ts") ? `from "../src/index.js"` : `from "../src/core/index.js"`,
);
const prettierConfig = await resolveConfig(root);

await NodeHost.writeFile(
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/generated-defs/TypeSpec.Prototypes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { DecoratorContext, Type } from "../src/index.js";
import type { DecoratorContext, Type } from "../src/core/index.js";

export type GetterDecorator = (context: DecoratorContext, target: Type) => void;

Expand Down
Loading
Loading