NX-Activity-Log 开源项目教程

NX-Activity-Log 开源项目教程

NX-Activity-LogHomebrew application for the Nintendo Switch which displays play activity with more accuracy项目地址:https://gitcode.com/gh_mirrors/nx/NX-Activity-Log

1. 项目的目录结构及介绍

NX-Activity-Log 项目的目录结构如下:

NX-Activity-Log/
├── .github/
│   └── workflows/
├── assets/
│   ├── icons/
│   └── images/
├── docs/
├── src/
│   ├── components/
│   ├── hooks/
│   ├── i18n/
│   ├── lib/
│   ├── pages/
│   ├── styles/
│   └── utils/
├── .gitignore
├── .prettierrc
├── LICENSE
├── README.md
├── package.json
├── tsconfig.json
└── yarn.lock

目录结构介绍

  • .github/workflows/: 包含 GitHub Actions 的工作流配置文件。
  • assets/: 存放项目的静态资源,如图标和图片。
  • docs/: 存放项目的文档文件。
  • src/: 项目的源代码目录,包含组件、钩子、国际化、库、页面、样式和工具等。
  • .gitignore: 指定 Git 忽略的文件和目录。
  • .prettierrc: Prettier 代码格式化配置文件。
  • LICENSE: 项目的开源许可证。
  • README.md: 项目的说明文档。
  • package.json: 项目的依赖和脚本配置文件。
  • tsconfig.json: TypeScript 配置文件。
  • yarn.lock: Yarn 包管理器的锁定文件。

2. 项目的启动文件介绍

项目的启动文件位于 src/ 目录下,主要包括以下文件:

  • index.tsx: 项目的入口文件,负责初始化应用和渲染根组件。
  • App.tsx: 应用的主组件,包含路由和全局状态管理。

index.tsx

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import './index.css';

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
);

App.tsx

import React from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import HomePage from './pages/HomePage';
import SettingsPage from './pages/SettingsPage';

function App() {
  return (
    <Router>
      <Switch>
        <Route exact path="/" component={HomePage} />
        <Route path="/settings" component={SettingsPage} />
      </Switch>
    </Router>
  );
}

export default App;

3. 项目的配置文件介绍

项目的配置文件主要包括以下几个:

  • .prettierrc: Prettier 代码格式化配置文件。
  • tsconfig.json: TypeScript 配置文件。
  • package.json: 项目的依赖和脚本配置文件。

.prettierrc

{
  "singleQuote": true,
  "trailingComma": "all",
  "printWidth": 80,
  "tabWidth": 2
}

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "es2015"],
    "jsx": "react",
    "module": "commonjs",
    "moduleResolution": "node",
    "outDir": "./dist",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true
  },
  "include": ["src"]
}

package.json

{
  "name": "nx-activity-log",
  "version": "1.0.0",
  "description": "A Switch activity log viewer",
  "main": "src/index.tsx",
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "dependencies": {
    "react": "^17.0.2",
    "react-dom

NX-Activity-LogHomebrew application for the Nintendo Switch which displays play activity with more accuracy项目地址:https://gitcode.com/gh_mirrors/nx/NX-Activity-Log

  • 9
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

支然苹

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值