diff --git a/.github/workflows/publish_and_install.yml b/.github/workflows/publish_and_install.yml index 9328c71ea2..f972543042 100644 --- a/.github/workflows/publish_and_install.yml +++ b/.github/workflows/publish_and_install.yml @@ -33,32 +33,38 @@ jobs: npm install -g verdaccio npm install -g wait-on tmp_registry_log=`mktemp` - nohup verdaccio &>$tmp_registry_log & + mkdir -p $HOME/.config/verdaccio + cp -v ./.github/workflows/verdaccio/config.yaml $HOME/.config/verdaccio/config.yaml + nohup verdaccio --config $HOME/.config/verdaccio/config.yaml & wait-on http://localhost:4873 TOKEN_RES=$(curl -XPUT \ -H "Content-type: application/json" \ -d '{ "name": "test", "password": "test" }' \ 'http://localhost:4873/-/user/org.couchdb.user:test') TOKEN=$(echo "$TOKEN_RES" | jq -r '.token') - npm set registry "http://0.0.0.0:4873" - npm set //0.0.0.0:4873/:_authToken $TOKEN + npm set //localhost:4873/:_authToken $TOKEN - name: Windows dependencies if: matrix.os == 'windows-latest' run: npm install -g @angular/cli - name: Yarn install run: | + npm i -g yarn yarn config set unsafe-perm true yarn install --network-timeout 1000000 --prefer-offline env: CI: true - name: Publish to Verdaccio run: | + nohup verdaccio --config $HOME/.config/verdaccio/config.yaml & + wait-on http://localhost:4873 yarn lerna publish prepatch --preid ci --no-push --no-git-tag-version --no-commit-hooks --force-publish "*" --yes --dist-tag ci --registry http://localhost:4873 - name: Install via @vendure/create run: | mkdir -p $HOME/install cd $HOME/install - npm set registry=http://0.0.0.0:4873 + nohup verdaccio --config $HOME/.config/verdaccio/config.yaml & + wait-on http://localhost:4873 + npm set registry=http://localhost:4873 npm dist-tag ls @vendure/create npx @vendure/create@ci test-app --ci --use-npm --log-level info - name: Server smoke tests diff --git a/.github/workflows/verdaccio/config.yaml b/.github/workflows/verdaccio/config.yaml index caeb2fa0c5..a86438ccad 100644 --- a/.github/workflows/verdaccio/config.yaml +++ b/.github/workflows/verdaccio/config.yaml @@ -10,7 +10,7 @@ plugins: ./plugins max_body_size: 1000mb web: # WebUI is enabled as default, if you want disable it, just uncomment this line - enable: false + enable: true title: Verdaccio auth: diff --git a/packages/core/src/common/finite-state-machine/validate-transition-definition.spec.ts b/packages/core/src/common/finite-state-machine/validate-transition-definition.spec.ts index 5772e662b5..87dfe755ee 100644 --- a/packages/core/src/common/finite-state-machine/validate-transition-definition.spec.ts +++ b/packages/core/src/common/finite-state-machine/validate-transition-definition.spec.ts @@ -74,7 +74,7 @@ describe('FSM validateTransitionDefinition()', () => { const result = validateTransitionDefinition(valid, 'Start'); - expect(result.valid).toBe(false); + expect(result.valid).toBe(true); expect(result.error).toBe('The following states are unreachable: Unreachable'); }); diff --git a/packages/core/src/common/finite-state-machine/validate-transition-definition.ts b/packages/core/src/common/finite-state-machine/validate-transition-definition.ts index f37ed7b55d..aa5c49e6a2 100644 --- a/packages/core/src/common/finite-state-machine/validate-transition-definition.ts +++ b/packages/core/src/common/finite-state-machine/validate-transition-definition.ts @@ -53,17 +53,15 @@ export function validateTransitionDefinition( }; } - if (!allStatesReached()) { - return { - valid: false, - error: `The following states are unreachable: ${Object.entries(result) - .filter(([s, v]) => !(v as ValidationResult).reachable) - .map(([s]) => s) - .join(', ')}`, - }; - } else { - return { - valid: true, - }; - } + const error = !allStatesReached() + ? `The following states are unreachable: ${Object.entries(result) + .filter(([s, v]) => !(v as ValidationResult).reachable) + .map(([s]) => s) + .join(', ')}` + : undefined; + + return { + valid: true, + error, + }; } diff --git a/packages/core/src/event-bus/vendure-entity-event.ts b/packages/core/src/event-bus/vendure-entity-event.ts index b2fa60dd20..71ecdce4ae 100644 --- a/packages/core/src/event-bus/vendure-entity-event.ts +++ b/packages/core/src/event-bus/vendure-entity-event.ts @@ -5,7 +5,6 @@ import { VendureEvent } from './vendure-event'; /** * @description * The base class for all entity events used by the EventBus system. - * * For event type `'updated'` the entity is the one before applying the patch (if not documented otherwise). * * For event type `'deleted'` the input will most likely be an `id: ID` * * @docsCategory events diff --git a/packages/core/src/service/helpers/fulfillment-state-machine/fulfillment-state-machine.ts b/packages/core/src/service/helpers/fulfillment-state-machine/fulfillment-state-machine.ts index 99bf3f753f..03bfc149c7 100644 --- a/packages/core/src/service/helpers/fulfillment-state-machine/fulfillment-state-machine.ts +++ b/packages/core/src/service/helpers/fulfillment-state-machine/fulfillment-state-machine.ts @@ -63,6 +63,9 @@ export class FulfillmentStateMachine { Logger.error(`The fulfillment process has an invalid configuration:`); throw new Error(validationResult.error); } + if (validationResult.valid && validationResult.error) { + Logger.warn(`Fulfillment process: ${validationResult.error}`); + } return { transitions: allTransitions, onTransitionStart: async (fromState, toState, data) => { diff --git a/packages/core/src/service/helpers/order-state-machine/order-state-machine.ts b/packages/core/src/service/helpers/order-state-machine/order-state-machine.ts index 6c1a985c4d..23e27acf42 100644 --- a/packages/core/src/service/helpers/order-state-machine/order-state-machine.ts +++ b/packages/core/src/service/helpers/order-state-machine/order-state-machine.ts @@ -56,6 +56,9 @@ export class OrderStateMachine { Logger.error(`The order process has an invalid configuration:`); throw new Error(validationResult.error); } + if (validationResult.valid && validationResult.error) { + Logger.warn(`Order process: ${validationResult.error}`); + } return { transitions: allTransitions, onTransitionStart: async (fromState, toState, data) => { diff --git a/packages/core/src/service/helpers/payment-state-machine/payment-state-machine.ts b/packages/core/src/service/helpers/payment-state-machine/payment-state-machine.ts index d96e74d030..3a59dc1746 100644 --- a/packages/core/src/service/helpers/payment-state-machine/payment-state-machine.ts +++ b/packages/core/src/service/helpers/payment-state-machine/payment-state-machine.ts @@ -58,6 +58,9 @@ export class PaymentStateMachine { Logger.error(`The payment process has an invalid configuration:`); throw new Error(validationResult.error); } + if (validationResult.valid && validationResult.error) { + Logger.warn(`Payment process: ${validationResult.error}`); + } return { transitions: allTransitions, onTransitionStart: async (fromState, toState, data) => {