diff --git a/.fatherrc.ts b/.fatherrc.ts index 00146e346..0ce07a5e0 100644 --- a/.fatherrc.ts +++ b/.fatherrc.ts @@ -8,6 +8,7 @@ const headPkgs = [ 'resourcer', 'actions', 'client', + 'server' ]; const tailPkgs = []; const otherPkgs = readdirSync(join(__dirname, 'packages')).filter( diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 000000000..f8fe3720a --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,47 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js CI + +on: [push] + +jobs: + test: + strategy: + matrix: + node_version: ['12'] + db_dialect: ['postgres'] + pg_version: ['12'] + + runs-on: ubuntu-latest + container: node:${{ matrix.node_version }} + services: + # Label used to access the service container + postgres: + # Docker Hub image + image: postgres:${{ matrix.pg_version }} + # Provide the password for postgres + env: + POSTGRES_USER: nocobase + POSTGRES_PASSWORD: password + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + steps: + - uses: actions/checkout@v2 + - run: npm i + - run: npm run bootstrap + - run: npm run build + - name: Test + run: npm test + env: + DB_DIALECT: ${{ matrix.db_dialect }} + DB_HOST: ${{ matrix.db_dialect }} + DB_PORT: 5432 + DB_USER: nocobase + DB_PASSWORD: password + DB_DATABASE: nocobase diff --git a/package.json b/package.json index e04a0e684..9c52eb4b0 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@types/koa__router": "^8.0.2", "@types/lodash": "^4.14.158", "@types/node": "^14.0.23", - "@types/react": "^16.9.53", + "@types/react": "16.14.0", "@types/supertest": "^2.0.10", "@typescript-eslint/eslint-plugin": "^3.6.1", "@typescript-eslint/parser": "^3.6.1", diff --git a/packages/app/package.json b/packages/app/package.json index 02a53358e..5c3c60b44 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -38,8 +38,8 @@ "lint-staged": "^10.0.7", "nodemon": "^2.0.6", "prettier": "^1.19.1", - "react": "^16.12.0", - "react-dom": "^16.12.0", + "react": "16.14.0", + "react-dom": "16.14.0", "react-sortable-hoc": "^1.11.0", "styled-components": "^5.2.1", "umi": "^3.2.23", diff --git a/packages/client/package.json b/packages/client/package.json index dc3c6b512..908bf2189 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -3,11 +3,15 @@ "version": "0.3.0-alpha.0", "main": "lib/index.js", "license": "MIT", + "resolutions": { + "@types/react": "16.14.0" + }, "dependencies": { - "@ant-design/icons": "^4.2.2", + "@ant-design/icons": "^4.2.2", + "@types/react": "16.14.0", "ahooks": "^2.7.1", "antd": "^4.7.3", - "react": "^16.12.0", + "react": "16.14.0", "umi": "^3.2.24", "umi-request": "^1.3.5" } diff --git a/packages/database/src/__tests__/tables.test.ts b/packages/database/src/__tests__/tables.test.ts index cdda3014c..af71ff23d 100644 --- a/packages/database/src/__tests__/tables.test.ts +++ b/packages/database/src/__tests__/tables.test.ts @@ -94,9 +94,10 @@ describe('tables', () => { ], }); expect(db.getModel('baz').options.indexes).toStrictEqual(db.getTable('baz').getModelOptions().indexes); - expect(db.getTable('baz').getModelOptions().indexes).toStrictEqual([ - { fields: [ 'col1' ], name: 'baz_col1', type: '', parser: null }, - { fields: [ 'col2', 'col3' ], name: 'baz_col2_col3', type: '', parser: null } + // @ts-ignore + expect(db.getTable('baz').getModelOptions().indexes).toMatchObject([ + { fields: [ 'col1' ], name: 'baz_col1', parser: null }, + { fields: [ 'col2', 'col3' ], name: 'baz_col2_col3', parser: null } ]); }); @@ -127,9 +128,10 @@ describe('tables', () => { ], }); expect(db.getModel('baz2').options.indexes).toStrictEqual(db.getTable('baz2').getModelOptions().indexes); - expect(db.getTable('baz2').getModelOptions().indexes).toStrictEqual([ - { fields: [ 'col1' ], name: 'baz2_col1', type: '', parser: null }, - { fields: [ 'col2', 'col3' ], name: 'baz2_col2_col3', type: '', parser: null }, + // @ts-ignore + expect(db.getTable('baz2').getModelOptions().indexes).toMatchObject([ + { fields: [ 'col1' ], name: 'baz2_col1', parser: null }, + { fields: [ 'col2', 'col3' ], name: 'baz2_col2_col3', parser: null }, ]); }); }); diff --git a/packages/father-build/src/fixtures/build/babel-syntax/package.json b/packages/father-build/src/fixtures/build/babel-syntax/package.json index 1368588bd..55ef290f1 100644 --- a/packages/father-build/src/fixtures/build/babel-syntax/package.json +++ b/packages/father-build/src/fixtures/build/babel-syntax/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "react": "^16.8.4" + "react": "16" } } diff --git a/packages/plugin-pages/package.json b/packages/plugin-pages/package.json index a4b18ee71..8c505f697 100644 --- a/packages/plugin-pages/package.json +++ b/packages/plugin-pages/package.json @@ -8,6 +8,6 @@ "@nocobase/database": "^0.3.0-alpha.0", "@nocobase/resourcer": "^0.3.0-alpha.0", "@nocobase/client": "^0.3.0-alpha.0", - "react": "^16.12.0" + "react": "16.14.0" } } diff --git a/packages/plugin-users/package.json b/packages/plugin-users/package.json index 11bc4de47..f9b0039d0 100644 --- a/packages/plugin-users/package.json +++ b/packages/plugin-users/package.json @@ -3,6 +3,9 @@ "version": "0.3.0-alpha.0", "main": "lib/index.js", "license": "MIT", + "resolutions": { + "@types/react": "16.14.0" + }, "peerDependencies": { "umi": "^3.2.23" }, @@ -14,6 +17,7 @@ "dependencies": { "@nocobase/client": "^0.3.0-alpha.0", "@nocobase/database": "^0.3.0-alpha.0", - "@nocobase/resourcer": "^0.3.0-alpha.0" + "@nocobase/resourcer": "^0.3.0-alpha.0", + "@types/react": "16.14.0" } }