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

refactor: Split monolithic language files into dirs with component files #2564

Merged
merged 89 commits into from
May 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
6e557fe
standardise json formatting
inferrinizzard Mar 19, 2024
a7cec76
add file association for schema files
inferrinizzard Mar 19, 2024
6140704
Merge branch 'master' into chore/repo/eslint
inferrinizzard Apr 7, 2024
b2a7904
install eslint packages
inferrinizzard Apr 7, 2024
b97c2b2
add eslint config
inferrinizzard Apr 7, 2024
e504a8a
remove tslint
inferrinizzard Apr 7, 2024
92bd563
eslint autofix
inferrinizzard Apr 7, 2024
392838a
update eslint rules, eslintignore
inferrinizzard Apr 8, 2024
d9baf6e
add lint:fix script
inferrinizzard Apr 8, 2024
8bbabf1
update eslint rules, eslintignore
inferrinizzard Apr 8, 2024
f1d19aa
add lint:fix script
inferrinizzard Apr 8, 2024
994567e
add import rules
inferrinizzard Apr 8, 2024
d259874
add import rules
inferrinizzard Apr 8, 2024
291f5c9
update import rules
inferrinizzard Apr 12, 2024
03d8001
reduce excess style rules
inferrinizzard Apr 12, 2024
99dd240
downgrade remaining to warnings
inferrinizzard Apr 13, 2024
7f22254
fix enum values
inferrinizzard Apr 8, 2024
885b35a
add all missing accessibility modifiers
inferrinizzard Apr 11, 2024
f791721
fix nullish errors
inferrinizzard Apr 12, 2024
db9a9cf
update import rules
inferrinizzard Apr 12, 2024
3088be7
fix all require imports
inferrinizzard Apr 12, 2024
c492962
fix all imports
inferrinizzard Apr 12, 2024
a47609a
reduce excess style rules
inferrinizzard Apr 12, 2024
b536136
fix any types
inferrinizzard Apr 13, 2024
f0e7615
fix misc errors
inferrinizzard Apr 13, 2024
c0232f3
downgrade remaining to warnings
inferrinizzard Apr 13, 2024
59e877f
return types
inferrinizzard Apr 13, 2024
e5edac4
fix types errors
inferrinizzard Apr 13, 2024
0267ad0
Merge branch 'chore/repo/eslint' into chore/repo/eslint-fix
inferrinizzard Apr 13, 2024
130fe31
fix json import for test tsconfig
inferrinizzard Apr 13, 2024
37812f3
Merge branch 'master' into chore/repo/eslint
inferrinizzard Apr 14, 2024
e89f453
Merge branch 'chore/repo/eslint' into chore/repo/eslint-fix
inferrinizzard Apr 14, 2024
06002f9
auto lint fix
inferrinizzard Apr 14, 2024
93ab86e
fix lint errors in extension
inferrinizzard Apr 14, 2024
6a81618
Merge branch 'master' into chore/repo/eslint
inferrinizzard Apr 14, 2024
6ca4eaa
Merge branch 'chore/repo/eslint' into chore/repo/eslint-fix
inferrinizzard Apr 14, 2024
1ec5933
fix lint errors in Elixir
inferrinizzard Apr 14, 2024
4620ba5
make ref.pushElement public
inferrinizzard Apr 14, 2024
4fe1649
fix misc
inferrinizzard Apr 14, 2024
eed53c6
fix accidental public in CSharp raw text get
inferrinizzard Apr 14, 2024
a4989bf
Merge branch 'master' into chore/repo/eslint-fix
inferrinizzard Apr 30, 2024
8e6fc4f
fix new lint errors
inferrinizzard Apr 30, 2024
58cfc88
Merge branch 'chore/repo/eslint-fix' into base
inferrinizzard May 5, 2024
4e2d89d
rename ruby to Ruby
inferrinizzard Apr 13, 2024
4147039
move TypeScriptZod to own dir
inferrinizzard Apr 13, 2024
e8da600
move TypeScriptFlow to own dir
inferrinizzard Apr 13, 2024
d1a5a5d
move TypeScriptEffectSchema to own dir
inferrinizzard Apr 13, 2024
fac0462
make forbiddenNamesForGlobalNamespace return readonly
inferrinizzard Apr 13, 2024
bb5c2e8
fixup! move TypeScriptEffectSchema to own dir
inferrinizzard Apr 13, 2024
b7d5630
move Swift to own dir
inferrinizzard Apr 13, 2024
aa4d99d
move Smithy4s to own dir
inferrinizzard Apr 13, 2024
2a3fb7c
move Scala3 to own dir
inferrinizzard Apr 13, 2024
748e45d
move Rust to own dir
inferrinizzard Apr 13, 2024
5d2768e
split Ruby into new structure
inferrinizzard Apr 13, 2024
fdef01e
move Python to own dir
inferrinizzard Apr 13, 2024
df9a4cc
move Pike to own dir
inferrinizzard Apr 13, 2024
a62c9de
move Php to own dir
inferrinizzard Apr 13, 2024
1fa8f35
move Objective-C to own dir
inferrinizzard Apr 13, 2024
a9fd2c1
move Kotlin to own dir
inferrinizzard Apr 13, 2024
667c4f0
move JSONSchema to own dir
inferrinizzard Apr 13, 2024
3be73ac
move JavaScript to own dir, add unicodeMaps
inferrinizzard Apr 13, 2024
5d4fbce
move JavaScriptPropTypes to own dir
inferrinizzard Apr 13, 2024
097ea32
move Java to own dir
inferrinizzard Apr 13, 2024
96f0901
move Haskell to own dir
inferrinizzard Apr 13, 2024
6bf4a11
move Golang to own dir
inferrinizzard Apr 13, 2024
2609b3c
move Elm to own dir
inferrinizzard Apr 13, 2024
59e2da2
move Dart to own dir
inferrinizzard Apr 13, 2024
a316b49
move CSharp to own dir
inferrinizzard Apr 13, 2024
7803d6b
move Crystal to own dir
inferrinizzard Apr 13, 2024
af18056
move CPlusPlus to own dir
inferrinizzard Apr 13, 2024
73efd20
move CJSON to own dir
inferrinizzard Apr 13, 2024
dc030b8
fixup! move Golang to own dir
inferrinizzard Apr 13, 2024
580b6a3
fixup! move JavaScriptPropTypes to own dir
inferrinizzard Apr 13, 2024
3b84775
fixup! move JavaScript to own dir, add unicodeMaps
inferrinizzard Apr 13, 2024
541e668
update reexports
inferrinizzard Apr 13, 2024
fe4934d
fix types errors
inferrinizzard Apr 13, 2024
ef431d5
fix broken imports
inferrinizzard Apr 13, 2024
6965905
update test/languages
inferrinizzard Apr 13, 2024
0c50d86
move Elixir to own dir
inferrinizzard Apr 14, 2024
920104b
:recycle:
inferrinizzard Apr 14, 2024
d3a15e7
imported wrong stringEscape for ruby
inferrinizzard Apr 14, 2024
5b1fac0
fix wrong stringEscapes
inferrinizzard Apr 14, 2024
a22b393
fix lint errors
inferrinizzard May 5, 2024
0bec808
fix dep cycle for CSharp
inferrinizzard May 5, 2024
a54d7d5
fix dep cycle for ObjectiveC
inferrinizzard May 5, 2024
0f97dc6
fix dep cycle for Ruby
inferrinizzard May 5, 2024
e8b3dfb
fix dep cycle for Rust
inferrinizzard May 5, 2024
a2462e8
Merge branch 'master' into refactor/imports/languages
inferrinizzard May 12, 2024
a188f79
:recycle: fix imports
inferrinizzard May 12, 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
2 changes: 1 addition & 1 deletion packages/quicktype-core/src/ConvenienceRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export abstract class ConvenienceRenderer extends Renderer {
* that can conflict with that, such as reserved keywords or common type
* names.
*/
protected forbiddenNamesForGlobalNamespace(): string[] {
protected forbiddenNamesForGlobalNamespace(): readonly string[] {
return [];
}

Expand Down
2 changes: 1 addition & 1 deletion packages/quicktype-core/src/Naming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export class DependencyName extends Name {
}
}

export function keywordNamespace(name: string, keywords: string[]): Namespace {
export function keywordNamespace(name: string, keywords: readonly string[]): Namespace {
const ns = new Namespace(name, undefined, [], []);
for (const kw of keywords) {
ns.add(new FixedName(kw));
Expand Down
33 changes: 1 addition & 32 deletions packages/quicktype-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,35 +84,4 @@ export { removeNullFromUnion, matchType, nullableFromUnion } from "./TypeUtils";
export { ConvenienceRenderer } from "./ConvenienceRenderer";
export { uriTypeAttributeKind } from "./attributes/URIAttributes";

export { CJSONTargetLanguage, CJSONRenderer, cJSONOptions } from "./language/CJSON";
export { CPlusPlusTargetLanguage, CPlusPlusRenderer, cPlusPlusOptions } from "./language/CPlusPlus";
export { CSharpTargetLanguage, cSharpOptions, CSharpRenderer } from "./language/CSharp";
export { PythonTargetLanguage, PythonRenderer, pythonOptions } from "./language/Python";
export { GoTargetLanguage, GoRenderer, goOptions } from "./language/Golang";
export { ObjectiveCTargetLanguage, ObjectiveCRenderer, objcOptions } from "./language/Objective-C";
export { JavaTargetLanguage, JavaRenderer, javaOptions } from "./language/Java";
export { JavaScriptTargetLanguage, JavaScriptRenderer, javaScriptOptions } from "./language/JavaScript";
export {
JavaScriptPropTypesTargetLanguage,
JavaScriptPropTypesRenderer,
javaScriptPropTypesOptions
} from "./language/JavaScriptPropTypes";
export {
TypeScriptTargetLanguage,
TypeScriptRenderer,
FlowTargetLanguage,
FlowRenderer,
tsFlowOptions
} from "./language/TypeScriptFlow";
export { SwiftTargetLanguage, SwiftRenderer, swiftOptions } from "./language/Swift";
export { KotlinTargetLanguage, KotlinRenderer, kotlinOptions } from "./language/Kotlin";
export { Scala3TargetLanguage, Scala3Renderer, scala3Options } from "./language/Scala3";
export { SmithyTargetLanguage, Smithy4sRenderer, SmithyOptions } from "./language/Smithy4s";
export { ElmTargetLanguage, ElmRenderer, elmOptions } from "./language/Elm";
export { JSONSchemaTargetLanguage, JSONSchemaRenderer } from "./language/JSONSchema";
export { RustTargetLanguage, RustRenderer, rustOptions } from "./language/Rust";
export { RubyTargetLanguage, RubyRenderer, rubyOptions } from "./language/ruby";
export { CrystalTargetLanguage, CrystalRenderer } from "./language/Crystal";
export { HaskellTargetLanguage, HaskellRenderer, haskellOptions } from "./language/Haskell";
export { DartTargetLanguage, DartRenderer, dartOptions } from "./language/Dart";
export { ElixirTargetLanguage, ElixirRenderer, elixirOptions } from "./language/Elixir";
export * from "./language";
40 changes: 20 additions & 20 deletions packages/quicktype-core/src/language/All.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { ObjectiveCTargetLanguage } from "./Objective-C";
import { PhpTargetLanguage } from "./Php";
import { PikeTargetLanguage } from "./Pike";
import { PythonTargetLanguage } from "./Python";
import { RubyTargetLanguage } from "./ruby";
import { RubyTargetLanguage } from "./Ruby";
import { RustTargetLanguage } from "./Rust";
import { Scala3TargetLanguage } from "./Scala3";
import { SmithyTargetLanguage } from "./Smithy4s";
Expand All @@ -31,33 +31,33 @@ import { FlowTargetLanguage, TypeScriptTargetLanguage } from "./TypeScriptFlow";
import { TypeScriptZodTargetLanguage } from "./TypeScriptZod";

export const all: TargetLanguage[] = [
new CSharpTargetLanguage(),
new GoTargetLanguage(),
new RustTargetLanguage(),
new CrystalTargetLanguage(),
new CJSONTargetLanguage(),
new CPlusPlusTargetLanguage(),
new ObjectiveCTargetLanguage(),
new CrystalTargetLanguage(),
new CSharpTargetLanguage(),
new DartTargetLanguage(),
new ElixirTargetLanguage(),
new ElmTargetLanguage(),
new FlowTargetLanguage(),
new GoTargetLanguage(),
new HaskellTargetLanguage(),
new JavaTargetLanguage(),
new TypeScriptTargetLanguage(),
new JavaScriptTargetLanguage(),
new JavaScriptPropTypesTargetLanguage(),
new FlowTargetLanguage(),
new SwiftTargetLanguage(),
new Scala3TargetLanguage(),
new SmithyTargetLanguage(),
new KotlinTargetLanguage(),
new ElmTargetLanguage(),
new JSONSchemaTargetLanguage(),
new RubyTargetLanguage(),
new DartTargetLanguage(),
new PythonTargetLanguage("Python", ["python", "py"], "py"),
new KotlinTargetLanguage(),
new ObjectiveCTargetLanguage(),
new PhpTargetLanguage(),
new PikeTargetLanguage(),
new HaskellTargetLanguage(),
new TypeScriptZodTargetLanguage(),
new PythonTargetLanguage("Python", ["python", "py"], "py"),
new RubyTargetLanguage(),
new RustTargetLanguage(),
new Scala3TargetLanguage(),
new SmithyTargetLanguage(),
new SwiftTargetLanguage(),
new TypeScriptTargetLanguage(),
new TypeScriptEffectSchemaTargetLanguage(),
new ElixirTargetLanguage(),
new PhpTargetLanguage()
new TypeScriptZodTargetLanguage()
];

export function languageNamed(name: string, targetLanguages?: TargetLanguage[]): TargetLanguage | undefined {
Expand Down
Loading
Loading