From c8b8d749ac0b9a2a00f85c1fa675215855574ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pradel=20Le=CC=81o?= Date: Tue, 14 Dec 2021 12:02:16 +0100 Subject: [PATCH 1/4] feat: setup turbomodule --- .gitignore | 1 + package.json | 16 +++++++++++++++- pnpm-lock.yaml | 15 +++++++++++++++ pnpm-workspace.yaml | 6 +++--- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 7fa39d066..3bbe6ab78 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,6 @@ packages/*/package-lock.json schema.json .DS_Store .eslintcache +.turbo build/ diff --git a/package.json b/package.json index be9c80150..8d2a9bfac 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "scripts": { "start": "lerna exec -- pnpm run start", "clean": "lerna run clean; rm -rf node_modules; rm -rf packages/**/node_modules;", - "compile": "lerna run compile", + "compile": "turbo run compile", "publish": "lerna publish", "publish:canary": "pnpm run publish -- --canary", "test": "pnpm run test:lint && pnpm run compile && pnpm run coverage", @@ -53,6 +53,19 @@ "automerge": false } }, + "turbo": { + "baseBranch": "origin/master", + "pipeline": { + "compile": { + "dependsOn": [ + "^compile" + ], + "outputs": [ + "lib/**" + ] + } + } + }, "repository": { "type": "git", "url": "https://github.com/js-accounts/accounts" @@ -71,6 +84,7 @@ "lerna": "4.0.0", "lint-staged": "12.0.2", "prettier": "2.4.1", + "turbo": "1.0.9", "typescript": "4.5.2" }, "collective": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b7a5b04e7..606253e6c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,6 +20,7 @@ importers: lerna: 4.0.0 lint-staged: 12.0.2 prettier: 2.4.1 + turbo: 1.0.9 typescript: 4.5.2 devDependencies: '@changesets/changelog-github': 0.4.1 @@ -34,6 +35,7 @@ importers: lerna: 4.0.0 lint-staged: 12.0.2 prettier: 2.4.1 + turbo: 1.0.9 typescript: 4.5.2 examples/accounts-boost: @@ -24810,6 +24812,14 @@ packages: dependencies: safe-buffer: 5.2.1 + /turbo/1.0.9: + resolution: {integrity: sha512-th0vdSpiO0gWQfehhTsG6vDXnq2fRXwvWSy1/LW2PBosv7VGgD2RENRVpjvPCNo7xEnkF6hZXnBfz0Tlvwu32A==} + hasBin: true + requiresBuild: true + dependencies: + zlib: 1.0.5 + dev: true + /tweetnacl/0.14.5: resolution: {integrity: sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=} @@ -26549,6 +26559,11 @@ packages: /zen-observable/0.8.15: resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} + /zlib/1.0.5: + resolution: {integrity: sha1-bnyXL8NxxkWmr7A6sUdp3vEU/MA=} + engines: {node: '>=0.2.0'} + dev: true + /zwitch/1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} dev: false diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 22fef3fa1..3ed625600 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: - - 'packages/**' - - 'examples/**' - - 'website/**' + - 'packages/*' + - 'examples/*' + - 'website' From cc434925a7ee6af61db03056ccc823f6e963a1f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pradel=20Le=CC=81o?= Date: Mon, 20 Dec 2021 10:04:37 +0100 Subject: [PATCH 2/4] upgrade turbo and fix glob issue --- package.json | 2 +- pnpm-lock.yaml | 15 ++++----------- pnpm-workspace.yaml | 4 ++-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index 8d2a9bfac..b8096d5c8 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "lerna": "4.0.0", "lint-staged": "12.0.2", "prettier": "2.4.1", - "turbo": "1.0.9", + "turbo": "1.0.19", "typescript": "4.5.2" }, "collective": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 606253e6c..80724d23d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -20,7 +20,7 @@ importers: lerna: 4.0.0 lint-staged: 12.0.2 prettier: 2.4.1 - turbo: 1.0.9 + turbo: 1.0.19 typescript: 4.5.2 devDependencies: '@changesets/changelog-github': 0.4.1 @@ -35,7 +35,7 @@ importers: lerna: 4.0.0 lint-staged: 12.0.2 prettier: 2.4.1 - turbo: 1.0.9 + turbo: 1.0.19 typescript: 4.5.2 examples/accounts-boost: @@ -24812,12 +24812,10 @@ packages: dependencies: safe-buffer: 5.2.1 - /turbo/1.0.9: - resolution: {integrity: sha512-th0vdSpiO0gWQfehhTsG6vDXnq2fRXwvWSy1/LW2PBosv7VGgD2RENRVpjvPCNo7xEnkF6hZXnBfz0Tlvwu32A==} + /turbo/1.0.19: + resolution: {integrity: sha512-/gdEdpdludyHX+344JQ84bglK33dI4IWTtGkBkfJnSQW+lC3/JFAu9jy+4zNK2gdzxjwcB2/qQK+Pv53SZd1Kw==} hasBin: true requiresBuild: true - dependencies: - zlib: 1.0.5 dev: true /tweetnacl/0.14.5: @@ -26559,11 +26557,6 @@ packages: /zen-observable/0.8.15: resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==} - /zlib/1.0.5: - resolution: {integrity: sha1-bnyXL8NxxkWmr7A6sUdp3vEU/MA=} - engines: {node: '>=0.2.0'} - dev: true - /zwitch/1.0.5: resolution: {integrity: sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw==} dev: false diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 3ed625600..6e245c78c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,4 +1,4 @@ packages: - - 'packages/*' - - 'examples/*' + - 'packages/**' + - 'examples/**' - 'website' From 5fc64c3905332fb656a8ec69f80f77c5f2c799c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pradel=20Le=CC=81o?= Date: Mon, 20 Dec 2021 10:37:57 +0100 Subject: [PATCH 3/4] try to speed up ts --- packages/database-tests/tsconfig.json | 3 ++- packages/database-typeorm/tsconfig.json | 3 ++- packages/e2e/tsconfig.json | 3 ++- packages/error/tsconfig.json | 3 ++- packages/express-session/tsconfig.json | 3 ++- packages/graphql-api/tsconfig.json | 3 ++- packages/graphql-client/tsconfig.json | 3 ++- packages/magic-link/tsconfig.json | 3 ++- packages/oauth-instagram/tsconfig.json | 3 ++- packages/oauth-twitter/tsconfig.json | 3 ++- packages/oauth/tsconfig.json | 3 ++- packages/password/tsconfig.json | 3 ++- packages/rest-client/tsconfig.json | 3 ++- packages/rest-express/tsconfig.json | 3 ++- packages/server/tsconfig.json | 3 ++- packages/two-factor/tsconfig.json | 3 ++- packages/types/tsconfig.json | 3 ++- 17 files changed, 34 insertions(+), 17 deletions(-) diff --git a/packages/database-tests/tsconfig.json b/packages/database-tests/tsconfig.json index 91b839b3e..bf89cfae4 100644 --- a/packages/database-tests/tsconfig.json +++ b/packages/database-tests/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "outDir": "./lib", "target": "esnext", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/database-typeorm/tsconfig.json b/packages/database-typeorm/tsconfig.json index 24b7d700f..12f4a9b81 100644 --- a/packages/database-typeorm/tsconfig.json +++ b/packages/database-typeorm/tsconfig.json @@ -4,7 +4,8 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/e2e/tsconfig.json b/packages/e2e/tsconfig.json index ea4603c63..cfc85fafc 100644 --- a/packages/e2e/tsconfig.json +++ b/packages/e2e/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "rootDir": "./src", "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] } } diff --git a/packages/error/tsconfig.json b/packages/error/tsconfig.json index 24fad94f0..4ec63ea58 100644 --- a/packages/error/tsconfig.json +++ b/packages/error/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/express-session/tsconfig.json b/packages/express-session/tsconfig.json index 848b9b224..c96e799a1 100644 --- a/packages/express-session/tsconfig.json +++ b/packages/express-session/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/graphql-api/tsconfig.json b/packages/graphql-api/tsconfig.json index 24fad94f0..4ec63ea58 100644 --- a/packages/graphql-api/tsconfig.json +++ b/packages/graphql-api/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/graphql-client/tsconfig.json b/packages/graphql-client/tsconfig.json index 17ac9240b..9f65c454c 100644 --- a/packages/graphql-client/tsconfig.json +++ b/packages/graphql-client/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "outDir": "./lib", "importHelpers": true, - "target": "es5" + "target": "es5", + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/magic-link/tsconfig.json b/packages/magic-link/tsconfig.json index 24fad94f0..4ec63ea58 100644 --- a/packages/magic-link/tsconfig.json +++ b/packages/magic-link/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/oauth-instagram/tsconfig.json b/packages/oauth-instagram/tsconfig.json index 848b9b224..c96e799a1 100644 --- a/packages/oauth-instagram/tsconfig.json +++ b/packages/oauth-instagram/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/oauth-twitter/tsconfig.json b/packages/oauth-twitter/tsconfig.json index 848b9b224..c96e799a1 100644 --- a/packages/oauth-twitter/tsconfig.json +++ b/packages/oauth-twitter/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/oauth/tsconfig.json b/packages/oauth/tsconfig.json index 848b9b224..c96e799a1 100644 --- a/packages/oauth/tsconfig.json +++ b/packages/oauth/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/password/tsconfig.json b/packages/password/tsconfig.json index 24fad94f0..4ec63ea58 100644 --- a/packages/password/tsconfig.json +++ b/packages/password/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/rest-client/tsconfig.json b/packages/rest-client/tsconfig.json index 6e1c236d7..38f8a9a22 100644 --- a/packages/rest-client/tsconfig.json +++ b/packages/rest-client/tsconfig.json @@ -4,7 +4,8 @@ "outDir": "./lib", "importHelpers": true, "target": "es5", - "lib": ["es2019", "dom"] + "lib": ["es2019", "dom"], + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/rest-express/tsconfig.json b/packages/rest-express/tsconfig.json index 24fad94f0..4ec63ea58 100644 --- a/packages/rest-express/tsconfig.json +++ b/packages/rest-express/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/server/tsconfig.json b/packages/server/tsconfig.json index 24fad94f0..4ec63ea58 100644 --- a/packages/server/tsconfig.json +++ b/packages/server/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/two-factor/tsconfig.json b/packages/two-factor/tsconfig.json index 24fad94f0..4ec63ea58 100644 --- a/packages/two-factor/tsconfig.json +++ b/packages/two-factor/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json index 24fad94f0..4ec63ea58 100644 --- a/packages/types/tsconfig.json +++ b/packages/types/tsconfig.json @@ -2,7 +2,8 @@ "extends": "../../tsconfig", "compilerOptions": { "outDir": "./lib", - "importHelpers": true + "importHelpers": true, + "typeRoots": ["./node_modules/@types/"] }, "include": ["src/**/*.ts"], "exclude": ["node_modules"] From 9aad8128f096268c27225692b231b220ab2c4ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pradel=20Le=CC=81o?= Date: Mon, 20 Dec 2021 10:48:56 +0100 Subject: [PATCH 4/4] fix types --- packages/express-session/package.json | 1 + pnpm-lock.yaml | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/express-session/package.json b/packages/express-session/package.json index 36ada1501..f3834ddae 100644 --- a/packages/express-session/package.json +++ b/packages/express-session/package.json @@ -43,6 +43,7 @@ "@types/express-session": "1.17.4", "@types/jest": "27.0.2", "@types/lodash": "4.14.177", + "@types/node": "16.11.7", "@types/request-ip": "0.0.37", "express": "4.17.1", "express-session": "1.17.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 80724d23d..c8b95b5e5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -710,6 +710,7 @@ importers: '@types/express-session': 1.17.4 '@types/jest': 27.0.2 '@types/lodash': 4.14.177 + '@types/node': 16.11.7 '@types/request-ip': 0.0.37 express: 4.17.1 express-session: 1.17.2 @@ -730,6 +731,7 @@ importers: '@types/express-session': 1.17.4 '@types/jest': 27.0.2 '@types/lodash': 4.14.177 + '@types/node': 16.11.7 '@types/request-ip': 0.0.37 express: 4.17.1 express-session: 1.17.2 @@ -8429,7 +8431,7 @@ packages: resolution: {integrity: sha512-a6bTJ21vFOGIkwM0kzh9Yr89ziVxq4vYH2fQ6N8AeipEzai/cFK6aGMArIkUeIdRIgpwQa+2bXiLuUJCpSf2Cg==} dependencies: '@types/connect': 3.4.35 - '@types/node': 16.4.10 + '@types/node': 16.11.7 /@types/body-parser/1.19.2: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} @@ -8492,7 +8494,7 @@ packages: /@types/express-serve-static-core/4.17.24: resolution: {integrity: sha512-3UJuW+Qxhzwjq3xhwXm2onQcFHn76frIYVbTu+kn24LFxI+dEhdfISDFovPB8VpEgW8oQCTpRuCe+0zJxB7NEA==} dependencies: - '@types/node': 16.11.4 + '@types/node': 16.11.7 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 @@ -8700,13 +8702,11 @@ packages: /@types/node/16.11.4: resolution: {integrity: sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ==} + dev: true /@types/node/16.11.7: resolution: {integrity: sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==} - /@types/node/16.4.10: - resolution: {integrity: sha512-TmVHsm43br64js9BqHWqiDZA+xMtbUpI1MBIA0EyiBmoV9pcEYFOSdj5fr6enZNfh4fChh+AGOLIzGwJnkshyQ==} - /@types/normalize-package-data/2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true @@ -8787,7 +8787,7 @@ packages: /@types/request-ip/0.0.37: resolution: {integrity: sha512-uw6/i3rQnpznxD7LtLaeuZytLhKZK6bRoTS6XVJlwxIOoOpEBU7bgKoVXDNtOg4Xl6riUKHa9bjMVrL6ESqYlQ==} dependencies: - '@types/node': 16.11.4 + '@types/node': 16.11.7 dev: true /@types/request-promise/4.1.48: @@ -8829,7 +8829,7 @@ packages: resolution: {integrity: sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==} dependencies: '@types/mime': 1.3.2 - '@types/node': 16.4.10 + '@types/node': 16.11.7 /@types/shortid/0.0.29: resolution: {integrity: sha1-gJPuBBam4r8qpjOBCRFLP7/6Dps=}