0.0.8 • Published 9 months ago

@metad/adapter v0.0.8

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

Pangolin

Adding capabilities to your workspace

Nx supports many plugins which add capabilities for developing different types of applications and different tools.

These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well.

  1. 创建空项目
    1. npx --ignore-existing create-nx-workspace pangolin --preset=empty
  2. 创建 npm package
    1. yarn nx g npm-package contracts // 手动创建吧 yarn nx g @nrwl/workspace:lib component-store ?
    2. yarn --cwd ./packages/contracts build 构建测试一下这个 npm ts 项目
  3. 创建 Nest application
    1. yarn add -D @nrwl/nest 添加依赖包
    2. yarn nx g @nrwl/nest:application api 生成 nest app
    3. yarn nx serve api 运行测试一下 nest app
  4. 创建 Nest library in packages
    1. cd packages
    2. nest new server
    3. cd server
    4. yarn run start:dev
      1. nest g mo story 新建 Nest Module
      2. nest g co story 新建 Nest Controller
      3. nest g s story 新建 Nest Service
  5. 创建 Angular 应用
    1. yarn add -D @nrwl/angular
    2. nx g @nrwl/angular:app cloud
  6. 创建 React 应用
    1. npm i -D @nrwl/react
    2. yarn nx g @nrwl/web:webpack5
    3. yarn nx g @nrwl/react:application --help
  7. 创建 Electron 应用
  8. 创建 小程序 应用
    1. npm install -g @tarojs/cli
  9. 创建 Angular Library
  10. yarn nx g @nrwl/angular:lib material-theme
  11. yarn nx g @nrwl/angular:module auth --project=cloud
  12. yarn nx g @nrwl/angular:library --name=workflow --directory=apps --buildable --lazy --parentModule=apps/cloud/src/app/features/features.module.ts --routing --no-interactive --dry-run
  13. 添加 Storybook
    1. yarn add -W --dev @nrwl/storybook
    2. nx g @nrwl/angular:storybook-configuration analytical-card
    3. nx g @nrwl/angular:stories analytical-card
    4. nx storybook component-angular --projectBuildConfig=component-angular:build-storybook 运行 Storybook

Create New JS Library

  • Run nx generate @nrwl/js:library --name=LibraryName --importPath=@metad/LibraryName --buildable new project
  • Go to packages/LibraryName/tsconfig.json and remove module: CommonJs.
  • Go to packages/LibraryName/packages.json and remove type: commonjs.
  • Create in packages/LibraryName a file called .babelrc that contain
{
  "presets": ["@nrwl/web/babel"]
}

JS Lib Compatible with ES/AMD/UMD/CJS module systems

yarn add -W -D @nrwl/web

Go to packages/LibraryName/tsconfig.json and change module from CommonJs to EsNext or ES6.

Create in packages/LibraryName a json called babel.config.json that will contain {}.

Go to packages/LibraryName/project.json and change the "build" property to

"build": {
  "executor": "@nrwl/web:rollup",
  "outputs": ["{options.outputPath}"],
  "options": {
    "updateBuildableProjectDepsInPackageJson": false,
    "outputPath": "dist/packages/LibraryName",
    "tsConfig": "packages/LibraryName/tsconfig.lib.json",
    "project": "packages/LibraryName/package.json",
    "entryFile": "packages/LibraryName/src/index.ts",
    "assets": [
      {
        "glob": "README.md",
        "input": ".",
        "output": "."
      }
    ],
    "format": ["cjs", "esm", "umd"]
  }
}

How to easily create JS libraries compatible with ES/AMD/UMD/CJS module systems using Nx

Compodoc

npx @compodoc/compodoc -p tsconfig.json -s

Build

  • sudo docker build --target rpa -t pangolin/rpa:latest .
  • sudo docker build --target production -t pangolin/api:latest .
  • sudo docker build --target webapp -t pangolin/webapp:latest .

Modules

  • packages/adapter 调用数据源的适配器, 被用于 agent 段和 server 端
  • packages/ai 用于交互式机器人解析数据分析会话
  • packages/analytics 数据分析服务
  • packages/auth 授权功能模块
  • packages/common 通用功能模块
  • packages/config 配置功能模块
  • packages/contracts 全局协议数据类型定义
  • packages/olap 多维分析服务
  • packages/server 基础设施服务
  • packages/workflow 数据 ETL 服务

Dep Ggraph

nx dep-graph

Test

nx test application --watch

olap启动: mvn spring-boot:run

docker启动: docker-compose -f .\docker-compose.dev.yml up

后端启动: (1) yarn build:backend:all (2) yarn start:api

前端启动: yarn start:cloud:dev

0.0.8

9 months ago

0.0.7

1 year ago

0.0.5

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.4

1 year ago

0.0.2

2 years ago

0.0.1

2 years ago