Skip to content

Commit

Permalink
Merge branch 'release/0.4.0' into released
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Works committed Jul 12, 2019
2 parents 29bf130 + d936851 commit 13e6357
Show file tree
Hide file tree
Showing 171 changed files with 3,119 additions and 1,563 deletions.
10 changes: 6 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ jobs:
- .rpt2_cache
key: build-cache
- run: sudo apt-get install zip
- run: zip -r commonjs.zip dist/
- run: zip -r esmodule.zip es/
- store_artifacts:
path: commonjs.zip
path: umd/index.js
destination: /index.js
- store_artifacts:
path: esmodule.zip
path: umd/index.js.map
destination: /index.js.map
- store_artifacts:
path: dist/out.js
path: esmodule.zip
destination: /esmodule.zip
15 changes: 5 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
/es
/dist
# temp file
/temp
.rpt2_cache
tsdoc-metadata.json

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/es
/umd
tsdoc-metadata.json

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
Expand Down
33 changes: 13 additions & 20 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
.DS_Store
*.log*
*.tsbuildinfo
/temp
.rpt2_cache
tsdoc-metadata.json
# dependencies
/node_modules
/.pnp
.pnp.js
# config
/.vscode
/.circleci

# testing
/coverage
# use less build output
/umd/**/*.ts
/umd/**/*.ts.map

# production
/build
# can be regenerated
/api-documents

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
# temp file
/temp
*.tsbuildinfo
/.rpt2_cache

# misc
npm-debug.log*
yarn-debug.log*
yarn-error.log*
5 changes: 2 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"typescript.tsdk": "node_modules\\typescript\\lib",
"search.exclude": {
"**/api-document": true
"**/api-documents": true
}
}
}
15 changes: 7 additions & 8 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
// 有关 tasks.json 格式的文档,请参见
// 有关 tasks.json 格式的文档,请参见
// https://go.microsoft.com/fwlink/?LinkId=733558
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start-tsc",
"problemMatcher": [
"$tsc-watch"
],
"isBackground": true
"type": "typescript",
"tsconfig": "tsconfig.json",
"option": "watch",
"problemMatcher": ["$tsc-watch"],
"label": "holoflows"
}
]
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @holoflows/kit · ![GitHub license](https://img.shields.io/badge/license-AGPL-blue.svg?style=flat-square) [![npm version](https://img.shields.io/npm/v/@holoflows/kit.svg?style=flat-square)](https://www.npmjs.com/package/@holoflows/kit) ![Ciecle CI](https://img.shields.io/circleci/project/github/DimensionDev/Holoflows-Kit.svg?style=flat-square&logo=circleci)
# @holoflows/kit · ![GitHub license](https://img.shields.io/badge/license-AGPL-blue.svg?style=flat-square) [![npm version](https://img.shields.io/npm/v/@holoflows/kit.svg?style=flat-square)](https://www.npmjs.com/package/@holoflows/kit) ![Ciecle CI](https://img.shields.io/circleci/project/github/DimensionDev/holoflows-kit.svg?style=flat-square&logo=circleci)

Toolkit for modern web browser extension developing.

Expand Down
4 changes: 2 additions & 2 deletions api-documents/kit.asynccall.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Async call between different context.
<b>Signature:</b>

```typescript
export declare function AsyncCall<OtherSideImplementedFunctions = {}>(implementation: Default, options?: Partial<AsyncCallOptions>): OtherSideImplementedFunctions;
export declare function AsyncCall<OtherSideImplementedFunctions = {}>(implementation?: Record<string, (...args: any[]) => any>, options?: Partial<AsyncCallOptions>): OtherSideImplementedFunctions;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| implementation | <code>Default</code> | Implementation of this side. |
| implementation | <code>Record&lt;string, (...args: any[]) =&gt; any&gt;</code> | Implementation of this side. |
| options | <code>Partial&lt;AsyncCallOptions&gt;</code> | Define your own serializer, MessageCenter or other options. |

<b>Returns:</b>
Expand Down
11 changes: 0 additions & 11 deletions api-documents/kit.asynccalloptions.dontthrowonnotimplemented.md

This file was deleted.

2 changes: 2 additions & 0 deletions api-documents/kit.asynccalloptions.key.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## AsyncCallOptions.key property

A key to prevent collision with other AsyncCalls. Can be anything, but need to be the same on the both side.

<b>Signature:</b>

```typescript
Expand Down
18 changes: 18 additions & 0 deletions api-documents/kit.asynccalloptions.log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holoflows/kit](./kit.md) &gt; [AsyncCallOptions](./kit.asynccalloptions.md) &gt; [log](./kit.asynccalloptions.log.md)

## AsyncCallOptions.log property

Log what to console

<b>Signature:</b>

```typescript
log: {
beCalled?: boolean;
localError?: boolean;
remoteError?: boolean;
type?: 'basic' | 'pretty';
} | boolean;
```
11 changes: 6 additions & 5 deletions api-documents/kit.asynccalloptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ export interface AsyncCallOptions

| Property | Type | Description |
| --- | --- | --- |
| [dontThrowOnNotImplemented](./kit.asynccalloptions.dontthrowonnotimplemented.md) | <code>boolean</code> | |
| [key](./kit.asynccalloptions.key.md) | <code>string</code> | |
| [MessageCenter](./kit.asynccalloptions.messagecenter.md) | <code>{</code><br/><code> new (): {</code><br/><code> on(event: string, cb: (data: any) =&gt; void): void;</code><br/><code> send(event: string, data: any): void;</code><br/><code> };</code><br/><code> }</code> | |
| [serializer](./kit.asynccalloptions.serializer.md) | <code>Serialization</code> | |
| [writeToConsole](./kit.asynccalloptions.writetoconsole.md) | <code>boolean</code> | |
| [key](./kit.asynccalloptions.key.md) | <code>string</code> | A key to prevent collision with other AsyncCalls. Can be anything, but need to be the same on the both side. |
| [log](./kit.asynccalloptions.log.md) | <code>{</code><br/><code> beCalled?: boolean;</code><br/><code> localError?: boolean;</code><br/><code> remoteError?: boolean;</code><br/><code> type?: 'basic' &#124; 'pretty';</code><br/><code> } &#124; boolean</code> | Log what to console |
| [messageChannel](./kit.asynccalloptions.messagechannel.md) | <code>{</code><br/><code> on(event: string, callback: (data: unknown) =&gt; void): void;</code><br/><code> emit(event: string, data: unknown): void;</code><br/><code> }</code> | A class that can let you transfer messages between two sides |
| [parameterStructures](./kit.asynccalloptions.parameterstructures.md) | <code>'by-position' &#124; 'by-name'</code> | How parameters passed to remote https://www.jsonrpc.org/specification\#parameter\_structures |
| [serializer](./kit.asynccalloptions.serializer.md) | <code>Serialization</code> | How to serialization and deserialization parameters and return values |
| [strict](./kit.asynccalloptions.strict.md) | <code>{</code><br/><code> methodNotFound?: boolean;</code><br/><code> noUndefined?: boolean;</code><br/><code> unknownMessage?: boolean;</code><br/><code> } &#124; boolean</code> | Strict options |

16 changes: 0 additions & 16 deletions api-documents/kit.asynccalloptions.messagecenter.md

This file was deleted.

16 changes: 16 additions & 0 deletions api-documents/kit.asynccalloptions.messagechannel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holoflows/kit](./kit.md) &gt; [AsyncCallOptions](./kit.asynccalloptions.md) &gt; [messageChannel](./kit.asynccalloptions.messagechannel.md)

## AsyncCallOptions.messageChannel property

A class that can let you transfer messages between two sides

<b>Signature:</b>

```typescript
messageChannel: {
on(event: string, callback: (data: unknown) => void): void;
emit(event: string, data: unknown): void;
};
```
13 changes: 13 additions & 0 deletions api-documents/kit.asynccalloptions.parameterstructures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holoflows/kit](./kit.md) &gt; [AsyncCallOptions](./kit.asynccalloptions.md) &gt; [parameterStructures](./kit.asynccalloptions.parameterstructures.md)

## AsyncCallOptions.parameterStructures property

How parameters passed to remote https://www.jsonrpc.org/specification\#parameter\_structures

<b>Signature:</b>

```typescript
parameterStructures: 'by-position' | 'by-name';
```
7 changes: 7 additions & 0 deletions api-documents/kit.asynccalloptions.serializer.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@

## AsyncCallOptions.serializer property

How to serialization and deserialization parameters and return values

<b>Signature:</b>

```typescript
serializer: Serialization;
```

## Remarks

We offer some built-in serializer: - NoSerialization (Do not do any serialization) - JSONSerialization (Use JSON.parse/stringify)

17 changes: 17 additions & 0 deletions api-documents/kit.asynccalloptions.strict.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holoflows/kit](./kit.md) &gt; [AsyncCallOptions](./kit.asynccalloptions.md) &gt; [strict](./kit.asynccalloptions.strict.md)

## AsyncCallOptions.strict property

Strict options

<b>Signature:</b>

```typescript
strict: {
methodNotFound?: boolean;
noUndefined?: boolean;
unknownMessage?: boolean;
} | boolean;
```
11 changes: 0 additions & 11 deletions api-documents/kit.asynccalloptions.writetoconsole.md

This file was deleted.

2 changes: 1 addition & 1 deletion api-documents/kit.automatedtabtask.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Open a new page in the background, execute some task, then close it automaticall
<b>Signature:</b>

```typescript
export declare function AutomatedTabTask<T extends Record<string, (...args: any[]) => Promise<any>>>(taskImplements: T, options?: Partial<AutomatedTabTaskDefineTimeOptions>): ((url: string, options?: Partial<AutomatedTabTaskRuntimeOptions>) => T) | null;
export declare function AutomatedTabTask<T extends Record<string, (...args: any[]) => PromiseLike<any>>>(taskImplements: T, options?: Partial<AutomatedTabTaskDefineTimeOptions>): ((url: string, options?: Partial<AutomatedTabTaskRuntimeOptions>) => T) | null;
```

## Parameters
Expand Down
2 changes: 2 additions & 0 deletions api-documents/kit.automatedtabtaskruntimeoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ export interface AutomatedTabTaskRuntimeOptions extends AutomatedTabTaskSharedOp
| Property | Type | Description |
| --- | --- | --- |
| [important](./kit.automatedtabtaskruntimeoptions.important.md) | <code>boolean</code> | This task is important, need to start now without queue. |
| [needRedirect](./kit.automatedtabtaskruntimeoptions.needredirect.md) | <code>boolean</code> | Use with runAtTabID, tell AutomatedTabTask if you need to redirect the tab to the url provided<!-- -->defaults: false |
| [runAtTabID](./kit.automatedtabtaskruntimeoptions.runattabid.md) | <code>number</code> | Instead of start a new tab, run the script at the existing tab. |
15 changes: 15 additions & 0 deletions api-documents/kit.automatedtabtaskruntimeoptions.needredirect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holoflows/kit](./kit.md) &gt; [AutomatedTabTaskRuntimeOptions](./kit.automatedtabtaskruntimeoptions.md) &gt; [needRedirect](./kit.automatedtabtaskruntimeoptions.needredirect.md)

## AutomatedTabTaskRuntimeOptions.needRedirect property

Use with runAtTabID, tell AutomatedTabTask if you need to redirect the tab to the url provided

defaults: false

<b>Signature:</b>

```typescript
needRedirect: boolean;
```
13 changes: 13 additions & 0 deletions api-documents/kit.automatedtabtaskruntimeoptions.runattabid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holoflows/kit](./kit.md) &gt; [AutomatedTabTaskRuntimeOptions](./kit.automatedtabtaskruntimeoptions.md) &gt; [runAtTabID](./kit.automatedtabtaskruntimeoptions.runattabid.md)

## AutomatedTabTaskRuntimeOptions.runAtTabID property

Instead of start a new tab, run the script at the existing tab.

<b>Signature:</b>

```typescript
runAtTabID: number;
```
13 changes: 13 additions & 0 deletions api-documents/kit.automatedtabtasksharedoptions.active.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holoflows/kit](./kit.md) &gt; [AutomatedTabTaskSharedOptions](./kit.automatedtabtasksharedoptions.md) &gt; [active](./kit.automatedtabtasksharedoptions.active.md)

## AutomatedTabTaskSharedOptions.active property

Should the new tab to be active?

<b>Signature:</b>

```typescript
active: boolean;
```
13 changes: 13 additions & 0 deletions api-documents/kit.automatedtabtasksharedoptions.autoclose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holoflows/kit](./kit.md) &gt; [AutomatedTabTaskSharedOptions](./kit.automatedtabtasksharedoptions.md) &gt; [autoClose](./kit.automatedtabtasksharedoptions.autoclose.md)

## AutomatedTabTaskSharedOptions.autoClose property

Should the new tab to be closed automatically?

<b>Signature:</b>

```typescript
autoClose: boolean;
```
24 changes: 24 additions & 0 deletions api-documents/kit.automatedtabtasksharedoptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@holoflows/kit](./kit.md) &gt; [AutomatedTabTaskSharedOptions](./kit.automatedtabtasksharedoptions.md)

## AutomatedTabTaskSharedOptions interface

Shared options for AutomatedTabTask between the define-time and the runtime.

<b>Signature:</b>

```typescript
export interface AutomatedTabTaskSharedOptions
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [active](./kit.automatedtabtasksharedoptions.active.md) | <code>boolean</code> | Should the new tab to be active? |
| [autoClose](./kit.automatedtabtasksharedoptions.autoclose.md) | <code>boolean</code> | Should the new tab to be closed automatically? |
| [memorable](./kit.automatedtabtasksharedoptions.memorable.md) | <code>boolean</code> | If the task is memorable. - true: Memorize by url and all options - false: Does not use Memory |
| [pinned](./kit.automatedtabtasksharedoptions.pinned.md) | <code>boolean</code> | Should the new tab pinned? |
| [timeout](./kit.automatedtabtasksharedoptions.timeout.md) | <code>number</code> | Task timeout. |

Loading

0 comments on commit 13e6357

Please sign in to comment.