Skip to content

Commit

Permalink
config: Automatically detect all the packages that need to be publish…
Browse files Browse the repository at this point in the history
…ed based on their dependency
  • Loading branch information
ealush committed Nov 10, 2021
1 parent 40ef071 commit e09503d
Show file tree
Hide file tree
Showing 37 changed files with 1,746 additions and 190 deletions.
2 changes: 1 addition & 1 deletion packages/anyone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"license": "MIT",
"main": "./dist/cjs/anyone.js",
"types": "./types/anyone.d.ts",
"version": "0.1.0",
"version": "0.1.1-dev-234135",
"author": "ealush",
"scripts": {
"test": "vx test",
Expand Down
2 changes: 1 addition & 1 deletion packages/context/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.4",
"version": "1.2.0-dev-234135",
"license": "MIT",
"main": "./dist/cjs/context.js",
"types": "./types/context.d.ts",
Expand Down
36 changes: 36 additions & 0 deletions packages/n4s/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,42 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 3.1.0 - 2021-08-06

### Added

- bf432a1 added(n4s): add custom message support to lazy enforcements (undefined)
- c093a7f added(n4s): partial rule modifier (undefined)
- 045bc72 feat(n4s): context propagation within enforce (undefined)
- 443df9d feat(n4s): optional (undefined)
- 86172ca feat(n4s): isArrayOf (undefined)
- f48f38b feat(n4s): add shape and loose validations (undefined)

### Fixed and improved

- fdcf20b genscript (undefined)
- b12614f chore: cleanup residue (undefined)
- 4da20b4 chore: remove duplicate types (undefined)
- c66298d tests(n4s): add paritla tests (undefined)
- packages/anyone/package.json
- a8c1e67 patch: add nodejs exports (undefined)
- 83efb86 patch: remove unused exports (undefined)
- 9546b9e patch(n4s): improve types for rule chaining (undefined)
- packages/anyone/package.json
- 7bab926 patch: simplify proxy test/run assignment (undefined)
- ed5c903 patch: enable enforce in es5 environments (undefined)
- 3494de6 chore: reduce complexity, remove all lint errors (undefined)
- packages/anyone/.npmignore
- .github/PULL_REQUEST_TEMPLATE.md
- aec6cd6 chore: cleanup unused code (ealush)
- 0103b38 lint: handling lint of all packages (ealush)
- .gitignore
- 03cf487 patch(n4s): add ruleReturn default values (ealush)
- 76e8c98 fix(n4s): make enforce compound runners fall back to correct response (ealush)
- ff91bd2 fix(n4s): make enforce chaining work (ealush)
- c3fd912 chore: some lint fixes (ealush)
- 49b6b84 Vest 4 Infra Setup (ealush)

## 1.1.14 - 2021-07-02

### Fixed and improved
Expand Down
2 changes: 1 addition & 1 deletion packages/n4s/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.0.0",
"version": "3.1.0-dev-234135",
"license": "MIT",
"main": "./dist/cjs/n4s.js",
"types": "./types/n4s.d.ts",
Expand Down
11 changes: 4 additions & 7 deletions packages/n4s/src/runtime/__tests__/message.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ describe('enforce..message()', () => {

it('Should set the failure message in custom rules', () => {
expect(
enforce.ruleWithFailureMessage().message('oof. Failed again!').run()
enforce.ruleWithFailureMessage().message('oof. Failed again!').run(true)
).toEqual(ruleReturn(false, 'oof. Failed again!'));

expect(
enforce
.ruleWithFailureMessage()
.message(() => 'oof. Failed again!')
.run()
.run(true)
).toEqual(ruleReturn(false, 'oof. Failed again!'));
});

Expand All @@ -38,14 +38,11 @@ describe('enforce..message()', () => {
expect(msg).toHaveBeenCalledWith(arg, undefined);
});

it('Should pass original messageas the second argument if exists', () => {
it('Should pass original messages the second argument if exists', () => {
const msg = jest.fn(() => 'some message');
const arg = {};
expect(
enforce
.ruleWithFailureMessage(false)
.message(msg)
.run(arg, 'original message')
enforce.ruleWithFailureMessage(false).message(msg).run(arg)
).toEqual(ruleReturn(false, 'some message'));
expect(msg).toHaveBeenCalledWith(arg, 'This should not be seen!');
});
Expand Down
4 changes: 2 additions & 2 deletions packages/n4s/src/runtime/genEnforceLazy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function genEnforceLazy(key: string) {
return addLazyRule(key);

function addLazyRule(ruleName: string) {
return (...args: TArgs) => {
return (...args: TArgs): TLazy => {
const rule = getRule(ruleName);

registeredRules.push((value: TRuleValue) =>
Expand Down Expand Up @@ -79,7 +79,7 @@ export type TLazyRules = TRules<TLazyRuleMethods>;

export type TLazy = TLazyRules & TLazyRuleMethods;

export type TShapeObject = Record<string, TLazy>;
export type TShapeObject = Record<any, TLazy>;

type TLazyRuleMethods = {
test: (value: unknown) => boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/vast/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.2",
"version": "1.0.3-dev-234135",
"license": "MIT",
"main": "./dist/cjs/vast.js",
"types": "./types/vast.d.ts",
Expand Down
13 changes: 0 additions & 13 deletions packages/vest/config/jest/globals.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/vest/config/jest/jest.setup.ts

This file was deleted.

16 changes: 0 additions & 16 deletions packages/vest/config/jest/jest.setupAfterEnv.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/vest/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.2.7",
"version": "3.3.0-dev-234135",
"license": "MIT",
"name": "vest",
"author": "ealush",
Expand Down
17 changes: 9 additions & 8 deletions packages/vest/src/core/suite/__tests__/hasRemainingTests.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import faker from 'faker';
import _ from 'lodash';

import itWithContext from '../../../../testUtils/itWithContext';
import runCreateRef from '../../../../testUtils/runCreateRef';

import VestTest from 'VestTest';
Expand Down Expand Up @@ -37,7 +38,7 @@ describe('hasRemainingTests', () => {

describe('When no field specified', () => {
describe('When no remaining tests', () => {
it.withContext(
itWithContext(
'should return false',
() => {
expect(hasRemainingTests()).toBe(false);
Expand All @@ -47,7 +48,7 @@ describe('hasRemainingTests', () => {
});

describe('When there are remaining tests', () => {
it.withContext(
itWithContext(
'pending tests return true',
() => {
addPendingOrLagging('pending');
Expand All @@ -57,7 +58,7 @@ describe('hasRemainingTests', () => {
getCtx
);

it.withContext(
itWithContext(
'lagging tests return true',
() => {
addPendingOrLagging('lagging');
Expand All @@ -67,7 +68,7 @@ describe('hasRemainingTests', () => {
getCtx
);

it.withContext(
itWithContext(
'lagging and pending tests return true',
() => {
addPendingOrLagging('lagging');
Expand All @@ -87,7 +88,7 @@ describe('hasRemainingTests', () => {
fieldName = faker.lorem.word();
});
describe('When no remaining tests', () => {
it.withContext(
itWithContext(
'Should return false',
() => {
expect(hasRemainingTests(fieldName)).toBe(false);
Expand All @@ -97,7 +98,7 @@ describe('hasRemainingTests', () => {
});

describe('When remaining tests', () => {
it.withContext(
itWithContext(
'pending tests return true',
() => {
addPendingOrLagging('pending', fieldName);
Expand All @@ -106,7 +107,7 @@ describe('hasRemainingTests', () => {
getCtx
);

it.withContext(
itWithContext(
'lagging tests return true',
() => {
addPendingOrLagging('lagging', fieldName);
Expand All @@ -115,7 +116,7 @@ describe('hasRemainingTests', () => {
getCtx
);

it.withContext(
itWithContext(
'lagging and pending tests return true',
() => {
addPendingOrLagging('lagging', fieldName);
Expand Down
3 changes: 2 additions & 1 deletion packages/vest/src/core/test/__tests__/runAsyncTest.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import _ from 'lodash';

import expandStateRef from '../../../../testUtils/expandStateRef';
import itWithContext from '../../../../testUtils/itWithContext';
import runCreateRef from '../../../../testUtils/runCreateRef';

import VestTest from 'VestTest';
Expand Down Expand Up @@ -53,7 +54,7 @@ describe.each([CASE_PASSING, CASE_FAILING])('runAsyncTest: %s', testCase => {
});

describe('State updates', () => {
it.withContext(
itWithContext(
'Initial state matches snapshot (sanity)',
() => {
const [pending] = usePending();
Expand Down
6 changes: 4 additions & 2 deletions packages/vest/src/core/test/lib/__tests__/VestTest.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as vest from 'vest';
import wait from 'wait';

import itWithContext from '../../../../../testUtils/itWithContext';

import VestTest from 'VestTest';
import { setPending } from 'pending';
import { usePending, useLagging } from 'stateHooks';
Expand Down Expand Up @@ -92,7 +94,7 @@ describe('VestTest', () => {
});
});

it.withContext('Should remove a testObject from the pending state', () => {
itWithContext('Should remove a testObject from the pending state', () => {
setPending(testObject);
{
const [pending] = usePending();
Expand All @@ -105,7 +107,7 @@ describe('VestTest', () => {
}
});

it.withContext('Should remove a testObject from the lagging state', () => {
itWithContext('Should remove a testObject from the lagging state', () => {
const [, setLagging] = useLagging();
setLagging(() => [testObject]);
{
Expand Down
13 changes: 7 additions & 6 deletions packages/vest/src/core/test/lib/__tests__/pending.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import _ from 'lodash';

import expandStateRef from '../../../../../testUtils/expandStateRef';
import itWithContext from '../../../../../testUtils/itWithContext';
import runCreateRef from '../../../../../testUtils/runCreateRef';

import VestTest from 'VestTest';
Expand Down Expand Up @@ -49,7 +50,7 @@ describe('module: pending', () => {
});
});

it.withContext(
itWithContext(
'Should remove test from pending',
() => {
{
Expand All @@ -75,7 +76,7 @@ describe('module: pending', () => {
});
});

it.withContext(
itWithContext(
'Should remove test from lagging',
() => {
{
Expand Down Expand Up @@ -109,7 +110,7 @@ describe('module: pending', () => {
testObjects[0].groupName = groupName;
});

it.withContext(
itWithContext(
'Should set supplied test object as pending',
() => {
{
Expand Down Expand Up @@ -139,7 +140,7 @@ describe('module: pending', () => {
});
});

it.withContext(
itWithContext(
'Should remove test from lagging array',
() => {
{
Expand All @@ -162,7 +163,7 @@ describe('module: pending', () => {
getStateRef
);

it.withContext(
itWithContext(
'Should add test to pending array',
() => {
{
Expand All @@ -178,7 +179,7 @@ describe('module: pending', () => {
getStateRef
);

it.withContext(
itWithContext(
'Should set test as canceled',
() => {
expect(testObjects[0].canceled).toBe(false);
Expand Down
Loading

0 comments on commit e09503d

Please sign in to comment.