Skip to content

Commit

Permalink
Merge branch 'vendure-ecommerce:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefanyshyn committed Nov 20, 2023
2 parents 101704b + cf301eb commit 813fc71
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 20 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/publish_and_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/verdaccio/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,15 @@ export function validateTransitionDefinition<T extends string>(
};
}

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,
};
}
1 change: 0 additions & 1 deletion packages/core/src/event-bus/vendure-entity-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 813fc71

Please sign in to comment.