Skip to content

Commit

Permalink
misc: sync features and bugfixes from f39b7a45 (#1747)
Browse files Browse the repository at this point in the history
* misc: sync features and bugfixes from ba8d789

* misc: add i18n-dayjs and react-hooks packages

* version to 0.15.0

* chore: update crius

* misc: sync from f39b7a45

* chore: fix tests

* chore: fix tests

* chore: run test with --updateSnapshot
  • Loading branch information
embbnux authored Jul 18, 2024
1 parent cb02f81 commit 9b193ad
Show file tree
Hide file tree
Showing 2,770 changed files with 38,587 additions and 20,830 deletions.
56 changes: 44 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [20.x]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -18,6 +18,14 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- run: yarn workspace @ringcentral-integration/babel-settings test --coverage
- name: Babel Settings Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/babel-settings/coverage/lcov.info
flag-name: babel-settings
parallel: true
- run: yarn workspace @ringcentral-integration/phone-number test --coverage
- name: Phone Number Coveralls
uses: coverallsapp/[email protected]
Expand Down Expand Up @@ -58,6 +66,14 @@ jobs:
path-to-lcov: ./packages/core/coverage/lcov.info
flag-name: core
parallel: true
- run: yarn workspace @ringcentral-integration/react-hooks test --coverage
- name: Core Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/react-hooks/coverage/lcov.info
flag-name: react-hooks
parallel: true
- run: yarn workspace @ringcentral-integration/commons test --coverage
- name: Commons Coveralls
uses: coverallsapp/[email protected]
Expand All @@ -66,15 +82,15 @@ jobs:
path-to-lcov: ./packages/ringcentral-integration/coverage/lcov.info
flag-name: commons
parallel: true
# - run: yarn workspace @ringcentral-integration/widgets test --coverage
# - name: Widgets Coveralls
# uses: coverallsapp/[email protected]
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: ./packages/ringcentral-widgets/coverage/lcov.info
# flag-name: widgets
# parallel: true
- run: yarn workspace ringcentral-widgets-test test --ci --coverage
- run: yarn workspace @ringcentral-integration/widgets test --coverage
- name: Widgets Coveralls
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./packages/ringcentral-widgets/coverage/lcov.info
flag-name: widgets
parallel: true
- run: yarn workspace ringcentral-widgets-test test --ci --coverage --updateSnapshot
env:
NODE_OPTIONS: --max-old-space-size=4096
- name: Widgets Integration Coveralls
Expand All @@ -100,10 +116,10 @@ jobs:
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Use Node.js 14.x
- name: Use Node.js 20.x
uses: actions/setup-node@v1
with:
node-version: 14.x
node-version: 20.x
- run: yarn
- run: yarn workspace @ringcentral-integration/utils release
- name: Utils Branch Release
Expand All @@ -129,6 +145,22 @@ jobs:
BRANCH: i18n-release
FOLDER: release/i18n
CLEAN: true
- run: yarn workspace @ringcentral-integration/i18n-dayjs release
- name: I18n Dayjs Branch Release
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: i18n-dayjs-release
FOLDER: release/i18n-dayjs
CLEAN: true
- run: yarn workspace @ringcentral-integration/react-hooks release
- name: React Hooks Branch Release
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: react-hooks-release
FOLDER: release/react-hooks
CLEAN: true
- run: yarn workspace @ringcentral-integration/locale-loader release
- name: Locale Loader Branch Release
uses: JamesIves/[email protected]
Expand Down
56 changes: 51 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Get the version
id: get_version
Expand All @@ -29,6 +29,52 @@ jobs:
working-directory: release/utils
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
i18n-dayjs-npm-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Get the version
id: get_version
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- run: yarn
- run: yarn workspace @ringcentral-integration/i18n-dayjs release
env:
TRAVIS_TAG: ${{ steps.get_version.outputs.SOURCE_TAG }}
- run: npm publish
working-directory: release/i18n-dayjs
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
react-hooks-npm-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Get the version
id: get_version
run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/}
- run: yarn
- run: yarn workspace @ringcentral-integration/react-hooks release
env:
TRAVIS_TAG: ${{ steps.get_version.outputs.SOURCE_TAG }}
- run: npm publish
working-directory: release/react-hooks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
core-npm-release:
runs-on: ubuntu-latest
steps:
Expand All @@ -39,7 +85,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Get the version
id: get_version
Expand All @@ -62,7 +108,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Get the version
id: get_version
Expand All @@ -85,7 +131,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Get the version
id: get_version
Expand All @@ -108,7 +154,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Get the version
id: get_version
Expand Down
2 changes: 1 addition & 1 deletion .sync
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dd3f20d7a363f451ee63d4fabd04e4b97dbea059
f39b7a45cca0781ea4231df645cd9c97e6c641fa
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
// Enable ESLint (with Prettier plugin) to format code on save
"eslint.autoFixOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
7 changes: 6 additions & 1 deletion crius/packages/babel-preset-crius/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Babel preset for all Crius plugins.",
"main": "lib/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\""
},
"author": "unadlib",
"license": "MIT",
Expand All @@ -20,5 +20,10 @@
},
"peerDependencies": {
"@babel/core": "^7.5.5"
},
"nx": {
"tags": [
"scope:coverage-ignore"
]
}
}
4 changes: 2 additions & 2 deletions crius/packages/babel-preset-crius/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { declare } from '@babel/helper-plugin-utils';
import transformReactJSX from '@babel/plugin-transform-react-jsx';
import transformReactDisplayName from '@babel/plugin-transform-react-display-name';
import transformReactJSXSource from '@babel/plugin-transform-react-jsx-source';
import transformReactJSX from '@babel/plugin-transform-react-jsx';
import transformReactJSXSelf from '@babel/plugin-transform-react-jsx-self';
import transformReactJSXSource from '@babel/plugin-transform-react-jsx-source';

export default declare((api, opts) => {
api.assertVersion(7);
Expand Down
1 change: 1 addition & 0 deletions crius/packages/babel-preset-crius/test/index.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { transform } from '@babel/core';

import crius from '../lib';

describe('crius preset', () => {
Expand Down
5 changes: 1 addition & 4 deletions crius/packages/crius-is/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
"name": "crius-is",
"version": "1.2.0",
"description": "A tool for checking Crius element types",
"main": "dist/index.js",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\""
},
"dependencies": {
"crius": "^1.2.0"
Expand Down
7 changes: 6 additions & 1 deletion crius/packages/crius-logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"module": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\""
},
"author": "unadlib",
"license": "MIT",
Expand All @@ -15,5 +15,10 @@
},
"peerDependencies": {
"crius-test": "^1.0.0-alpha.1"
},
"nx": {
"tags": [
"scope:coverage-ignore"
]
}
}
3 changes: 2 additions & 1 deletion crius/packages/crius-logger/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Plugins, StepType, Step } from 'crius-test';
import * as fs from 'fs';
import * as path from 'path';
import { Plugins, StepType, Step } from 'crius-test';

interface Log {
key: string;
desc: string | undefined | null;
Expand Down
5 changes: 3 additions & 2 deletions crius/packages/crius-logger/test/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
Then,
plugins,
} from 'crius-test';

import logger from '../';

@plugins([logger({ path: 'packages/crius-logger' })])
Expand Down Expand Up @@ -175,10 +176,10 @@ class Test extends Step<{}, { __logger: object[] }> {
]);
}

@(examples`
@examples`
| accountTag | contactType | smsMessage |
| 'us' | 'personal' | 'aaa' |
`)
`
run() {
return (
<Scenario desc="user enter entrypoint" action={EntryPoint}>
Expand Down
10 changes: 6 additions & 4 deletions crius/packages/crius-runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
"name": "crius-runner",
"version": "1.2.0",
"description": "A Crius runner with Crius steps",
"main": "dist/index.js",
"module": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\""
},
"author": "unadlib",
"license": "MIT",
Expand All @@ -16,5 +13,10 @@
},
"peerDependencies": {
"crius": "^1.0.0-alpha.1"
},
"nx": {
"tags": [
"scope:coverage-ignore"
]
}
}
2 changes: 1 addition & 1 deletion crius/packages/crius-runner/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { run } from './runner';
import { Context, Hooks } from './interface';
import { run } from './runner';

const CriusRunner = {
run,
Expand Down
3 changes: 2 additions & 1 deletion crius/packages/crius-runner/src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import {
isCriusStepClass,
isCriusStepFunction,
} from 'crius-is';
import { runWithLifecycle } from './lifecycle';

import { handleContext } from './context';
import { runWithLifecycle } from './lifecycle';

async function iterateChildren<C>(
children: Children,
Expand Down
1 change: 1 addition & 0 deletions crius/packages/crius-runner/test/context.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { CriusElement, Step } from 'crius';

import { run } from '../src';
import { handleContext } from '../src/context';

Expand Down
1 change: 1 addition & 0 deletions crius/packages/crius-runner/test/context.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Step, StepFunction } from 'crius';

import criusRunner from '../src';

test('runner deep step with JSX', async () => {
Expand Down
1 change: 1 addition & 0 deletions crius/packages/crius-runner/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Crius, { Step } from 'crius';

import { run } from '../src';

test('test run for step', async () => {
Expand Down
9 changes: 4 additions & 5 deletions crius/packages/crius-runner/test/index.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Crius, { StepFunction } from 'crius';

import { run } from '../src';

test('runner with JSX', async () => {
Expand Down Expand Up @@ -172,11 +173,9 @@ test('runner deep step with function child', async () => {
await new Promise((resolve) => setTimeout(resolve, 100));
return <FooBar0 value="test" />;
}}
{
await (async () => {
return <FooBar0 />;
})()
}
{await (async () => {
return <FooBar0 />;
})()}
<FooBar fooBar="fooBar1" />
</Foo>
);
Expand Down
1 change: 1 addition & 0 deletions crius/packages/crius-runner/test/lifecycle.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Crius from 'crius';

import { run } from '../src';

test('runner lifecycle with JSX', async () => {
Expand Down
Loading

0 comments on commit 9b193ad

Please sign in to comment.