Просмотр исходного кода

Merge branch 'master' into minor

Michael Bromley 4 лет назад
Родитель
Сommit
abc8bcd360

+ 4 - 0
CHANGELOG.md

@@ -1,3 +1,7 @@
+## <small>1.2.3 (2021-09-29)</small>
+
+This release fixes an error in the publishing of the TypeScript definitions from v1.2.2.
+
 ## <small>1.2.2 (2021-09-28)</small>
 
 

+ 1 - 1
lerna.json

@@ -2,7 +2,7 @@
   "packages": [
     "packages/*"
   ],
-  "version": "1.2.2",
+  "version": "1.2.3",
   "npmClient": "yarn",
   "useWorkspaces": true,
   "command": {

+ 2 - 1
package.json

@@ -16,12 +16,13 @@
     "docs:update-build-info": "ts-node scripts/docs/update-build-info.ts",
     "docs:build": "yarn docs:generate-graphql-docs && yarn docs:generate-typescript-docs && yarn docs:update-build-info",
     "codegen": "tsc -p scripts/codegen/plugins && ts-node scripts/codegen/generate-graphql-types.ts",
-    "version": "yarn check-imports && yarn check-angular-versions && yarn build && yarn generate-changelog && git add CHANGELOG.md && git add */version.ts",
+    "version": "yarn check-imports && yarn check-angular-versions && yarn build && yarn check-core-type-defs && yarn generate-changelog && git add CHANGELOG.md && git add */version.ts",
     "dev-server:start": "cd packages/dev-server && yarn start",
     "test": "lerna run test --stream --no-bail",
     "e2e": "lerna run e2e --stream --no-bail",
     "build": "lerna run build",
     "check-imports": "ts-node scripts/check-imports.ts",
+    "check-core-type-defs": "ts-node scripts/check-core-type-defs.ts",
     "check-angular-versions": "ts-node scripts/check-angular-versions.ts",
     "generate-changelog": "ts-node scripts/changelogs/generate-changelog.ts",
     "publish-release": "lerna publish -m \"chore: Publish %s\" --no-push --force-publish",

+ 3 - 3
packages/admin-ui-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/admin-ui-plugin",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
   "files": [
@@ -21,8 +21,8 @@
   "devDependencies": {
     "@types/express": "^4.17.8",
     "@types/fs-extra": "^9.0.1",
-    "@vendure/common": "^1.2.2",
-    "@vendure/core": "^1.2.2",
+    "@vendure/common": "^1.2.3",
+    "@vendure/core": "^1.2.3",
     "express": "^4.17.1",
     "rimraf": "^3.0.2",
     "typescript": "4.3.5"

+ 2 - 2
packages/admin-ui/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/admin-ui",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "license": "MIT",
   "scripts": {
     "ng": "ng",
@@ -39,7 +39,7 @@
     "@ng-select/ng-select": "^7.2.0",
     "@ngx-translate/core": "^13.0.0",
     "@ngx-translate/http-loader": "^6.0.0",
-    "@vendure/common": "^1.2.2",
+    "@vendure/common": "^1.2.3",
     "@webcomponents/custom-elements": "^1.4.3",
     "apollo-angular": "^2.4.0",
     "apollo-upload-client": "^14.1.3",

+ 1 - 1
packages/admin-ui/src/lib/core/src/common/version.ts

@@ -1,2 +1,2 @@
 // Auto-generated by the set-version.js script.
-export const ADMIN_UI_VERSION = '1.2.2';
+export const ADMIN_UI_VERSION = '1.2.3';

+ 3 - 3
packages/asset-server-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/asset-server-plugin",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
   "files": [
@@ -24,8 +24,8 @@
     "@types/fs-extra": "^9.0.8",
     "@types/node-fetch": "^2.5.8",
     "@types/sharp": "^0.27.1",
-    "@vendure/common": "^1.2.2",
-    "@vendure/core": "^1.2.2",
+    "@vendure/common": "^1.2.3",
+    "@vendure/core": "^1.2.3",
     "aws-sdk": "^2.856.0",
     "express": "^4.17.1",
     "node-fetch": "^2.6.1",

+ 1 - 1
packages/common/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/common",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "main": "index.js",
   "license": "MIT",
   "scripts": {

+ 2 - 2
packages/core/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/core",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "description": "A modern, headless ecommerce framework",
   "repository": {
     "type": "git",
@@ -49,7 +49,7 @@
     "@nestjs/testing": "7.6.17",
     "@nestjs/typeorm": "7.1.5",
     "@types/fs-extra": "^9.0.1",
-    "@vendure/common": "^1.2.2",
+    "@vendure/common": "^1.2.3",
     "apollo-server-express": "2.24.1",
     "bcrypt": "^5.0.0",
     "body-parser": "^1.19.0",

+ 3 - 3
packages/create/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/create",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "license": "MIT",
   "bin": {
     "create": "./index.js"
@@ -28,13 +28,13 @@
     "@types/handlebars": "^4.1.0",
     "@types/listr": "^0.14.2",
     "@types/semver": "^6.2.2",
-    "@vendure/core": "^1.2.2",
+    "@vendure/core": "^1.2.3",
     "rimraf": "^3.0.2",
     "ts-node": "^10.2.1",
     "typescript": "4.3.5"
   },
   "dependencies": {
-    "@vendure/common": "^1.2.2",
+    "@vendure/common": "^1.2.3",
     "chalk": "^4.1.0",
     "commander": "^7.1.0",
     "cross-spawn": "^7.0.3",

+ 9 - 9
packages/dev-server/package.json

@@ -1,6 +1,6 @@
 {
   "name": "dev-server",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "main": "index.js",
   "license": "MIT",
   "private": true,
@@ -14,18 +14,18 @@
     "load-test:100k": "node -r ts-node/register load-testing/run-load-test.ts 100000"
   },
   "dependencies": {
-    "@vendure/admin-ui-plugin": "^1.2.2",
-    "@vendure/asset-server-plugin": "^1.2.2",
-    "@vendure/common": "^1.2.2",
-    "@vendure/core": "^1.2.2",
-    "@vendure/elasticsearch-plugin": "^1.2.2",
-    "@vendure/email-plugin": "^1.2.2",
+    "@vendure/admin-ui-plugin": "^1.2.3",
+    "@vendure/asset-server-plugin": "^1.2.3",
+    "@vendure/common": "^1.2.3",
+    "@vendure/core": "^1.2.3",
+    "@vendure/elasticsearch-plugin": "^1.2.3",
+    "@vendure/email-plugin": "^1.2.3",
     "typescript": "4.3.5"
   },
   "devDependencies": {
     "@types/csv-stringify": "^3.1.0",
-    "@vendure/testing": "^1.2.2",
-    "@vendure/ui-devkit": "^1.2.2",
+    "@vendure/testing": "^1.2.3",
+    "@vendure/ui-devkit": "^1.2.3",
     "concurrently": "^5.0.0",
     "csv-stringify": "^5.3.3"
   }

+ 3 - 3
packages/elasticsearch-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/elasticsearch-plugin",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "license": "MIT",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
@@ -25,8 +25,8 @@
     "fast-deep-equal": "^3.1.3"
   },
   "devDependencies": {
-    "@vendure/common": "^1.2.2",
-    "@vendure/core": "^1.2.2",
+    "@vendure/common": "^1.2.3",
+    "@vendure/core": "^1.2.3",
     "rimraf": "^3.0.2",
     "typescript": "4.3.5"
   }

+ 3 - 3
packages/email-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/email-plugin",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "license": "MIT",
   "main": "lib/index.js",
   "types": "lib/index.d.ts",
@@ -35,8 +35,8 @@
     "@types/fs-extra": "^9.0.1",
     "@types/handlebars": "^4.1.0",
     "@types/mjml": "^4.0.4",
-    "@vendure/common": "^1.2.2",
-    "@vendure/core": "^1.2.2",
+    "@vendure/common": "^1.2.3",
+    "@vendure/core": "^1.2.3",
     "rimraf": "^3.0.2",
     "typescript": "4.3.5"
   }

+ 3 - 3
packages/job-queue-plugin/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/job-queue-plugin",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "license": "MIT",
   "main": "package/index.js",
   "types": "package/index.d.ts",
@@ -24,8 +24,8 @@
   "devDependencies": {
     "@google-cloud/pubsub": "^2.8.0",
     "@types/redis": "^2.8.28",
-    "@vendure/common": "^1.2.2",
-    "@vendure/core": "^1.2.2",
+    "@vendure/common": "^1.2.3",
+    "@vendure/core": "^1.2.3",
     "bullmq": "^1.40.1",
     "redis": "^3.0.2",
     "rimraf": "^3.0.2",

+ 3 - 3
packages/testing/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/testing",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "description": "End-to-end testing tools for Vendure projects",
   "keywords": [
     "vendure",
@@ -34,7 +34,7 @@
   },
   "dependencies": {
     "@types/node-fetch": "^2.5.4",
-    "@vendure/common": "^1.2.2",
+    "@vendure/common": "^1.2.3",
     "faker": "^4.1.0",
     "form-data": "^3.0.0",
     "graphql": "15.5.1",
@@ -45,7 +45,7 @@
   "devDependencies": {
     "@types/mysql": "^2.15.15",
     "@types/pg": "^7.14.5",
-    "@vendure/core": "^1.2.2",
+    "@vendure/core": "^1.2.3",
     "mysql": "^2.18.1",
     "pg": "^8.4.0",
     "rimraf": "^3.0.0",

+ 4 - 4
packages/ui-devkit/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@vendure/ui-devkit",
-  "version": "1.2.2",
+  "version": "1.2.3",
   "description": "A library for authoring Vendure Admin UI extensions",
   "keywords": [
     "vendure",
@@ -40,8 +40,8 @@
     "@angular/cli": "12.2.2",
     "@angular/compiler": "12.2.2",
     "@angular/compiler-cli": "12.2.2",
-    "@vendure/admin-ui": "^1.2.2",
-    "@vendure/common": "^1.2.2",
+    "@vendure/admin-ui": "^1.2.3",
+    "@vendure/common": "^1.2.3",
     "chalk": "^4.1.0",
     "chokidar": "^3.5.1",
     "fs-extra": "^10.0.0",
@@ -52,7 +52,7 @@
     "@rollup/plugin-node-resolve": "^11.2.0",
     "@types/fs-extra": "^9.0.8",
     "@types/glob": "^7.1.3",
-    "@vendure/core": "^1.2.2",
+    "@vendure/core": "^1.2.3",
     "rimraf": "^3.0.2",
     "rollup": "^2.40.0",
     "rollup-plugin-terser": "^7.0.2",

+ 82 - 0
scripts/check-core-type-defs.ts

@@ -0,0 +1,82 @@
+/* tslint:disable:no-console */
+import fs from 'fs';
+import path from 'path';
+
+/**
+ * For some unknown reason, a v1.2.2 of @vendure/core included incorrect type definitions for some types.
+ * Namely, _some_ of the `ConfigurableOperationDef` types had their specific string literal & enum types
+ * replaced with just `string`, which caused the published package to fail to build.
+ *
+ * Example:
+ * [dummy-payment-method-handler.d.ts](https://unpkg.com/@vendure/core@1.2.2/dist/config/payment/dummy-payment-method-handler.d.ts)
+ * ```
+ * export declare const dummyPaymentHandler: PaymentMethodHandler<{
+ *     automaticSettle: {
+ *         type: string;
+ *         label: {
+ *             languageCode: any;
+ *             value: string;
+ *         }[];
+ *         description: {
+ *             languageCode: any;
+ *             value: string;
+ *         }[];
+ *         required: true;
+ *         defaultValue: boolean;
+ *     };
+ * }>;
+ * ```
+ *
+ * Should be:
+ * ```ts
+ * export declare const dummyPaymentHandler: PaymentMethodHandler<{
+ *     automaticSettle: {
+ *         type: "boolean";
+ *         label: {
+ *             languageCode: LanguageCode.en;
+ *             value: string;
+ *         }[];
+ *         description: {
+ *             languageCode: LanguageCode.en;
+ *             value: string;
+ *         }[];
+ *         required: true;
+ *         defaultValue: false;
+ *     };
+ * }>;
+ * ```
+ *
+ * This script should be run before publishing, in order to verify that this is not the case.
+ */
+
+const configPath = path.join(__dirname, '../packages/core/dist/config');
+const filesToCheck = [
+    path.join(configPath, 'payment/dummy-payment-method-handler.d.ts'),
+    path.join(configPath, 'promotion/actions/product-percentage-discount-action.d.ts'),
+    path.join(configPath, 'promotion/conditions/contains-products-condition.d.ts'),
+    path.join(configPath, 'shipping-method/default-shipping-calculator.d.ts'),
+    path.join(configPath, 'shipping-method/default-shipping-eligibility-checker.d.ts'),
+    path.join(configPath, 'fulfillment/manual-fulfillment-handler.d.ts'),
+];
+
+console.log(`Checking core type definitions...`);
+let checkIsOk = true;
+
+for (const filePath of filesToCheck) {
+    const content = fs.readFileSync(filePath, 'utf-8');
+    const matches = content.match(/type: string;|languageCode: any;/gm);
+    if (matches) {
+        console.warn(`\n\nBad type definitions found in file ${filePath}:`);
+        console.warn(`==========`);
+        console.warn(matches.join('\n'));
+        console.warn(`==========`);
+        checkIsOk = false;
+    }
+}
+
+if (!checkIsOk) {
+    process.exit(1);
+} else {
+    console.log(`Type defs ok!`);
+    process.exit(0);
+}