Skip to content

Commit

Permalink
Fix examples types
Browse files Browse the repository at this point in the history
  • Loading branch information
alabsi91 committed Nov 3, 2023
1 parent 624425c commit ea2964c
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 12 deletions.
16 changes: 16 additions & 0 deletions Example/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
module.exports = {
root: true,
extends: '@react-native',
rules: {
'prefer-const': 1,
'@typescript-eslint/consistent-type-imports': 1,
'@typescript-eslint/no-non-null-assertion': 0,
'react-native/no-inline-styles': 0,
'react-native/no-single-element-style-arrays': 1,
'react-native/no-unused-styles': 1,
'react-hooks/exhaustive-deps': 0,
'react/no-unstable-nested-components': 0,
'prettier/prettier': 1,
'jsx-quotes': 0,
curly: 0,
'no-shadow': 0,
'no-bitwise': 0,
'object-shorthand': 1,
},
};
7 changes: 0 additions & 7 deletions Example/.prettierrc.js

This file was deleted.

16 changes: 16 additions & 0 deletions Example/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"arrowParens": "avoid",
"printWidth": 130,
"jsxSingleQuote": true,
"semi": true,
"bracketSpacing": true,
"bracketSameLine": false,
"endOfLine": "auto",
"singleQuote": true,
"overrides": [
{
"files": "*.map",
"options": { "parser": "json" }
}
]
}
9 changes: 8 additions & 1 deletion Example/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"extends": "@tsconfig/react-native/tsconfig.json"
"extends": "@tsconfig/react-native/tsconfig.json",
"compilerOptions": {
"paths": {
"baseUrl": ["."],
"reanimated-color-picker": ["../src/index"]
}
},
"references": [{ "path": "../tsconfig.json" }]
}
41 changes: 40 additions & 1 deletion ExampleExpo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions ExampleExpo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"react-dom": "18.2.0",
"react-native-web": "~0.19.6",
"react-native-reanimated": "~3.3.0",
"reanimated-color-picker": "file:..",
"react-native-gesture-handler": "~2.12.0"
},
"devDependencies": {
Expand Down
6 changes: 4 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ async function cleanOutDirectory() {

/** Build TypeScript declaration files. */
async function buildTypescript() {
await execPromise(`npx tsc --declarationDir ${declarationOutDir} --emitDeclarationOnly --declaration --declarationMap`);
await execPromise(
`npx tsc --declarationDir ${declarationOutDir} --composite false --emitDeclarationOnly --declaration --declarationMap`
);
await resolveTsPaths({ out: declarationOutDir }); // Resolve import aliases to their corresponding actual paths.
}

Expand All @@ -45,7 +47,7 @@ async function buildCommonJs() {

/** Compile the source file using the TypeScript compiler. */
async function buildSource() {
await execPromise(`npx tsc --outDir ${srcOutDir}`);
await execPromise(`npx tsc --outDir ${srcOutDir} --composite false --declaration false`);
await resolveTsPaths({ out: srcOutDir }); // Resolve import aliases to their corresponding actual paths.
await fs.cp(path.join(sourceDir, assetsDir), path.join(srcOutDir, assetsDir), { recursive: true });
}
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"@types": ["src/types"]
},
"noEmit": false,
"declaration": false,
"composite": true,
"declaration": true,
"module": "ESNext",
"target": "ESNext",
"isolatedModules": true,
Expand Down

0 comments on commit ea2964c

Please sign in to comment.