You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
~/git$ gh repo create
? What would you like to do? Create a new repository on GitHub from scratch
? Repository name react-github-page
? Repository name react-github-page
? Repository owner jazzwang
? Description Example React.js App deploy to Github Page
? Description Example React.js App deploy to Github Page
? Visibility Public
? Would you like to add a README file? No
? Would you like to add a .gitignore? No
? Would you like to add a license? No
? This will create "react-github-page" as a public repository on GitHub. Continue? Yes
✓ Created repository jazzwang/react-github-page on GitHub
? Clone the new repository locally? Yes
建立 Github CodeSpace
~/git/react-github-page$ gh cs create
? Repository: jazzwang/react-github-page
✓ Codespaces usage for this repository is paid for by jazzwang
? Branch (leave blank for default branch):
? Choose Machine Type: 2 cores, 8 GB RAM, 32 GB storage
reimagined-acorn-r47j4x5rwfw5wj
修改 Github CodeSpace 的 Display Name
~/git/react-github-page$ gh cs edit -d "react-github-page"? Choose codespace: [Use arrows to move, type to filter]
> jazzwang/react-github-page (main*): reimagined acorn
MLOps-Courses/mlops-coding-course (main): mlops
jazzwang/snippet (master*): snippet
用 VS Code 開啟 Github CodeSpace
~/git/react-github-page$ gh cs ssh
? Choose codespace: [Use arrows to move, type to filter]
> jazzwang/react-github-page (main*): react-github-page
MLOps-Courses/mlops-coding-course (main): mlops
jazzwang/snippet (master*): snippet
測試是否有 npm 指令:
@jazzwang ➜ /workspaces/react-github-page (main) $ which npm
/home/codespace/nvm/current/bin/npm
@jazzwang ➜ /workspaces/react-github-page (main) $ which npx
/home/codespace/nvm/current/bin/npx
Step 2: Set Up Your React Application
建立一個新的 React App
@jazzwang ➜ /workspaces/react-github-page (main) $ npx create-react-app base
Creating a new React app in /workspaces/react-github-page/base.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
added 1478 packages in 3m
262 packages are looking for funding
run `npm fund`for details
Installing template dependencies using npm...
added 63 packages, and changed 1 package in 7s
262 packages are looking for funding
run `npm fund`for details
Removing template package using npm...
removed 1 package, and audited 1541 packages in 4s
262 packages are looking for funding
run `npm fund`for details
8 vulnerabilities (2 moderate, 6 high)
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit`for details.
Success! Created base at /workspaces/react-github-page/base
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!
We suggest that you begin by typing:
cd base
npm start
Happy hacking!
Step 3: Install the gh-pages Package
@jazzwang ➜ /workspaces/react-github-page (main) $
@jazzwang ➜ /workspaces/react-github-page (main) $ cd base/
@jazzwang ➜ /workspaces/react-github-page/base (main) $ npm install gh-pages --save-dev
added 13 packages, and audited 1554 packages in 5s
263 packages are looking for funding
run `npm fund`for details
8 vulnerabilities (2 moderate, 6 high)
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit`for details.
@jazzwang ➜ /workspaces/react-github-page/base (main) $
@jazzwang ➜ /workspaces/react-github-page/base (main) $ npm run deploy
>[email protected] predeploy
> npm run build
>[email protected] build
> react-scripts build
Creating an optimized production build...
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object" package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.
babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
Compiled successfully.
File sizes after gzip:
46.59 kB build/static/js/main.3a3034bd.js
1.77 kB build/static/js/453.ed57f822.chunk.js
513 B build/static/css/main.f855e6bc.css
The project was built assuming it is hosted at /react/.
You can control this with the homepage field in your package.json.
The build folder is ready to be deployed.
Find out more about deployment here:
https://cra.link/deployment
>[email protected] deploy
> gh-pages -d build
Published