Create a native codebase from Plasmic

official document

When creating a new repository, use create-plasmic-app, and everything will be set up automatically. To create a project, run the following code in the command line tool:

npx create-plasmic-app

After about a minute and a half, it prompts that the installation is successful. Then you can set the project name, code language, react framework, integration scheme, and project link according to the prompts. In addition to the project name and link, the remaining three items are selected with the / arrow on the keyboard . You can just write a project name, the project link is the design drawing link of plasma, and other options are based on the official recommended options. For example, what I entered (for reference only):

Please specify the project directory
? What is your project named? plasmicdesign
? What language do you want to use? TypeScript
? What React framework do you want to use? Next.js
? Which scheme do you want to use to integrate Plasmic? PlasmicLoader

? What is the URL of your project?
(If you don't have a project yet, create one by going to
https://studio.plasmic.app/starters/simple-light):
 https://studio.plasmic.app/projects/x2MP8nP6DT8WT9iEdA83zr

Then, the following will be prompted:

Let's get started! Here's what we'll do: 
1. Authenticate with Plasmic
2. Create a React/Next/Gatsby repo
3. Integrate with Plasmic

==================================================
AUTHENTICATING WITH PLASMIC
==================================================

If your browser doesn't automatically open, enter the following URL:
https://studio.plasmic.app/auth/plasmic-init/94da7201-bd39-4ccd-951c-36e6fa043bbf

Please log in and authorize Plasmic CLI.
Waiting for token...

At this time, a page will appear in the browser, click the button to authorize.
insert image description here
After authorization, the location of Plasmic's code base on the local computer will be displayed.
Next, the project file is automatically created and dependencies are installed.

Successfully created Plasmic credentials file at /Users/ym/.plasmic.auth

==================================================
CREATING THE PROJECT
==================================================
npx -p create-next-app create-next-app --typescript /Users/ym/plasmicdesign
npx: 1 安装成功,用时 2.924 秒
Creating a new Next.js app in /Users/ym/plasmicdesign.

Using npm.

Installing dependencies:
- react
- react-dom
- next

Then there is the fully automatic installation process, so I won't go into details.
Finally, this line appears, indicating success:

Congrats! We created the Plasmic-connected project at plasmicdesign

Then follow the prompts to enter the setting directory and start the service:

cd plasmicdesign
npm run dev

Related Links: Plasmic Studio Getting Started Tutorial

Guess you like

Origin blog.csdn.net/ymyz1229/article/details/127490299