From e11e9d12cf75f791abc5e50e57665f864cc8101d Mon Sep 17 00:00:00 2001 From: Ben Irvin Date: Mon, 12 Dec 2022 19:02:28 +0100 Subject: [PATCH 01/10] add compile step --- .github/workflows/tests.yml | 8 ++++++++ package.json | 3 ++- packages/core/data-transfer/package.json | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 497d804e64..1d55210f26 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,6 +34,8 @@ jobs: key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} - run: yarn install --frozen-lockfile + - name: Compile + run: yarn compile - name: Run lint run: yarn run -s lint @@ -55,6 +57,8 @@ jobs: key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} - run: yarn install --frozen-lockfile + - name: Compile + run: yarn compile - name: Run tests run: yarn run -s test:unit --coverage - name: Upload coverage to Codecov @@ -84,6 +88,8 @@ jobs: - run: yarn install --frozen-lockfile - name: Build run: yarn build + - name: Compile + run: yarn compile - name: Run test run: yarn run -s test:front --coverage - name: Upload coverage to Codecov @@ -231,6 +237,7 @@ jobs: SQLITE_PKG: ${{ matrix.sqlite_pkg }} with: dbOptions: '--dbclient=sqlite-legacy --dbfile=./tmp/data.db' + # EE api_ee_pg: runs-on: ubuntu-latest @@ -275,6 +282,7 @@ jobs: with: dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi' runEE: true + api_ee_mysql: runs-on: ubuntu-latest needs: [lint, unit_back, unit_front] diff --git a/package.json b/package.json index b53074e94b..ed3fcec155 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,11 @@ ], "scripts": { "prepare": "husky install", - "setup": "yarn clean && yarn && yarn build", + "setup": "yarn clean && yarn && yarn compile && yarn build", "clean": "lerna run --stream clean --no-private", "watch": "lerna run --stream watch --no-private", "build": "lerna run --stream build --no-private", + "compile": "lerna run --stream compile --no-private", "generate": "plop --plopfile ./packages/generators/admin/plopfile.js", "lint": "npm-run-all -p lint:code lint:css", "lint:code": "eslint .", diff --git a/packages/core/data-transfer/package.json b/packages/core/data-transfer/package.json index 4b60e1b625..9095135eeb 100644 --- a/packages/core/data-transfer/package.json +++ b/packages/core/data-transfer/package.json @@ -27,9 +27,9 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { - "build": "tsc -p tsconfig.json", + "compile": "tsc -p tsconfig.json", "clean": "rimraf ./dist", - "build:clean": "yarn clean && yarn build", + "compile:clean": "yarn clean && yarn compile", "watch": "yarn build -w", "test:unit": "jest --verbose" }, From 9090650e88e331a3c1dbee8eea454851640664d4 Mon Sep 17 00:00:00 2001 From: Ben Irvin Date: Mon, 12 Dec 2022 19:06:39 +0100 Subject: [PATCH 02/10] allow typescript package to attempt to be resolved --- packages/core/strapi/lib/commands/transfer/export.js | 2 -- packages/core/strapi/lib/commands/transfer/import.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/packages/core/strapi/lib/commands/transfer/export.js b/packages/core/strapi/lib/commands/transfer/export.js index 4d92647a32..e74d6432db 100644 --- a/packages/core/strapi/lib/commands/transfer/export.js +++ b/packages/core/strapi/lib/commands/transfer/export.js @@ -4,8 +4,6 @@ const { createLocalFileDestinationProvider, createLocalStrapiSourceProvider, createTransferEngine, - // TODO: we need to solve this issue with typescript modules - // eslint-disable-next-line import/no-unresolved, node/no-missing-require } = require('@strapi/data-transfer'); const { isObject, isString, isFinite, toNumber } = require('lodash/fp'); const fs = require('fs-extra'); diff --git a/packages/core/strapi/lib/commands/transfer/import.js b/packages/core/strapi/lib/commands/transfer/import.js index d0413a91a4..864f5edd4b 100644 --- a/packages/core/strapi/lib/commands/transfer/import.js +++ b/packages/core/strapi/lib/commands/transfer/import.js @@ -4,8 +4,6 @@ const { createLocalFileSourceProvider, createLocalStrapiDestinationProvider, createTransferEngine, - // TODO: we need to solve this issue with typescript modules - // eslint-disable-next-line import/no-unresolved, node/no-missing-require } = require('@strapi/data-transfer'); const { isObject } = require('lodash/fp'); const path = require('path'); From 6a532e3bb3cb972c288c2d50b3db784f428ab444 Mon Sep 17 00:00:00 2001 From: Ben Irvin Date: Mon, 12 Dec 2022 19:08:42 +0100 Subject: [PATCH 03/10] fix watch --- packages/core/data-transfer/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/data-transfer/package.json b/packages/core/data-transfer/package.json index 9095135eeb..d91f1dbfaf 100644 --- a/packages/core/data-transfer/package.json +++ b/packages/core/data-transfer/package.json @@ -30,7 +30,7 @@ "compile": "tsc -p tsconfig.json", "clean": "rimraf ./dist", "compile:clean": "yarn clean && yarn compile", - "watch": "yarn build -w", + "watch": "yarn compile -w", "test:unit": "jest --verbose" }, "directories": { From 252c562a8dea10da5175dcc83e59b3bbc4e3c88f Mon Sep 17 00:00:00 2001 From: Ben Irvin Date: Tue, 27 Dec 2022 12:52:39 +0100 Subject: [PATCH 04/10] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ed3fcec155..e60bfaa3ac 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ ], "scripts": { "prepare": "husky install", - "setup": "yarn clean && yarn && yarn compile && yarn build", + "setup": "yarn && yarn clean && yarn compile && yarn build", "clean": "lerna run --stream clean --no-private", "watch": "lerna run --stream watch --no-private", "build": "lerna run --stream build --no-private", From 160a1683b50dd0487dd9fffc66888e800c616b6c Mon Sep 17 00:00:00 2001 From: Christian Capeans Date: Fri, 30 Dec 2022 09:48:36 +0100 Subject: [PATCH 05/10] Add no missing require to data-transfer --- packages/core/admin/server/register.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/admin/server/register.js b/packages/core/admin/server/register.js index 1789abf77e..b02e8def3d 100644 --- a/packages/core/admin/server/register.js +++ b/packages/core/admin/server/register.js @@ -1,5 +1,6 @@ 'use strict'; +// eslint-disable-next-line import/no-unresolved, node/no-missing-require const { register: registerDataTransfer } = require('@strapi/data-transfer'); const registerAdminPanelRoute = require('./routes/serve-admin-panel'); From fdcec5ea253dc79691b53db509e0879e8958983d Mon Sep 17 00:00:00 2001 From: Convly Date: Fri, 30 Dec 2022 10:55:40 +0100 Subject: [PATCH 06/10] Rename compile to build:ts --- .github/workflows/tests.yml | 12 ++++++------ package.json | 2 +- packages/core/data-transfer/package.json | 10 ++++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1d55210f26..5596ab2cdf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,8 +34,8 @@ jobs: key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} - run: yarn install --frozen-lockfile - - name: Compile - run: yarn compile + - name: Build TypeScript packages + run: yarn build:ts - name: Run lint run: yarn run -s lint @@ -57,8 +57,8 @@ jobs: key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} - run: yarn install --frozen-lockfile - - name: Compile - run: yarn compile + - name: Build TypeScript packages + run: yarn build:ts - name: Run tests run: yarn run -s test:unit --coverage - name: Upload coverage to Codecov @@ -88,8 +88,8 @@ jobs: - run: yarn install --frozen-lockfile - name: Build run: yarn build - - name: Compile - run: yarn compile + - name: Build TypeScript packages + run: yarn build:ts - name: Run test run: yarn run -s test:front --coverage - name: Upload coverage to Codecov diff --git a/package.json b/package.json index e60bfaa3ac..42ce2a3f5c 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "clean": "lerna run --stream clean --no-private", "watch": "lerna run --stream watch --no-private", "build": "lerna run --stream build --no-private", - "compile": "lerna run --stream compile --no-private", + "build:ts": "lerna run --stream build:ts --no-private", "generate": "plop --plopfile ./packages/generators/admin/plopfile.js", "lint": "npm-run-all -p lint:code lint:css", "lint:code": "eslint .", diff --git a/packages/core/data-transfer/package.json b/packages/core/data-transfer/package.json index bdcfd5a6f6..a4233d66f8 100644 --- a/packages/core/data-transfer/package.json +++ b/packages/core/data-transfer/package.json @@ -27,11 +27,13 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { - "compile": "tsc -p tsconfig.json", "clean": "rimraf ./dist", - "compile:clean": "yarn clean && yarn compile", - "watch": "yarn compile -w", - "test:unit": "jest --verbose" + "build": "yarn build:ts", + "build:ts": "tsc -p tsconfig.json", + "build:clean": "yarn clean && yarn build", + "watch": "yarn build:ts -w", + "test:unit": "jest --verbose", + "prepublishOnly": "yarn build:clean" }, "directories": { "lib": "./dist" From 7bbc065c353f84d07a78873f171f07e1026cf79a Mon Sep 17 00:00:00 2001 From: Convly Date: Fri, 30 Dec 2022 10:56:57 +0100 Subject: [PATCH 07/10] Update the setup script (compile => build:ts) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 42ce2a3f5c..ec7f407518 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ ], "scripts": { "prepare": "husky install", - "setup": "yarn && yarn clean && yarn compile && yarn build", + "setup": "yarn && yarn clean && yarn build:ts && yarn build", "clean": "lerna run --stream clean --no-private", "watch": "lerna run --stream watch --no-private", "build": "lerna run --stream build --no-private", From 3220d73f71d9015ab86020eab9a76ea6d1a5a56f Mon Sep 17 00:00:00 2001 From: Ben Irvin Date: Mon, 2 Jan 2023 11:07:00 +0100 Subject: [PATCH 08/10] remove build:ts from yarn setup --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 604a4b50e9..5e05b1bda3 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ ], "scripts": { "prepare": "husky install", - "setup": "yarn && yarn clean && yarn build:ts && yarn build", + "setup": "yarn && yarn clean && yarn build", "clean": "lerna run --stream clean --no-private", "watch": "lerna run --stream watch --no-private --parallel", "build": "lerna run --stream build --no-private", From 437c1b7e177fd736973b680c5be55ab4084f4704 Mon Sep 17 00:00:00 2001 From: Ben Irvin Date: Mon, 2 Jan 2023 11:10:29 +0100 Subject: [PATCH 09/10] remove extraneous build:ts, add comments --- .github/workflows/tests.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5596ab2cdf..f683c85b0a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -34,7 +34,7 @@ jobs: key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} - run: yarn install --frozen-lockfile - - name: Build TypeScript packages + - name: Build TypeScript packages # for lint we need to build ts, for rules checking if paths exist run: yarn build:ts - name: Run lint run: yarn run -s lint @@ -57,7 +57,7 @@ jobs: key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }} - run: yarn install --frozen-lockfile - - name: Build TypeScript packages + - name: Build TypeScript packages # for unit tests we need to build ts, for finding and mocking ts packages run: yarn build:ts - name: Run tests run: yarn run -s test:unit --coverage @@ -88,8 +88,6 @@ jobs: - run: yarn install --frozen-lockfile - name: Build run: yarn build - - name: Build TypeScript packages - run: yarn build:ts - name: Run test run: yarn run -s test:front --coverage - name: Upload coverage to Codecov From 1b4560ba28c4f014202ca69137258450ffed4fa8 Mon Sep 17 00:00:00 2001 From: Ben Irvin Date: Mon, 2 Jan 2023 11:12:09 +0100 Subject: [PATCH 10/10] alphabetize --- packages/core/data-transfer/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/data-transfer/package.json b/packages/core/data-transfer/package.json index 0ae176a828..8f8349b907 100644 --- a/packages/core/data-transfer/package.json +++ b/packages/core/data-transfer/package.json @@ -27,13 +27,13 @@ "main": "./dist/index.js", "types": "./dist/index.d.ts", "scripts": { - "clean": "rimraf ./dist", "build": "yarn build:ts", "build:ts": "tsc -p tsconfig.json", "build:clean": "yarn clean && yarn build", - "watch": "yarn build:ts -w --preserveWatchOutput", + "clean": "rimraf ./dist", + "prepublishOnly": "yarn build:clean", "test:unit": "jest --verbose", - "prepublishOnly": "yarn build:clean" + "watch": "yarn build:ts -w --preserveWatchOutput" }, "directories": { "lib": "./dist"