create-react-native-library
Version:
CLI to scaffold React Native libraries
251 lines (250 loc) • 6.08 kB
JSON
{
"name": "<%- project.slug -%>",
"version": "0.1.0",
"description": "<%- project.description %>",
"source": "./src/index.tsx",
"main": "./lib/commonjs/index.js",
"module": "./lib/module/index.js",
"exports": {
".": {
"import": {
"types": "./lib/typescript/module/src/index.d.ts",
"default": "./lib/module/index.js"
},
"require": {
"types": "./lib/typescript/commonjs/src/index.d.ts",
"default": "./lib/commonjs/index.js"
}
},
"./package.json": "./package.json"
},
"files": [
"src",
"lib",
"android",
"ios",
"cpp",
<% if (project.moduleConfig === "nitro-modules") { -%>
"nitrogen",
<% } -%>
"*.podspec",
"react-native.config.js",
"!ios/build",
"!android/build",
"!android/gradle",
"!android/gradlew",
"!android/gradlew.bat",
"!android/local.properties",
"!**/__tests__",
"!**/__fixtures__",
"!**/__mocks__",
"!**/.*"
],
"scripts": {
<% if (example !== 'none') { -%>
"example": "yarn workspace <%- project.slug -%>-example",
<% } -%>
"test": "jest",
"typecheck": "tsc",
"lint": "eslint \"**/*.{js,ts,tsx}\"",
<% if (example !== 'expo') { -%>
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
<% } else { -%>
"clean": "del-cli lib",
<% } -%>
"prepare": "bob build",
<% if (project.moduleConfig === 'nitro-modules') { -%>
"nitrogen": "nitro-codegen",
<% } -%>
"release": "release-it"
},
"keywords": [
"react-native",
"ios",
"android"
],
"repository": {
"type": "git",
"url": "git+<%- repo -%>.git"
},
"author": "<%- author.name -%> <<%- author.email -%>> (<%- author.url -%>)",
"license": "MIT",
"bugs": {
"url": "<%- repo -%>/issues"
},
"homepage": "<%- repo -%>#readme",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@commitlint/config-conventional": "^19.6.0",
"@evilmartians/lefthook": "^1.5.0",
<% if (example === 'vanilla' && (project.moduleConfig === 'turbo-modules' || project.viewConfig === 'fabric-view')) { -%>
"@react-native-community/cli": "15.0.0-alpha.2",
<% } -%>
"@react-native/eslint-config": "^0.73.1",
"@release-it/conventional-changelog": "^9.0.2",
"@types/jest": "^29.5.5",
"@types/react": "^19.0.12",
"commitlint": "^19.6.1",
"del-cli": "^5.1.0",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.1",
"jest": "^29.7.0",
<% if (project.moduleConfig === 'nitro-modules') { -%>
"nitro-codegen": "^<%- versions.nitroCodegen %>",
<% } -%>
"prettier": "^3.0.3",
"react": "19.0.0",
"react-native": "0.78.1",
"react-native-builder-bob": "^<%- versions.bob %>",
<% if (project.moduleConfig === 'nitro-modules') { -%>
"react-native-nitro-modules": "^<%- versions.nitroModules %>",
<% } -%>
"release-it": "^17.10.0",
<% if (example !== 'expo') { -%>
"turbo": "^1.10.7",
<% } -%>
"typescript": "^5.2.2"
},
"peerDependencies": {
"react": "*",
<% if (project.moduleConfig === 'nitro-modules') { -%>
"react-native": "*",
"react-native-nitro-modules": "^<%- versions.nitroModules %>"
<% } else { -%>
"react-native": "*"
<% } -%>
},
<% if (example !== 'none') { -%>
"workspaces": [
"example"
],
<% } -%>
"packageManager": "yarn@3.6.1",
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [
"<rootDir>/example/node_modules",
"<rootDir>/lib/"
]
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"release-it": {
"git": {
"commitMessage": "chore: release ${version}",
"tagName": "v${version}"
},
"npm": {
"publish": true
},
"github": {
"release": true
},
"plugins": {
"@release-it/conventional-changelog": {
"preset": {
"name": "angular"
}
}
}
},
"eslintConfig": {
"root": true,
"extends": [
"@react-native",
"prettier"
],
"rules": {
"react/react-in-jsx-scope": "off",
"prettier/prettier": [
"error",
{
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
}
]
}
},
"eslintIgnore": [
"node_modules/",
"lib/"
],
"prettier": {
"quoteProps": "consistent",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false
},
"react-native-builder-bob": {
"source": "src",
"output": "lib",
"targets": [
<% if (project.moduleConfig === "nitro-modules") { -%>
[
"custom",
{
"script": "nitrogen",
"clean": "nitrogen/"
}
],
<% } -%>
<% if (project.moduleConfig === 'turbo-modules' || project.viewConfig === 'fabric-view') { -%>
"codegen",
<% } -%>
[
"module",
{
"esm": true
}
],
[
"commonjs",
{
"esm": true
}
],
[
"typescript",
{
"project": "tsconfig.build.json"
}
]
]
<% if (project.moduleConfig === 'turbo-modules' || project.viewConfig === 'fabric-view') { -%>
},
"codegenConfig": {
"name": "RN<%- project.name -%><%- project.viewConfig !== null ? 'View': '' -%>Spec",
"type": "<%- project.viewConfig !== null ? 'all': 'modules' -%>",
"jsSrcsDir": "src",
"outputDir": {
"ios": "ios/generated",
"android": "android/generated"
},
"android": {
"javaPackageName": "com.<%- project.package %>"
<% if (example === 'vanilla') { -%>
<% if (project.viewConfig === 'fabric-view') { -%>
},
"ios": {
"componentProvider": {
"<%- project.name -%>View": "<%- project.name -%>View"
}
<% } -%>
},
"includesGeneratedCode": true
<% } else { -%>
}
<% } -%>
<% } -%>
}
}