-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Re-structure project to use global ESLint, Prettier and Typesc…
…ript configs (#267) * chore: re-structure eslint, prettier and typescript * chore: update scripts and deps * chore(deps): add global typescript dep * fix: TS * fix: eslint * fix: run eslint * fix: update global bun lint script * chore: update nitrogen dependency to nitro-modules on release * fix: builder-bob in lib * chore: update bun.lockb * fix: bootstrap script * chore: update scripts * fix: builder-bob tsconfig * chore: add nitrogen prepare script * fix: postinstall and build scripts * update release config * chore: revert version change * fix: invalid package name * chore: specs script should not run for all bun workspaces * chore(deps): update bun.lockb * chore: move .clang-format file back to root (GH action will fail otherwise) * fix: missing slash * fix: specs script * fix: clang format path * fix: nitrogen ci * chore: udpate nitrogen gh workflow * fix: use bunx in CI instead of bun * chore(deps): add typescript dev dependency in nitro-image * Revert "chore(deps): add typescript dev dependency in nitro-image" This reverts commit b60eab1. * chore(deps): update bun.lockb * chore: allow diffing bun.lockb * Revert "chore(deps): update bun.lockb" This reverts commit 69d41a5. * fix: capitalize for consistency * fix: add ignore files to eslintrc * chore: add nitro-modules to peerDeps * chore: simplify example tsconfig * fix: workspace build * fix: typescript pipeline * fix: linting * chore(deps): update typescript eslint deps * chore: don't run bootstrap on install * fix: remove ignorePattern in nitro.json * Revert "fix: remove ignorePattern in nitro.json" This reverts commit fe21f0e. * chore: add path to rn nitro modules in image * Revert "chore: add path to rn nitro modules in image" This reverts commit cf6e8fb. * disable noEmit manuallc * fix: Podfile.lock * chore: simplify eslint config * chore: build packages before running nitro-codegen * fix: nitrogen workflow build * trigger workflow * reverse dummy change * fix: update example pods during release * fix: update release hooks * chore: update bootstrap script * chore(deps): update bun.lockb * fix: update nitro-image specs * fix: revert nitrogen specs changes * fix: Replace `bunx` with `bun` again * Update Podfile.lock * chore: Rename modules to nitro * Update package.json * Update run-nitrogen.yml * chore: Rename `check-all` to `lint-cpp` --------- Co-authored-by: Marc Rousavy <[email protected]>
- Loading branch information
1 parent
38ad53f
commit 2cead7f
Showing
25 changed files
with
267 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.lockb binary diff=lockb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@react-native', 'plugin:prettier/recommended'], | ||
ignorePatterns: [ | ||
'**/node_modules', | ||
'**/lib', | ||
'**/.eslintrc.js', | ||
'**/.prettierrc.js', | ||
'**/jest.config.js', | ||
'**/babel.config.js', | ||
'**/metro.config.js', | ||
'**/react-native.config.js', | ||
'**/tsconfig.json' | ||
], | ||
plugins: ['@typescript-eslint', 'prettier'], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: true, | ||
tsconfigRootDir: __dirname, | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
}, | ||
rules: { | ||
'prettier/prettier': [ | ||
'warn', | ||
{ | ||
quoteProps: 'consistent', | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'es5', | ||
useTabs: false, | ||
semi: false, | ||
}, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"exclude": [ | ||
"**/node_modules", | ||
"**/lib", | ||
"**/.eslintrc.js", | ||
"**/.prettierrc.js", | ||
"**/jest.config.js", | ||
"**/babel.config.js", | ||
"**/metro.config.js", | ||
"**/tsconfig.json" | ||
], | ||
"compilerOptions": { | ||
"composite": true, | ||
"allowUnreachableCode": false, | ||
"allowUnusedLabels": false, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"lib": ["ESNext"], | ||
"module": "ESNext", | ||
"moduleResolution": "Node", | ||
"noEmit": false, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"noImplicitUseStrict": false, | ||
"noStrictGenericChecks": false, | ||
"noUncheckedIndexedAccess": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"target": "esnext", | ||
"verbatimModuleSyntax": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '../config/.eslintrc.js', | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: true, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,10 @@ | ||
{ | ||
"references": [ | ||
{ | ||
"path": "../packages/react-native-nitro-modules" | ||
} | ||
], | ||
"include": [ | ||
"src" | ||
"extends": [ | ||
"@tsconfig/react-native/tsconfig.json", | ||
"../config/tsconfig.json" | ||
], | ||
"include": ["src", "index.js"], | ||
"compilerOptions": { | ||
"composite": true, | ||
"noEmit": true, | ||
"outDir": "lib", | ||
"rootDir": ".", | ||
"allowUnreachableCode": false, | ||
"allowUnusedLabels": false, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"jsx": "react", | ||
"lib": ["esnext"], | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"noImplicitUseStrict": false, | ||
"noStrictGenericChecks": false, | ||
"noUncheckedIndexedAccess": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"resolveJsonModule": true, | ||
"skipLibCheck": true, | ||
"strict": true, | ||
"target": "esnext", | ||
"verbatimModuleSyntax": true | ||
"jsx": "react" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,25 +5,45 @@ | |
"version": "0.14.1", | ||
"repository": "https://github.com/mrousavy/nitro.git", | ||
"author": "Marc Rousavy <[email protected]> (https://github.com/mrousavy)", | ||
"scripts": { | ||
"check-all": "./scripts/clang-format.sh", | ||
"bootstrap": "bun --filter=\"**\" install && bun tsc && bun --filter=\"react-native-nitro-example\" pods", | ||
"typescript": "bun --filter=\"**\" typescript", | ||
"release": "release-it", | ||
"clean": "rm -rf packages/**/tsconfig.tsbuildinfo packages/**/node_modules packages/**/lib" | ||
}, | ||
"workspaces": [ | ||
"packages/react-native-nitro-modules", | ||
"packages/nitrogen", | ||
"packages/react-native-nitro-image", | ||
"packages/template", | ||
"example", | ||
"docs" | ||
], | ||
"scripts": { | ||
"build": "bun run --cwd packages/react-native-nitro-modules build && bun run --cwd packages/nitrogen build && bun run --cwd packages/react-native-nitro-image build", | ||
"bootstrap": "bun install && bun run build && bun example pods", | ||
"typecheck": "bun --filter=\"**\" typecheck", | ||
"lint": "bun nitro lint && bun nitrogen lint && bun image lint && bun example lint", | ||
"lint-cpp": "./scripts/clang-format.sh", | ||
"clean": "rm -rf packages/**/tsconfig.tsbuildinfo packages/**/node_modules packages/**/lib", | ||
"release": "release-it --workspaces", | ||
"nitro": "bun --cwd packages/react-native-nitro-modules", | ||
"nitrogen": "bun --cwd packages/nitrogen", | ||
"image": "bun --cwd packages/react-native-nitro-image", | ||
"example": "bun --cwd example" | ||
}, | ||
"devDependencies": { | ||
"@release-it/conventional-changelog": "^8.0.1", | ||
"@release-it/bumper": "^6.0.1", | ||
"@eslint/js": "^9.10.0", | ||
"@jamesacarr/eslint-formatter-github-actions": "^0.2.0", | ||
"release-it": "^17.6.0" | ||
"@react-native/eslint-config": "0.75.2", | ||
"@release-it-plugins/workspaces": "^4.2.0", | ||
"@release-it/bumper": "^6.0.1", | ||
"@release-it/conventional-changelog": "^8.0.2", | ||
"@tsconfig/react-native": "^2.0.2", | ||
"@types/eslint__js": "^8.42.3", | ||
"@types/jest": "^29.5.13", | ||
"@typescript-eslint/eslint-plugin": "^8.13.0", | ||
"@typescript-eslint/parser": "^8.13.0", | ||
"eslint": "8.57.0", | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"prettier": "^3.3.3", | ||
"release-it": "^17.10.0", | ||
"typescript": "^5.6.2", | ||
"typescript-eslint": "^8.13.0" | ||
}, | ||
"release-it": { | ||
"npm": { | ||
|
@@ -37,7 +57,24 @@ | |
"github": { | ||
"release": true | ||
}, | ||
"hooks": { | ||
"before:init": "bun typecheck && bun lint", | ||
"before:bump": "bun example pods", | ||
"after:bump": "bun run build" | ||
}, | ||
"plugins": { | ||
"@release-it/bumper": { | ||
"out": [ | ||
{ | ||
"file": "packages/react-native-nitro-image/package.json", | ||
"path": "version" | ||
}, | ||
{ | ||
"file": "example/package.json", | ||
"path": "version" | ||
} | ||
] | ||
}, | ||
"@release-it/conventional-changelog": { | ||
"preset": { | ||
"name": "conventionalcommits", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
root: true, | ||
extends: "../../config/.eslintrc.js", | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
project: true, | ||
ecmaFeatures: { | ||
jsx: false, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.