Nuvotion-Visuals / Create-Formation-App

Quickly create Formation projects. Choosing from custom options and starter templates.
1 stars 0 forks source link

Explanation of tools like create-react-app #9

Open tom-leamon opened 1 year ago

tom-leamon commented 1 year ago

Create-React-App is a command-line tool that helps developers quickly set up and start building a new React application. The architecture behind it is based on a few key components:

  1. Webpack: Create-React-App uses Webpack as its primary build tool. Webpack is a powerful module bundler that takes all of the application's JavaScript, CSS, and other assets and transforms them into a single, optimized bundle that can be served to the browser.

  2. Babel: Create-React-App also uses Babel, a JavaScript transpiler, to convert modern JavaScript code (such as JSX, which is used in React) into code that can be understood by older browsers. This is done by transpiling the code into a version of JavaScript that is compatible with a wide range of browsers.

  3. Development Server: Create-React-App comes with its own development server, which is a lightweight web server that runs during development and serves the application's assets to the browser. This server supports features such as hot reloading, which allows the developer to see changes in the browser without having to manually refresh the page.

  4. ESLint: Create-React-App also includes ESLint, a linter that checks for common JavaScript coding errors and enforces a consistent code style.

  5. Jest: Create-React-App also include Jest, which is a JavaScript Testing Framework, that enables developers to write unit tests for their React components.

When you run the create-react-app command, it sets up a new directory with the basic structure of a React application, including the necessary configuration files for Webpack, Babel, and the development server. It also includes a set of scripts for running common development tasks, such as starting the development server, building the application for production, and running tests.

Once the application is set up, the developer can start building their application by creating React components and adding them to the application's entry point (index.js). As the developer writes code and makes changes, Webpack and Babel work together in the background to bundle and transpile the code, and the development server serves the updated code to the browser.

When the developer is ready to deploy the application, they can run a script to create a production-ready build of the application. This build will have all of the assets minified and optimized for performance, and it will be ready to be deployed to a web server.

tom-leamon commented 1 year ago

Create-Next-app is a command-line tool that helps developers quickly set up and start building a new application with Next.js. The architecture behind it is based on a few key components:

  1. Next.js: Create-Next-app uses Next.js, which is a framework for building server-rendered React applications. Next.js provides a set of features for building web applications such as automatic code splitting, server-side rendering, and static site generation.

  2. Webpack: Create-Next-app uses webpack to bundle and optimize the application's JavaScript and other assets. Webpack takes the application's code and creates a single, optimized bundle that can be served to the browser.

  3. Babel: Create-Next-app uses Babel, a JavaScript transpiler, to convert modern JavaScript code into code that can be understood by older browsers. This is done by transpiling the code into a version of JavaScript that is compatible with a wide range of browsers.

  4. Development Server: Create-Next-app comes with its own development server, which is a lightweight web server that runs during development and serves the application's assets to the browser. This server supports features such as hot reloading, which allows the developer to see changes in the browser without having to manually refresh the page.

  5. ESLint: Create-Next-app also includes ESLint, a linter that checks for common JavaScript coding errors and enforces a consistent code style.

  6. Jest: Create-Next-app also include Jest, which is a JavaScript Testing Framework, that enables developers to write unit tests for their React components.

When you run the create-next-app command, it sets up a new directory with the basic structure of a Next

tom-leamon commented 1 year ago

Create-Nextron-app is a command-line tool that helps developers quickly set up and start building a new application with Next.js and Electron. The architecture behind it is based on a few key components:

  1. Next.js: Create-Nextron-app uses Next.js, which is a framework for building server-rendered React applications. Next.js provides a set of features for building web applications such as automatic code splitting, server-side rendering, and static site generation.

  2. Electron: Create-Nextron-app uses Electron, which is a framework for building cross-platform desktop applications using web technologies. Electron allows developers to build an application that can be run on Windows, Mac, and Linux using a single codebase.

  3. Webpack: Create-Nextron-app uses webpack to bundle and optimize the application's JavaScript and other assets. Webpack takes the application's code and creates a single, optimized bundle that can be served to the browser.

  4. Babel: Create-Nextron-app uses Babel, a JavaScript transpiler, to convert modern JavaScript code into code that can be understood by older browsers. This is done by transpiling the code into a version of JavaScript that is compatible with a wide range of browsers.

  5. Development Server: Create-Nextron-app comes with its own development server, which is a lightweight web server that runs during development and serves the application's assets to the browser. This server supports features such as hot reloading, which allows the developer to see changes in the browser without having to manually refresh the page.

  6. ESLint: Create-Nextron-app also includes ESLint, a linter that checks for common JavaScript coding errors and enforces a consistent code style.

  7. Jest: Create-Nextron-app also include Jest, which is a JavaScript Testing Framework, that enables developers to write

tom-leamon commented 1 year ago

Here is a step-by-step list of how to architect Create-Formation-App to allow the developer to choose which framework they want to use:

  1. Start by creating a new npm package for Create-Formation-App, and publish it on npm.
  2. Define a series of options that the developer can choose from when running the npx create-formation-app command. These options should include things like which framework to use (React, Angular, Vue, etc.), whether to include support for websockets, and any other custom configurations that the developer may need.
  3. Create a series of templates for each framework that the developer can choose from, such as a blog template, an e-commerce template, and so on. These templates should include the basic structure and configuration files needed for the chosen framework to work.
  4. Write a script that will run when the developer chooses an option. This script should check for the option that the developer has chosen and then copy the corresponding template files to the project directory.
  5. Modify the package.json file to include scripts for running common development tasks, such as starting the development server, building the application for production, and running tests.
  6. Test the Create-Formation-App by creating a new project, choose the options and see that the files are correctly copied and the app is running correctly
  7. Update the Readme file to reflect the new options and how to use the app.

With this architecture, the developer will be able to use npx create-formation-app command to easily create a new project, with the ability to choose which framework they want to use, along with other options such as websockets and custom templates. This will help them quickly and easily get started with building their new application.