etn-ccis / blui-cli Goto Github PK
View Code? Open in Web Editor NEWA tool for building example repositories and handling common Brightlayer UI procedures
License: BSD 3-Clause "New" or "Revised" License
A tool for building example repositories and handling common Brightlayer UI procedures
License: BSD 3-Clause "New" or "Revised" License
Only use the RNC Cli to build React Native projects
Allows selection of RNC or Expo
No
We're not really recommending people to use Expo for production applications. We were using it in some cases because Expo projects can run in snack, but with the growing complexity of our packages and the stripped down way of doing dependency management in Snack, that no longer works. So there doesn't seem to be much benefit in continuing to support this in the CLI.
pxb new --lint=false should not install any lint & prettier
As long as you have a --lint flag, lint will be installed; otherwise, it won't.
May want to do this while working on #16 .
This is an issue after #15 is merged
CLI should use NPX for the CLI commands
Current behavior assumes that the individual framework CLIs are globally installed on the local machine.
No
Using NPX will also ensure that we are always using the latest version of the particular CLI
The CLI doesn't stop after generating new project. This results in the end user having to press cmd+c
before entering any other commands.
The CLI should stop after a new project is generated so the end user can immediately enter an additional command
Templates have to blank
routing
or authentication
Docs do not mention this and can be interpretted as the package used instead.
No
CLI should automatically include our linting profiles and commands.
No linting is in the repositories by default.
No
React Native projects generated with the BLUI CLI do not build properly
yarn ios
or yarn android
ios build fail message
** BUILD FAILED **
The following build commands failed:
CompileC /Users/<redacted>/Library/Developer/Xcode/DerivedData/TestAuth-fzujnhijaatcjuenpivjtugfrouo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNReanimated.build/Objects-normal/arm64/UIResponder+Reanimated.o /Users/<redacted>/etn-ccis/test/TestAuth/node_modules/react-native-reanimated/ios/native/UIResponder+Reanimated.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNReanimated' from project 'Pods')
CompileC /Users/<redacted>/Library/Developer/Xcode/DerivedData/TestAuth-fzujnhijaatcjuenpivjtugfrouo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNReanimated.build/Objects-normal/arm64/NativeProxy.o /Users/<redacted>/etn-ccis/test/TestAuth/node_modules/react-native-reanimated/ios/native/NativeProxy.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'RNReanimated' from project 'Pods')
(2 failures)
error Command failed with exit code 1.
Android build fail message
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':tasks'.
> Could not create task ':react-native-pager-view:compileDebugAndroidTestKotlin'.
> Cannot use @TaskAction annotation on method AbstractKotlinCompile.execute() because interface org.gradle.api.tasks.incremental.IncrementalTaskInputs is not a valid parameter to an action method.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 10s
error Failed to install the app.
To run pxb cli and create a new repository with all branches and files from a windows system.
pxb new repository fails at SED steps. (only empty repo is created)
The syntax of the command is incorrect.
when each sed is run without double quotes no syntax error is observed.
(sed -i "s/[repository-name]/test/g" ./example_template/README.md)
Tried running pxb cli from cmder terminal and also tried Cygwin utility with same results.
https://cmder.net/
https://cygwin.com/
The default app-test for RN template projects fail due to not having safe-area wrapper for when the header is rendered in test.
test to pass with default test file
The issue can be fixed via the CLI project or in the templates repo.
The test file should have...
import { SafeAreaProvider } from 'react-native-safe-area-context';
README needs to show on the npm page here:
https://www.npmjs.com/package/@pxblue/cli?activeTab=dependencies
README is available without going into the github repo.
https://www.npmjs.com/package/@pxblue/cli?activeTab=dependencies
More robust tests in CircleCI:
We only have unit tests for the help and default commands and e2e tests to verify that the CLI builds and can create projects in each framework.
No
After the CLI runs, when printing the instructions for running on Android, the cd
step is missing.
The first step in the Android instructions should be to cd
into the project directory we just created.
The instructions should be:
yarn && yarn build && yarn link
blui new react-native
cd
step into the project is missing.The instructions are correct for running on iOS. We should be able to reference that in order to make this update.
Include the font files and guard by default in a new RN project.
Currently this (lengthy) step has to be done manually despite being identical for all of our projects.
No
It worked before but today when I was trying to use the cli for a ts project, it gives me the following message on yarn start
:
Welcome.
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
USMOOWWM543G8WN:cli-test-ts c3050144$ yarn start
yarn run v1.17.3
$ react-scripts start
/Users/c3050144/Documents/pxblue/cli-test-ts/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js:239
appTsConfig.compilerOptions[option] = value;
^
TypeError: Cannot assign to read only property 'jsx' of object '#<Object>'
at verifyTypeScriptSetup (/Users/c3050144/Documents/pxblue/cli-test-ts/node_modules/react-scripts/scripts/utils/verifyTypeScriptSetup.js:239:43)
at Object.<anonymous> (/Users/c3050144/Documents/pxblue/cli-test-ts/node_modules/react-scripts/scripts/start.js:31:1)
at Module._compile (internal/modules/cjs/loader.js:956:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
at Module.load (internal/modules/cjs/loader.js:812:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1025:10)
at internal/main/run_main_module.js:17:11
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
But the same steps with a js flag does not induce any error and works like normal.
No error.
npx -p @pxblue/cli@beta pxb new react --name cli-test-ts --lint --prettier --language ts --template blank
yarn start
N/A
MacOS, node v12.13.0
Typescript license url is broken
https://github.com/Microsoft/TypeScript/raw/master/LICENSE.txt
CODE HERE
Replace the url with https://github.com/Microsoft/TypeScript/raw/main/LICENSE.txt
When generating a new angular project using pxblue linting, the tslint.json should not show up in the root directory
It both installed pxblue/eslint-config and generated a tslint.json in the project files.
When starting a new react native project using the RNC CLI, the project should be ready to go with SVG icons out of the box.
Currently, the default project is not configured to allow the use of SVG icons, so copying and pasting code snippets that includes icons will give you the red screen of death.
Discovered when testing the new version of the RN component library.
We need to include packages for:
Then we need to follow the steps for configuring react-native-svg-transformer (https://github.com/kristerkari/react-native-svg-transformer#step-3-configure-the-react-native-packager)
Use Angular 13, React 17, MUI v5 and update other dependencies used by the CLI
These dependencies are out of date
No
Some of these dependencies may already be handled by updates to the templates themselves, but we should check to see what else there is that is specified in the CLI and need to be updated.
When starting an Angular project created with the CLI, the console throws a bunch of yellow warnings about TSConfig (spec files etc.).
No warnings for a fresh project:
Seems to be an issue somewhere in our "Add PX Blue" functionality. Creating a project with the Angular CLI runs without warnings.
Currently, the cli react typescript will include
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
in package.json's dependencies field
Should have anything for dev only under devDependencies
package.json from this commit:
pxblue-components/documentation@10c9871
Framework
Browser
Operating System
We are currently using the 'ionic' package from npm to scaffold new ionic projects, which is deprecated.
We should be using @ionic/cli instead
The CLI should prevent project names that will ultimately throw errors in the underlying CLI.
All three frameworks that we support, Angular, React & RN, have their own unique project name requirements.
If an invalid name is provided, the user is still prompted for all questions. When attempting to make the project it will throw an error since project name invalid.
No
You'll need to look up the specific naming rules for each framework as the rules for Angular are not the same as the rules for RN, etc.
We need a --prettier flag separate from the --lint flag to install js & ts respectively.
--lint install both prettier and lint, but for ts projects only
No
Raised during the sprint review on #15.
Remove Expo option for RN projects
CLI allows you to choose between RNC and Expo CLI for RN projects
No
Make sure to update the documentation / Readme as well.
The CLI should be able to work behind a proxy. It should allow users to configure their proxy settings if applicable.
CLI must be run on a network without a proxy.
No
The upstream issues that this depends on (gluegun) seem to be updated and capable of supporting this feature now.
npm render the markdown slightly differently from GitHub
Should have no "\|
" in the table
We had that problem between GitHub vs storybook before... need to figure out a universal solution for all three of them
Need to lock down branches to contributors only by default when creating a repository
Branches are wide open
Related to the security vulnerabilities identified by evan
CLI template selection should be limited to supported templates. This applies to angular and react projects.
Users can enter whatever template they want through the --template
flag.
No
Code in the new projects should be linted in accordance with our package rules (and use 4 spaces when writing back to the JSON files).
Code is not linted (2 spaces used in JSON).
No
Remove Ionic option from framework selection
Ionic is an option
No
Make sure to update the documentation / Readme as well.
When using the CLI to create a new repository, the ionic branch doesn't have the network_security_config.xml
File should be included
pxb new repository delete-me
The script should be running the ionic cordova resources
command before pushing to github (which it appears to be doing). The gitignore file also does not include this config file, so it should be getting added...something funny is happening in the process.
installing the Blui cli global throws warnings on some dependencies that should be upgraded.
yarn global add @brightlayer-ui/[email protected]
yarn global v1.22.19
[1/4] 🔍 Resolving packages...
warning @brightlayer-ui/cli > react-native-asset > [email protected]: Version 1.x or earlier is no longer supported.
warning @brightlayer-ui/cli > create-react-app > tar-pack > [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
warning @brightlayer-ui/cli > react-native > jest-environment-node > @jest/fake-timers > @sinonjs/[email protected]: Use version 10.1.0. Version 10.2.0 has potential breaking issues
warning @brightlayer-ui/cli > react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
warning @brightlayer-ui/cli > react-native > @react-native-community/cli > @react-native-community/cli-plugin-metro > metro > metro-minify-uglify > [email protected]: support for ECMAScript is superseded by uglify-js
as of v3.13.0
warning @brightlayer-ui/cli > react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning @brightlayer-ui/cli > react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > [email protected]: See https://github.com/lydell/source-map-url#deprecated
warning @brightlayer-ui/cli > react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
[2/4] 🚚 Fetching packages...
warning [email protected]: The engine "yargs" appears to be invalid.
[3/4] 🔗 Linking dependencies...
warning "@brightlayer-ui/cli > [email protected]" has unmet peer dependency "@types/node@".
warning "@brightlayer-ui/cli > [email protected]" has unmet peer dependency "[email protected]".
warning "@brightlayer-ui/cli > react-native > [email protected]" has unmet peer dependency "@babel/core@".
warning "@brightlayer-ui/cli > react-native > [email protected]" has unmet peer dependency "react@^16.0.0 || ^17.0.0 || ^18.0.0".
warning "@brightlayer-ui/cli > react-native > [email protected]" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@brightlayer-ui/cli > react-native > @react-native-community/cli > @react-native-community/cli-plugin-metro > [email protected]" has unmet peer dependency "@babel/core@*".
warning "@brightlayer-ui/cli > react-native > react-native-codegen > [email protected]" has unmet peer dependency "@babel/preset-env@^7.1.6".
[4/4] 🔨 Building fresh packages...
success Installed "@brightlayer-ui/[email protected]" with binaries:
- blui
✨ Done in 22.69s
CODE HERE
The Expo configuration is broken and will throw a Font Not Found error for material icons and open sans.
No errors.
expo-cli version 4
iOS (Android fails gracefully and uses a different system font).
expo/expo#7552
expo/expo#11333
The fix appears to be to use the @expo/metro-config package instead of adding our own metro configurations for the react-native-svg-transformer. We should remove the metro.config.js that we add here:
https://github.com/pxblue/pxblue-cli/blob/dev/src/extensions/pxblue-extensions.ts#L505
We also need to remove the use-expo dependency:
https://github.com/pxblue/pxblue-cli/blob/dev/src/extensions/pxblue-extensions.ts#L470
And just use expo-font for the useFonts Hook (included with expo dependencies, no need to install anything here):
import { useFonts } from 'expo-font';
CLI should work flawlessly with the latest versions of Node and NPM.
The CLI works best with Node 14 and NPM 6. It will work with NPM7 if it's globally installed. When using the latest versions, a lot of things seem to be broken.
This is related to a number of issues that were identified after trying to update to the latest node.
When I generate a React Native TS lint project, there is an App.js and App.tsx generated in the project root folder.
Only App.tsx should be generated.
npx -p @pxblue/cli pxb new
Framework
Operating System
The CLI does not automatically exit the initialization process when everything is finished. Users have to manually control-D to exit. I vaguely recall that this was not the case before.
npx -p @brightlayer-ui/cli blui new react --name=font-audit
This is 10 minutes after everything has been installed:
macOS 13.3.1
I want new flags added so I can easily test beta or alpha template packages.
When selecting a template, only the latest version is pulled down.
No
Use the newest theme (6+) and the updated import syntax for @fontsource/open-sans.
Using the older theme and older typeface-open-sans package.
This is related to typeface-open-sans being deprecated in favor of @fontsource/open-sans. I updated the themes to use the new package, but it's currently just in beta awaiting additional updates to bundle into the new major version. I did not want to publish a new version of this package that makes use of a beta version of the theme. Once the 6.0 version of the theme is published as latest, we can come in here and make the update. Creating this issue so we don't forget.
I made a branch for this (feature/typeface) that you can use.
If we build ionic templates, this may not need to be done in the CLI.
A new angular project does not include the material icon font in index.html by default
Should include the link tag with the font import
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
This should be a quick update in the template code where we are currently adding the class to the root element to apply the theme.
Generated RN projects should use the latest React Native package
Generated RN projects are locked down on 0.64.1
It would be nice to know which version of the template was used when creating a project with the CLI. Perhaps we can add a comment at the top of one of the main copied files that says the version so it's easy to identify during testing, e.g.:
/*
* This project was scaffolded with version x.x.x of the XYZ template
* */
We can't tell what version of the template was used to build a project. We can get a sense if versions are different from each other by looking at the dependencies in package.json, but it's kind of a pain and not very exact.
Related to the testing going on for supporting alpha and beta versions of templates in the CLI.
It would be cool if we could programmatically pull this out of the package.json file so we don't have to remember to update it every time.
The latest version of react native / react native cli do autolinking via gradle and cocoapods, so we shouldn't need to run the rnlink command anymore. Look at the instructions for RNVI for how to use Cocoapods (we are already using Gradle on the android side). We will need to modify the podfile to add a line and we will need to add a new entry in the Info.plist file too.
Currently we do rnlink to link up fonts for react native vector icons package.
No.
If we can successfully take this out, we may no longer need to include the extra step instructions for removing the duplicate resources and the end of the CLI workflow.
Right now the cli generates a new babel.config.js
, and added "babel-preset-expo": "~8.0.0"
to package.json
devDependencies.
These two files should not be generated.
(Update: according to my experimentation at search-bar react native branch, babel config is required for expo to work)
this search-bar commit generates the two thing mentioned above.
Framework
Browser
Operating System
Cannot create a new ionic authentication template with prettier & eslint enabled.
It works.
npx -p @pxblue/cli@ pxb new
and select ionic, prettier, auth, eslint options.Windows
CLI should be more opinionated about dependency versions instead of installing the latest version of everything. Lately, we've seen some incompatibilities with various versions of packages caused by this behavior. We should periodically update these as necessary with subsequent releases rather than trying to eliminate the need for updates by using latest.
Installs latest version of everything.
Yes, projects started with the CLI do not run out-of-the-box for Angular or React.
Add any other context or screenshots about the feature request here.
Angular should be fixed once we release the new version of the component library, react has incompatibilities with the version of eslint required by react-scripts.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.