module.exports = (opts) => {
  const { projectName } = opts;
  return {
    name: projectName,
    version: '0.1.0',
    private: true,
    workspaces: ['packages/app/*', 'packages/plugins/*'],
    license: 'MIT',
    scripts: {
      start: 'concurrently --kill-others "yarn start-server -s" "yarn start-client"',
      bootstrap: 'lerna bootstrap',
      clean: 'rimraf -rf packages/{app,plugins}/*/{lib,esm,dist} && lerna clean',
      nocobase:
        'cross-env DOTENV_CONFIG_PATH=.env ts-node-dev -r dotenv/config -r tsconfig-paths/register ./packages/app/server/src/index.ts',
      'nocobase-prod': 'cross-env DOTENV_CONFIG_PATH=.env node -r dotenv/config packages/app/server/lib/index.js',
      'start-client': 'cd packages/app/client && yarn start',
      'start-server': 'yarn nocobase start',
      'start-pm2': 'pm2-runtime start --node-args="-r dotenv/config" packages/app/server/lib/index.js -- start',
      build: 'lerna run build',
      'build-docs': 'dumi build',
      test: 'node ./jest.cli.js -i',
      lint: 'eslint .',
    },
    resolutions: {
      '@types/react': '^17.0.0',
      '@types/react-dom': '^17.0.0',
    },
    dependencies: {
      'cross-env': '^7.0.3',
      dotenv: '^10.0.0',
      pm2: '^5.2.0',
    },
    devDependencies: {
      '@testing-library/react': '^12.1.2',
      '@types/jest': '^26.0.0',
      '@types/node': '^12.6.8',
      '@types/react': '^17.0.0',
      '@types/react-dom': '^17.0.0',
      '@typescript-eslint/eslint-plugin': '^4.9.1',
      '@typescript-eslint/parser': '^4.8.2',
      concurrently: '^7.0.0',
      eslint: '^7.14.0',
      'eslint-config-prettier': '^7.0.0',
      'eslint-plugin-import': '^2.13.0',
      'eslint-plugin-markdown': '^2.0.1',
      'eslint-plugin-node': '^11.1.0',
      'eslint-plugin-prettier': '^3.1.0',
      'eslint-plugin-promise': '^4.0.0',
      'eslint-plugin-react': '^7.14.2',
      'eslint-plugin-react-hooks': '^4.2.0',
      'eslint-plugin-vue': '^7.0.1',
      jest: '^26.0.0',
      'jest-codemods': '^0.19.1',
      'jest-dom': '^3.1.2',
      'jest-localstorage-mock': '^2.3.0',
      'jest-styled-components': '6.3.3',
      'jest-watch-lerna-packages': '^1.1.0',
      lerna: '^4.0.0',
      prettier: '^2.2.1',
      'pretty-format': '^24.0.0',
      'pretty-quick': '^3.1.0',
      rimraf: '^3.0.0',
      'ts-jest': '^26.0.0',
      'ts-loader': '^7.0.4',
      'ts-node': '^9.1.1',
      'ts-node-dev': '^1.1.8',
      'tsconfig-paths': '^3.12.0',
      typescript: '^4.1.5',
    },
  };
};
