From 49f71420edf05a26c021de41c07c9e4b347ca15d Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 7 Apr 2021 09:50:00 +0800 Subject: [PATCH] chore: update npm packages --- docker-compose.yml | 8 ++------ nodemon.json | 6 ++++++ package.json | 6 ++++-- packages/actions/.npmignore | 8 ++++++++ packages/actions/package.json | 2 +- packages/api/.npmignore | 7 +++++++ packages/api/nodemon.json | 6 ------ packages/api/package.json | 8 +++----- packages/api/src/app.ts | 7 ------- packages/api/src/dev.ts | 8 ++++++++ packages/app/.env.example | 19 ------------------- packages/app/.npmignore | 12 ++++++++++++ packages/app/nodemon.json | 2 +- packages/app/package.json | 2 +- packages/client/.npmignore | 7 +++++++ packages/database/.npmignore | 7 +++++++ packages/database/package.json | 5 +---- packages/plugin-action-logs/.npmignore | 7 +++++++ packages/plugin-automations/.npmignore | 7 +++++++ packages/plugin-china-region/.npmignore | 7 +++++++ packages/plugin-collections/.npmignore | 7 +++++++ packages/plugin-file-manager/.npmignore | 7 +++++++ packages/plugin-full-collections/.npmignore | 7 +++++++ packages/plugin-full-collections/package.json | 1 + packages/plugin-pages/.npmignore | 7 +++++++ packages/plugin-permissions/.npmignore | 7 +++++++ packages/plugin-users/.npmignore | 7 +++++++ packages/plugin-users/package.json | 6 +++--- packages/resourcer/.npmignore | 7 +++++++ packages/resourcer/package.json | 5 +---- packages/server/.npmignore | 7 +++++++ packages/server/package.json | 4 +--- 32 files changed, 151 insertions(+), 62 deletions(-) create mode 100644 nodemon.json create mode 100644 packages/actions/.npmignore create mode 100644 packages/api/.npmignore delete mode 100644 packages/api/nodemon.json create mode 100644 packages/api/src/dev.ts delete mode 100644 packages/app/.env.example create mode 100644 packages/app/.npmignore create mode 100644 packages/client/.npmignore create mode 100644 packages/database/.npmignore create mode 100644 packages/plugin-action-logs/.npmignore create mode 100644 packages/plugin-automations/.npmignore create mode 100644 packages/plugin-china-region/.npmignore create mode 100644 packages/plugin-collections/.npmignore create mode 100644 packages/plugin-file-manager/.npmignore create mode 100644 packages/plugin-full-collections/.npmignore create mode 100644 packages/plugin-pages/.npmignore create mode 100644 packages/plugin-permissions/.npmignore create mode 100644 packages/plugin-users/.npmignore create mode 100644 packages/resourcer/.npmignore create mode 100644 packages/server/.npmignore diff --git a/docker-compose.yml b/docker-compose.yml index 33d588c10..3e8c443b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,14 +8,10 @@ services: networks: - node-network environment: - - VERDACCIO_PORT=${VERDACCIO_PORT} + VERDACCIO_PORT: ${VERDACCIO_PORT} restart: always ports: - - "${VERDACCIO_PORT}:4873" - # volumes: - # - "./verdaccio/storage:/verdaccio/storage" - # - "./verdaccio/config:/verdaccio/conf" - # - "./verdaccio/plugins:/verdaccio/plugins" + - "${VERDACCIO_PORT}:${VERDACCIO_PORT}" mysql: image: mysql:5.7 environment: diff --git a/nodemon.json b/nodemon.json new file mode 100644 index 000000000..a03552072 --- /dev/null +++ b/nodemon.json @@ -0,0 +1,6 @@ +{ + "watch": ["packages/"], + "ignore": ["packages/app"], + "ext": "ts", + "exec": "ts-node ./packages/api/src/dev.ts" +} \ No newline at end of file diff --git a/package.json b/package.json index 758340061..8f4a83230 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "scripts": { "start": "cd packages/app && npm start", - "start-server": "cd packages/api && npm start", + "start-server": "nodemon", "start-client": "cd packages/app && npx umi dev", "pm2-start": "npx pm2 start packages/api/lib/index.js", "build-app": "cd packages/app && npm run build", @@ -15,7 +15,9 @@ "lint": "eslint --ext .ts,.tsx,.js \"packages/*/src/**.@(ts|tsx|js)\" --fix", "test": "npm run lint && jest", "debug": "node --inspect-brk node_modules/.bin/jest --runInBand", - "release": "npm run build && lerna publish --yes --registry https://npm.pkg.github.com" + "version:alpha": "lerna version prerelease --preid alpha --force-publish=* --no-git-tag-version -m \"chore(versions): publish packages %s\"", + "release:force": "lerna publish from-package --yes", + "release": "lerna publish" }, "devDependencies": { "@koa/router": "^9.3.1", diff --git a/packages/actions/.npmignore b/packages/actions/.npmignore new file mode 100644 index 000000000..d44041bb5 --- /dev/null +++ b/packages/actions/.npmignore @@ -0,0 +1,8 @@ +node_modules +*.log +docs +__tests__ +jest.config.js +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/actions/package.json b/packages/actions/package.json index 514277bfc..2b3826c69 100644 --- a/packages/actions/package.json +++ b/packages/actions/package.json @@ -2,11 +2,11 @@ "name": "@nocobase/actions", "version": "0.4.0-alpha.0", "description": "", + "license": "MIT", "main": "./lib/index.js", "types": "./lib/index.d.ts", "scripts": { }, - "license": "MIT", "dependencies": { "@nocobase/database": "^0.4.0-alpha.0", "@nocobase/resourcer": "^0.4.0-alpha.0" diff --git a/packages/api/.npmignore b/packages/api/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/api/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/api/nodemon.json b/packages/api/nodemon.json deleted file mode 100644 index afc01b317..000000000 --- a/packages/api/nodemon.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "watch": ["src", "../"], - "ignore": ["../app"], - "ext": "ts", - "exec": "ts-node ./src/index.ts" -} \ No newline at end of file diff --git a/packages/api/package.json b/packages/api/package.json index f74dae325..21ce4b172 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,7 +1,9 @@ { "name": "@nocobase/api", "version": "0.4.0-alpha.0", - "main": "lib/index.js", + "main": "./lib/index.js", + "types": "./lib/index.d.ts", + "license": "MIT", "scripts": { "start": "nodemon", "db-migrate": "ts-node ./src/migrate.ts" @@ -20,9 +22,5 @@ "@nocobase/plugin-users": "^0.4.0-alpha.0", "@nocobase/server": "^0.4.0-alpha.0", "koa-static": "^5.0.0" - }, - "devDependencies": { - "nodemon": "^2.0.6", - "typescript": "^3.9.6" } } diff --git a/packages/api/src/app.ts b/packages/api/src/app.ts index d2d7a0790..cd2e92bf8 100644 --- a/packages/api/src/app.ts +++ b/packages/api/src/app.ts @@ -1,5 +1,3 @@ -import path from 'path'; -import dotenv from 'dotenv'; import Api from '@nocobase/server'; // @ts-ignore @@ -12,11 +10,6 @@ const sync = global.sync || { console.log('process.env.NOCOBASE_ENV', process.env.NOCOBASE_ENV); -// TODO: env 需要换种方式加载 -dotenv.config({ - path: path.resolve(__dirname, '../../../.env'), -}); - const api = Api.create({ database: { username: process.env.DB_USER, diff --git a/packages/api/src/dev.ts b/packages/api/src/dev.ts new file mode 100644 index 000000000..668a4b9f9 --- /dev/null +++ b/packages/api/src/dev.ts @@ -0,0 +1,8 @@ +import path from 'path'; +import dotenv from 'dotenv'; + +dotenv.config({ + path: path.resolve(__dirname, '../../../.env'), +}); + +import './index'; diff --git a/packages/app/.env.example b/packages/app/.env.example deleted file mode 100644 index 51e1366e7..000000000 --- a/packages/app/.env.example +++ /dev/null @@ -1,19 +0,0 @@ -DB_DIALECT=postgres -DB_HOST=localhost -DB_PORT=5432 -DB_DATABASE=nocobase -DB_USER=test -DB_PASSWORD=test - -# DB_DIALECT=mysql -# DB_PORT=3306 - -DB_MYSQL_PORT=3306 -DB_POSTGRES_PORT=5432 - -API_PORT=23000 - -VERDACCIO_PORT=4873 - -LOCAL_STORAGE_BASE_URL=http://localhost:23000/uploads -USE_STATIC_SERVER=true diff --git a/packages/app/.npmignore b/packages/app/.npmignore new file mode 100644 index 000000000..7ef32b6ac --- /dev/null +++ b/packages/app/.npmignore @@ -0,0 +1,12 @@ +lib +mock +node_modules +*.log +docs +__tests__ +jest.config.js +tsconfig.json +src +.fatherrc.ts +.umirc.ts +nodemon.json \ No newline at end of file diff --git a/packages/app/nodemon.json b/packages/app/nodemon.json index 2c0d27e2a..379d42969 100644 --- a/packages/app/nodemon.json +++ b/packages/app/nodemon.json @@ -2,5 +2,5 @@ "watch": ["../"], "ignore": ["../app"], "ext": "ts", - "exec": "ts-node ../api/src/index.ts" + "exec": "ts-node ../api/src/dev.ts" } \ No newline at end of file diff --git a/packages/app/package.json b/packages/app/package.json index 189739ab2..8aa6f867a 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -20,7 +20,7 @@ "prettier --parser=typescript --write" ] }, - "dependencies": { + "devDependencies": { "@ant-design/pro-layout": "^5.0.12", "@formily/antd-components": "^1.3.6", "@lourenci/react-kanban": "^2.1.0", diff --git a/packages/client/.npmignore b/packages/client/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/client/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/database/.npmignore b/packages/database/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/database/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/database/package.json b/packages/database/package.json index e559dafab..52529bde4 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -4,17 +4,14 @@ "description": "", "main": "./lib/index.js", "types": "./lib/index.d.ts", - "scripts": {}, "license": "MIT", + "scripts": {}, "dependencies": { "bcrypt": "^5.0.0", "deepmerge": "^4.2.2", "glob": "^7.1.6", "sequelize": "^6.3.3" }, - "devDependencies": { - "typescript": "^3.9.6" - }, "repository": { "type": "git", "url": "git+https://github.com/nocobase/nocobase.git", diff --git a/packages/plugin-action-logs/.npmignore b/packages/plugin-action-logs/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-action-logs/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-automations/.npmignore b/packages/plugin-automations/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-automations/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-china-region/.npmignore b/packages/plugin-china-region/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-china-region/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-collections/.npmignore b/packages/plugin-collections/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-collections/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-file-manager/.npmignore b/packages/plugin-file-manager/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-file-manager/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-full-collections/.npmignore b/packages/plugin-full-collections/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-full-collections/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-full-collections/package.json b/packages/plugin-full-collections/package.json index af5afa968..c2ec6d45f 100644 --- a/packages/plugin-full-collections/package.json +++ b/packages/plugin-full-collections/package.json @@ -3,6 +3,7 @@ "version": "0.4.0-alpha.0", "main": "lib/index.js", "license": "MIT", + "private": false, "dependencies": { "@nocobase/server": "^0.4.0-alpha.0", "crypto-random-string": "^3.3.1", diff --git a/packages/plugin-pages/.npmignore b/packages/plugin-pages/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-pages/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-permissions/.npmignore b/packages/plugin-permissions/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-permissions/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-users/.npmignore b/packages/plugin-users/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/plugin-users/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/plugin-users/package.json b/packages/plugin-users/package.json index 47cbf57c4..26a21ee0e 100644 --- a/packages/plugin-users/package.json +++ b/packages/plugin-users/package.json @@ -5,11 +5,11 @@ "license": "MIT", "devDependencies": { "@nocobase/actions": "^0.4.0-alpha.0", - "@nocobase/server": "^0.4.0-alpha.0", - "crypto-random-string": "^3.3.0" + "@nocobase/server": "^0.4.0-alpha.0" }, "dependencies": { "@nocobase/database": "^0.4.0-alpha.0", - "@nocobase/resourcer": "^0.4.0-alpha.0" + "@nocobase/resourcer": "^0.4.0-alpha.0", + "crypto-random-string": "^3.3.0" } } diff --git a/packages/resourcer/.npmignore b/packages/resourcer/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/resourcer/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/resourcer/package.json b/packages/resourcer/package.json index 8d58e9167..f3faa1ca9 100644 --- a/packages/resourcer/package.json +++ b/packages/resourcer/package.json @@ -4,8 +4,8 @@ "description": "", "main": "./lib/index.js", "types": "./lib/index.d.ts", - "scripts": {}, "license": "MIT", + "scripts": {}, "dependencies": { "deepmerge": "^4.2.2", "koa-compose": "^4.1.0", @@ -13,9 +13,6 @@ "path-to-regexp": "^6.1.0", "qs": "^6.9.4" }, - "devDependencies": { - "typescript": "^3.9.6" - }, "repository": { "type": "git", "url": "git+https://github.com/nocobase/nocobase.git", diff --git a/packages/server/.npmignore b/packages/server/.npmignore new file mode 100644 index 000000000..461574b2f --- /dev/null +++ b/packages/server/.npmignore @@ -0,0 +1,7 @@ +node_modules +*.log +docs +__tests__ +tsconfig.json +src +.fatherrc.ts \ No newline at end of file diff --git a/packages/server/package.json b/packages/server/package.json index 88b0a4bc7..62285e2cb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -11,14 +11,12 @@ "@nocobase/actions": "^0.4.0-alpha.0", "@nocobase/database": "^0.4.0-alpha.0", "@nocobase/resourcer": "^0.4.0-alpha.0", - "@types/koa": "^2.11.6", "dotenv": "^8.2.0", "koa": "^2.13.0", "koa-bodyparser": "^4.3.0", "mockjs": "^1.1.0", "mysql2": "^2.1.0", "pg": "^8.3.3", - "pg-hstore": "^2.3.3", - "typescript": "^4.0.2" + "pg-hstore": "^2.3.3" } }