ngx-auth 项目使用教程

ngx-auth 项目使用教程

ngx-authAngular 16+ Authentication Module项目地址:https://gitcode.com/gh_mirrors/ng/ngx-auth

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

ngx-auth/
├── circleci/
├── github/
├── packages/
│   └── @ngx-auth/
│       ├── core/
│       └── auth0/
├── tools/
├── .editorconfig
├── .gitignore
├── .lintstagedrc
├── .prettierignore
├── .prettierrc
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── commitlint.config.js
├── lerna.json
├── package.json
├── tsconfig.json
├── tsconfig.lint.json
├── tslint.json
└── yarn.lock
  • circleci/: CircleCI 配置文件目录。
  • github/: GitHub 相关文件目录。
  • packages/: 包含核心模块和 Auth0 实现模块。
    • @ngx-auth/core/: 核心认证模块。
    • @ngx-auth/auth0/: Auth0 实现模块。
  • tools/: 工具配置文件目录。
  • .editorconfig: 编辑器配置文件。
  • .gitignore: Git 忽略文件配置。
  • .lintstagedrc: lint-staged 配置文件。
  • .prettierignore: Prettier 忽略文件配置。
  • .prettierrc: Prettier 配置文件。
  • CHANGELOG.md: 更新日志文件。
  • CODE_OF_CONDUCT.md: 行为准则文件。
  • CONTRIBUTING.md: 贡献指南文件。
  • LICENSE: 许可证文件。
  • README.md: 项目说明文件。
  • commitlint.config.js: commitlint 配置文件。
  • lerna.json: Lerna 配置文件。
  • package.json: 项目依赖和脚本配置文件。
  • tsconfig.json: TypeScript 配置文件。
  • tsconfig.lint.json: TypeScript 代码检查配置文件。
  • tslint.json: TSLint 配置文件。
  • yarn.lock: Yarn 锁定文件。

2. 项目的启动文件介绍

项目的启动文件主要是 package.json 中的脚本部分。以下是一些关键的启动脚本:

{
  "scripts": {
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint"
  }
}
  • start: 启动开发服务器。
  • build: 构建项目。
  • test: 运行测试。
  • lint: 运行代码检查。

3. 项目的配置文件介绍

tsconfig.json

TypeScript 配置文件,定义了编译选项和文件包含规则。

{
  "compilerOptions": {
    "module": "esnext",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  }
}

tslint.json

TSLint 配置文件,定义了代码风格和检查规则。

{
  "rules": {
    "class-name": true,
    "comment-format": [
      true,
      "check-space"
    ],
    "indent": [
      true,
      "spaces"
    ],
    "no-duplicate-variable": true,
    "no-eval": true,
    "no-internal-module": true,
    "no-trailing-whitespace": true,
    "no-unsafe-finally": true,
    "no-var-keyword": true,
    "one-line": [
      true,
      "check-open-brace",
      "check-whitespace"
    ],
    "quotemark": [

ngx-authAngular 16+ Authentication Module项目地址:https://gitcode.com/gh_mirrors/ng/ngx-auth

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

秋或依

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

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

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

打赏作者

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

抵扣说明:

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

余额充值