Skip to content

Add Tests #124

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
161 changes: 161 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
---
Language: Cpp
BasedOnStyle: Google
AccessModifierOffset: -2
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: false
AlignConsecutiveShortCaseStatements:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignCaseColons: false
AlignEscapedNewlines: LeftWithLastLine
AlignOperands: AlignAfterOperator
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowBreakBeforeNoexceptSpecifier: OnlyWithParen
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
#AllowShortNamespacesOnASingleLine: false
AlwaysBreakBeforeMultilineStrings: true
BinPackArguments: false
BinPackParameters: OnePerLine
BitFieldColonSpacing: Both
BraceWrapping:
AfterClass: false
AfterCaseLabel: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: true
BeforeElse: true
BeforeWhile: false
IndentBraces: false
BreakAdjacentStringLiterals: true
BreakAfterAttributes: Leave
BreakAfterReturnType: None
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Custom # or else brace wrapping won't be used
BreakBeforeConceptDeclarations: Allowed
#BreakBeforeTemplateCloser: true
BreakBeforeTernaryOperators: true
BreakBinaryOperations: RespectPrecedence
BreakConstructorInitializers: BeforeComma
BreakFunctionDefinitionParameters: false
BreakInheritanceList: BeforeComma
BreakStringLiterals: true
BreakTemplateDeclarations: Yes
ColumnLimit: 120
CompactNamespaces: false # should use namespace a::b
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: false
ForEachMacros: [ FOR_EACH_RANGE, FOR_EACH, ]
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<[^\.]+>$' # standard library imports (without .)
Priority: 1
- Regex: '^<.*\.h(pp)?>'
Priority: 2
- Regex: '^<.*'
Priority: 3
- Regex: '.*'
Priority: 4
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: Indent
#IndentExportBlock: Indent
IndentGotoLabels: false
IndentPPDirectives: BeforeHash
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: true
InsertNewlineAtEOF: true
InsertTrailingCommas: Wrapped
IntegerLiteralSeparator:
Binary: 4
BinaryMinDigits: 5
Decimal: 3
DecimalMinDigits: 5
Hex: 4
HexMinDigits: 5
KeepEmptyLines:
AtEndOfFile: false
AtStartOfBlock: false
AtStartOfFile: false
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PackConstructorInitializers: NextLine
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
#QualifierOrder: [inline, static, type, const, volatile]
ReferenceAlignment: Left
ReflowComments: true
#RemoveEmptyLinesInUnwrappedLines: true
RequiresClausePosition: OwnLine
SeparateDefinitionBlocks: Leave
SortIncludes: CaseSensitive
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 3
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Custom
SpacesInParensOptions:
ExceptDoubleParentheses: true
InConditionalStatements: false
InCStyleCasts: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: c++20
TabWidth: 4
UseTab: Never
#WrapNamespaceBodyWithEmptyLines: true
75 changes: 75 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Checks: >
-*,
boost-*,
bugprone-*,
cppcoreguidelines-*,
clang-analyzer-*,
concurrency-*,
misc-*,
modernize-*,
performance-*,
portability-*,
readability-*,
-misc-non-private-member-variables-in-classes,
-readability-named-parameter,
-readability-braces-around-statements,
-readability-magic-numbers

# Turn all the warnings from the checks above into errors.
WarningsAsErrors: "*"

HeaderFileExtensions:
- h
- hpp
- hh
- hxx

ImplementationFileExtensions:
- c
- cpp
- cxx
- cc

FormatStyle: file

CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.ConceptCase, value: CamelCase }
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
- { key: readability-identifier-naming.VariableCase, value: camelBack }
- { key: readability-identifier-naming.MemberCase, value: camelBack }
- { key: readability-identifier-naming.ClassMemberCase, value: CamelCase }
- { key: readability-identifier-naming.PrivateMemberPrefix, value: _ }
- { key: readability-identifier-naming.ProtectedMemberPrefix, value: _ }
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
- { key: readability-identifier-naming.EnumConstantPrefix, value: k }
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
- { key: readability-identifier-naming.ConstexprVariablePrefix, value: '' }
- { key: readability-identifier-naming.GlobalConstantCase, value: CamelCase }
- { key: readability-identifier-naming.GlobalConstantPrefix, value: k }
- { key: readability-identifier-naming.MemberConstantCase, value: CamelCase }
- { key: readability-identifier-naming.MemberConstantPrefix, value: k }
- { key: readability-identifier-naming.StaticConstantCase, value: CamelCase }
- { key: readability-identifier-naming.StaticConstantPrefix, value: k }
- key: readability-identifier-naming.ConstantPointerParameterSuffix
value: 'Ptr'
- key: readability-identifier-naming.GlobalConstantPointerParameterSuffix
value: 'Ptr'
- key: readability-identifier-naming.GlobalPointerParameterSuffix
value: 'Ptr'
- key: readability-identifier-naming.LocalConstantPointerParameterSuffix
value: 'Ptr'
- key: readability-identifier-naming.LocalPointerParameterSuffix
value: 'Ptr'
- key: readability-identifier-naming.ConstantPointerParameterSuffix
value: 'Ptr'
- key: readability-identifier-naming.PointerParameterSuffix
value: 'Ptr'
- { key: readability-identifier-naming.PrivateMemberHungarianPrefix, value: _ }
- { key: readability-identifier-naming.ProtectedMemberHungarianPrefix, value: _ }
- key: cppcoreguidelines-special-member-functions.AllowImplicitlyDeletedCopyOrMove
value: false
6 changes: 3 additions & 3 deletions apps/example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1586,7 +1586,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- ReactNativePolygen (0.1.0):
- ReactNativePolygen (0.2.0):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1986,8 +1986,8 @@ SPEC CHECKSUMS:
ReactCodegen: 3982de3211b80e119d9daa9cd6af090d75cb8e90
ReactCommon: 6a952e50c2a4b694731d7682aaa6c79bc156e4ad
ReactNativeHost: a27bb5af1c4d73dd3e80cc7ce295407f414e0e8c
ReactNativePolygen: 275c42cfd65cc094d7f77295ae109b8a91b206ed
ReactNativeWebAssemblyHost: 4a79eb4721d78db2bff7018ef81c301b4417c742
ReactNativePolygen: 5236e21326c11204e935ed4e44736b7178c2628c
ReactNativeWebAssemblyHost: cc689d810f1b4540a12906988768c489dcbe9ab3
ReactTestApp-DevSupport: 42abce6b0c88dfb47c86e80aa22831b2abcc3144
ReactTestApp-Resources: 7db90c026cccdf40cfa495705ad436ccc4d64154
RNGestureHandler: 0e5ae8d72ef4afb855e98dcdbe60f27d938abe13
Expand Down
4 changes: 3 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"**/.turbo",
"docs/out",
"**/.next",
"test-runner/",
".changeset/config.json",
".yarn"
]
Expand Down Expand Up @@ -65,7 +66,8 @@
"useCollapsedElseIf": "off",
"useConsistentBuiltinInstantiation": "warn",
"useDefaultSwitchClause": "off",
"useSingleVarDeclarator": "off"
"useSingleVarDeclarator": "off",
"useImportType": "warn"
},
"suspicious": {
"noCatchAssign": "warn",
Expand Down
2 changes: 1 addition & 1 deletion docs/app/docs/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';
import { DocsLayout, DocsLayoutProps } from 'fumadocs-ui/layouts/notebook';
import { DocsLayout, type DocsLayoutProps } from 'fumadocs-ui/layouts/notebook';
import type { ReactNode } from 'react';

const docsOptions: DocsLayoutProps = {
Expand Down
2 changes: 1 addition & 1 deletion docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import './globals.css';
import { RootProvider } from 'fumadocs-ui/provider';
import { Metadata } from 'next';
import type { Metadata } from 'next';
import { Inter } from 'next/font/google';
import type { ReactNode } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion docs/components/DocTable.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fs from 'node:fs/promises';
import {
FunctionSymbolDocumentation,
type FunctionSymbolDocumentation,
generateDocumentation,
} from '@/lib/ts-documentation';
import { cva } from 'class-variance-authority';
Expand Down
2 changes: 1 addition & 1 deletion docs/components/PrettyCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Link from 'fumadocs-core/link';
import { HTMLAttributes } from 'react';
import type { HTMLAttributes } from 'react';
import { twMerge as cn } from 'tailwind-merge';

export type PrettyCardProps = HTMLAttributes<HTMLElement> & {
Expand Down
2 changes: 1 addition & 1 deletion docs/components/ProsConsOverview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ThumbsDown, ThumbsUp } from 'lucide-react';
import { HTMLAttributes } from 'react';
import type { HTMLAttributes } from 'react';
import { twMerge as cn } from 'tailwind-merge';

export type ProsConsOverviewProps = HTMLAttributes<HTMLElement> & {
Expand Down
12 changes: 12 additions & 0 deletions packages/codegen/src/codegen-pipeline.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { cocoapods } from './pipeline/react-native/cocoapods.js';
import { metroResolver } from './pipeline/react-native/metro.js';
import { reactNativeTurboModule } from './pipeline/react-native/turbomodule.js';
import { embedWasmRuntime } from './pipeline/wasm2c-runtime.js';
import type { Plugin } from './plugin.js';

export const DEFAULT_PLUGINS: Plugin[] = [
cocoapods(),
metroResolver(),
reactNativeTurboModule(),
embedWasmRuntime(),
];
Loading
Loading