-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Not working with CRNA #940
Comments
Also, React Native CLI |
Hey I am new to open Source ,can I help in any way? |
In this particular case probably the cause of the error should be identified. Why In general, if you want to help, you can start with issues marked as |
Naah. Same thing works with |
Both npm and yarn create a flat node_modules structure and the package can access many dependencies that are not declared in |
oh, or the other issue might be this: #801 some of the most popular resolvers don't adhere Node's resolution algorithms. They preserve symlinks when resolving. pnpm creates lots of symlinks and it works with Node because it does not preserve them |
@deadcoder0904 I just checked. It is an issue with With a pnpm hook, I added the missing dependencies to its manifest and it worked.
'use strict'
module.exports = {
hooks: {
readPackage
}
}
function readPackage (pkg) {
if (pkg.name === 'metro-bundler') {
Object.assign(pkg.dependencies, {
'babel-plugin-transform-flow-strip-types': '6',
'babel-plugin-transform-object-rest-spread': '6',
'babel-plugin-transform-class-properties': '6',
'babel-plugin-transform-async-to-generator': '6',
'babel-plugin-syntax-trailing-function-commas': '6',
'xtend': '*',
'errno': '*',
})
}
return pkg
} |
Well thanks @zkochan. I'll file an issue there. |
In most cases, there is a |
Yep got it |
Updated pnpmfile.js that works for me. 'use strict'
module.exports = {
hooks: {
readPackage,
},
}
function readPackage(pkg) {
if (pkg.name === 'metro-core') {
Object.assign(pkg.dependencies, {
wordwrap: '*',
})
}
if (pkg.name === 'metro') {
Object.assign(pkg.dependencies, {
'babel-plugin-transform-flow-strip-types': '6',
'babel-plugin-transform-object-rest-spread': '6',
'babel-plugin-transform-class-properties': '6',
'babel-plugin-transform-async-to-generator': '6',
'babel-plugin-syntax-trailing-function-commas': '6',
xtend: '*',
errno: '*',
})
}
return pkg
} I still couldn't get it to work. There are some more issues related to react-native not supporting symlinks. See facebook/react-native#18156 |
So I got I will take a look at getting it working for CRNA soon. |
Thanks man, appreciate it |
Got CRNA working with Will tidy this up later. 'use strict'
module.exports = {
hooks: {
readPackage,
},
}
// NOTE: To see crna packager errors you must add `console.log(JSON.stringify(msg, null, 2))` to `this._handlePackagerEvent` here:
// photo-booth-ios-crna/node_modules/.registry.npmjs.org/xdl/48.0.2/node_modules/xdl/build/logs/PackagerLogsStream.js
// NOTE: Test changes with `pnpm up`.
// NOTE: For `console.log` to appear correctly use: `pnpm up --reporter=append-only`.
function readPackage(pkg) {
require('pnpmfile-check').default(pkg)
// `metro` pnpm support.
// TODO(vjpr): Use semver instead to test metro version.
if (pkg.name === 'react-native' && pkg.version === '0.52.0') {
Object.assign(pkg.dependencies, {
'metro': 'npm:metro-pnpm@0.24.7-vjpr.1',
//'metro-resolver': '~/dev-live/metro/.dev/metro-resolver-0.28.0.tgz',
'uuid': '*', // Libraries/Blob/Blob.js
})
}
if (pkg.name === 'react-native-scripts') {
Object.assign(pkg.dependencies, {
expo: '*',
})
}
if (pkg.name === 'metro-core') {
console.log('adding wordwrap to metro-core')
Object.assign(pkg.dependencies, {
wordwrap: '*',
})
}
// expo/src/Notifications.js
if (pkg.name === 'expo') {
Object.assign(pkg.dependencies, {
fbjs: '^0.8.16',
lodash: '*',
'json-schema-traverse': '*',
})
}
// 1.0.0-alpha.39
if (pkg.name === 'react-native-gesture-handler') {
Object.assign(pkg.dependencies, {
fbjs: '^0.8.16',
})
}
// @expo/vector-icons@6.3.1
if (pkg.name === '@expo/vector-icons') {
Object.assign(pkg.dependencies, {
'prop-types': '*',
})
}
if (pkg.name === 'metro-pnpm') {
Object.assign(pkg.dependencies, {
'babel-plugin-transform-flow-strip-types': '6',
'babel-plugin-transform-object-rest-spread': '6',
'babel-plugin-transform-class-properties': '6',
'babel-plugin-transform-async-to-generator': '6',
'babel-plugin-syntax-trailing-function-commas': '6',
'babel-template': '6',
resolve: '*',
xtend: '*',
errno: '*',
})
}
/*
pnpm ls babel-preset-expo
├─┬ expo@25.0.0
│ └── babel-preset-expo@4.0.0
└─┬ react-native-scripts@1.11.1
└─┬ expo@25.0.0
└── babel-preset-expo@4.0.0
*/
const pjson = require('./package.json')
if (pkg.name === pjson.name) {
Object.assign(pkg.dependencies, {
'babel-preset-expo': '^4',
'babel-plugin-transform-react-jsx-source': '6',
})
}
return pkg
} |
@vjpr Doesn't |
@deadcoder0904 But the main challenge was patching |
Here is a more automated way to work with CRNA. I will be removing the pnpmfile.js require('babel-register')
module.exports = require('./pnpmfile/index') pnpmfile/package.json {
"name": "pnpmfile",
"version": "0.0.1",
"devDependencies": {
"@pnpmfile/create-react-native-app": "^0.0.2-0"
},
"dependencies": {
"babel-preset-env": "^1.6.1"
}
} pnpmfile/index.js export default {
hooks: {
readPackage,
},
}
function readPackage(pkg) {
//require('pnpmfile-check').default(pkg)
console.log({pkg})
require('@pnpmfile/create-react-native-app').default(pkg)
if (pkg.name === 'photo-booth-ios-crna') {
console.log(pkg.dependencies)
}
return pkg
} package.json
You must run the following to ensure that
|
@vjpr In short now all the upcoming release are supposed to work correctly. I hope this fixes the wordwrap not found and other babel missing package errors also. |
Nope. I can only guarantee this works for There was a re-org done from 0.52 -> 0.54, but the functions I patched did not change. Until a PR in For CRNA + EXPO versioning see: https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md
This is fixed, and will not be problematic between versions. Also, patches will take me <5mins for each new version because I have automated it. So unless something big changes in I am maintaining the pnpmfile hook here: https://github.com/vjpr/pnpmfile/blob/master/packages/create-react-native-app/def.js |
Is the package still maintained @vjpr ? I've not been able to get things working, getting expo/CRNA to work with pnpm ist a pain (I know this is mostly due to path resolving of expo). |
Will update it today. They recently released babel 7 support.
…On Sun 18. Nov 2018 at 15:41, Benjamin Kniffler ***@***.***> wrote:
Is the package still maintained @vjpr <https://github.com/vjpr> ? I've
not been able to get things working, getting expo/CRNA to work with pnpm
ist a pain (I know this is mostly due to path resolving of expo).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#940 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AARLRXfddKIWqeTkRynUhYGZz_bepi9nks5uwXGMgaJpZM4Qh6sw>
.
|
Part 1 - Getting expo-cli working with pnpm: expo/expo-cli#183 Will track progress here: #1501 |
I tried it in the previous release too & also in this release but the only reason I can't use PNPM is because it doesn't work using CRNA.
Now its giving error -
Cannot find module 'babel-plugin-transform-flow-strip-types'
Steps to repro -
The text was updated successfully, but these errors were encountered: