GithubHelp home page GithubHelp logo

blackhole1 / electron-cra-ts-lerna-webpack Goto Github PK

View Code? Open in Web Editor NEW
28.0 2.0 1.0 2.35 MB

Develop the electron application immediately without waiting

License: MIT License

JavaScript 85.62% TypeScript 10.91% HTML 2.25% CSS 1.22%
electron electron-cra electron-application

electron-cra-ts-lerna-webpack's Introduction

electron-cra-ts-lerna-webpack

Develop the electron application immediately without waiting

Github Issues Twitter GitHub license

中文文档

tech stack

  1. Electron
  2. create-react-app
  3. TypeScript
  4. Webpack
  5. electron-webpack
  6. electron-builder
  7. react-hot-loader
  8. lerna
  9. yarn

feature

  1. render hot update(Refresh only changed components)
  2. main-process hot update(Auto restart)
  3. main-process and renderer-process all use TypeScript
  4. support mac pack (dmg and zip)
  5. support windows pack (nsis and zip)
  6. support linux pack (AppImage and deb)
  7. use lerna and yarn workspace reduce project size
  8. use yarn autoclean to reduce the size of the final package

use

install

git clone [email protected]:BlackHole1/electron-cra-ts-lerna-webpack.git --depth=1 newProject
cd newProject
yarn

development

# renderer-app (The first shell window, Don't close)
cd packages/renderer-app
yarn start

# main-app (Second shell window, Don't close)
cd packages/main-app
yarn start

build

cd packages/renderer-app
yarn build
cd ../packages/main-app
# or yarn copyRenderBuildCode && yarn build:main && yarn pack:mac
yarn pack:mac:auto

electron-cra-ts-lerna-webpack's People

Contributors

blackhole1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

alwaysmavs

electron-cra-ts-lerna-webpack's Issues

About using create-react-native-app in lerna using workspaces

Good morning my friends

I'm having trouble using create-react-native-app on lerna using workspaces

Below I do the step by step, but we see that this way the node_modules folder in the package is not stored

It is necessary to have the node_modules folder in the folder in packages, because you have an android folder with requests to that folder

Environment info:

$ lerna info

System:
    OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
Binaries:
    lerna: v3.22.1
    Node: 12.18.1 - ~/.nvm/versions/node/v12.18.1/bin/node
    Yarn: 1.22.4 - /usr/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v12.18.1/bin/npm
Utilities:
    Git: 2.25.1 - /usr/bin/git 

$ react-native info

info Fetching system and libraries information...
System:
    OS: Linux 5.4 Ubuntu 20.04 LTS (Focal Fossa)
    CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
    Memory: 1.07 GB / 15.56 GB
    Shell: 5.0.16 - /bin/bash
Binaries:
    Node: 12.18.1 - ~/.nvm/versions/node/v12.18.1/bin/node
    Yarn: 1.22.4 - /usr/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v12.18.1/bin/npm
    Watchman: 4.9.0 - /home/linuxbrew/.linuxbrew/bin/watchman
SDKs:
    Android SDK:
    API Levels: 28, 30
    Build Tools: 28.0.3, 30.0.0
    System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
    Android NDK: Not Found
IDEs:
    Android Studio: Not Found
Languages:
    Java: 11.0.7 - /usr/bin/javac
    Python: 2.7.18 - /usr/bin/python
npmPackages:
    @react-native-community/cli: Not Found
    react: ~16.11.0 => 16.11.0 
    react-native: ~0.62.2 => 0.62.2 
npmGlobalPackages:
    *react-native*: Not Found

$ python --version

Python 2.7.18rc1

$ python3 --version

Python 3.8.2

$ npm list -g --depth 0

/home/marcio/.nvm/versions/node/v12.18.1/lib
├── @prettier/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Steṕs to reproduce

#

cd ~/Downloads

rm -fr ~/Downloads/monorepo-3

mkdir -p ~/Downloads/monorepo-3

cd ~/Downloads/monorepo-3

pwd && ls

echo '{
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*"
]
}' >lerna.json

cat lerna.json

echo '{
"name": "root",
"private": true,
"workspaces": [
"packages/*"
],
"devDependencies": {
"lerna": "^3.22.1"
}
}' >package.json

cat package.json

lerna init

#

cd packages

npx create-react-native-app default-create-react-native-app --yes

# OR

# react-native init defaultreactnative

# clean

cd ..

yarn check --integrity --verify-tree || true

lerna list --all --long || true

lerna clean --yes || true

pwd && ls

rm -fr node_modules

find . -name "node_modules" -type d

find \
. \
-name "node_modules" \
-o -name ".yarncache" \
-type d -prune | while read ITEM; do
(du -sh "$ITEM")
(rm -fr "$ITEM")
done

find \
. \
-name "*.touch" \
-o -name "*error.log" \
-o -name "*debug.log" \
-o -name "*lock.json" \
-o -name "*lock.yaml" \
-o -name "audit-resolve.json" \
-o -name ".yarnclean" \
-o -name "yarn.lock" \
-type f | while read ITEM; do
(du -sh "$ITEM")
(rm -fr "$ITEM")
done

#

lerna init

lerna info

lerna list --all --long

lerna bootstrap

#

ls && ls ./packages/*

du -sh ./packages/default-create-react-native-app/node_modules/react-native-unimodules/gradle.groovy

du -sh ./packages/default-create-react-native-app/node_modules/react-native/react.gradle

du -sh ./packages/default-create-react-native-app/node_modules/expo-updates/scripts/create-manifest-android.gradle

du -sh ./packages/default-create-react-native-app/node_modules/@react-native-community/cli-platform-android/native_modules.gradle

# 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.