-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
9,727 additions
and
6,998 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"image": "mcr.microsoft.com/devcontainers/typescript-node", | ||
"remoteUser": "node", | ||
"updateContentCommand": "npm clean-install && npm run build" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
env: | ||
commonjs: true | ||
es2021: true | ||
es2022: true | ||
jest: true | ||
rules: | ||
# Disable for convenience | ||
react/display-name: off | ||
# Disable for convenience | ||
react/prop-types: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
extends: | ||
- plugin:react/recommended | ||
- plugin:react/jsx-runtime | ||
plugins: | ||
- react | ||
# rules: | ||
# react/react-in-jsx-scope: off | ||
settings: | ||
react: | ||
version: 18.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extends: | ||
- plugin:@typescript-eslint/recommended | ||
parser: '@typescript-eslint/parser' | ||
plugins: | ||
- '@typescript-eslint' | ||
rules: | ||
'@typescript-eslint/no-unused-vars': | ||
- error | ||
- argsIgnorePattern: ^_ | ||
caughtErrorsIgnorePattern: ^_ | ||
destructuredArrayIgnorePattern: ^_ | ||
varsIgnorePattern: ^_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
env: | ||
browser: true | ||
extends: | ||
- eslint:recommended | ||
overrides: | ||
- extends: .eslintrc.react.yml | ||
files: | ||
- '**/*.jsx' | ||
- '**/*.tsx' | ||
- extends: .eslintrc.typescript.yml | ||
files: | ||
- '**/*.mts' | ||
- '**/*.ts' | ||
- '**/*.tsx' | ||
- extends: .eslintrc.jest.yml | ||
files: | ||
- '**/__tests__/**' | ||
- '**/*.spec.cjs' | ||
- '**/*.spec.mjs' | ||
- '**/*.spec.js' | ||
- '**/*.spec.jsx' | ||
- '**/*.spec.cts' | ||
- '**/*.spec.mts' | ||
- '**/*.spec.ts' | ||
- '**/*.spec.tsx' | ||
- '**/*.test.cjs' | ||
- '**/*.test.mjs' | ||
- '**/*.test.js' | ||
- '**/*.test.jsx' | ||
- '**/*.test.cts' | ||
- '**/*.test.mts' | ||
- '**/*.test.ts' | ||
- '**/*.test.tsx' | ||
parserOptions: | ||
ecmaVersion: latest | ||
sourceType: module | ||
plugins: | ||
- prettier | ||
root: true | ||
rules: | ||
prettier/prettier: error | ||
no-empty: | ||
- error | ||
- allowEmptyCatch: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: Bug report | ||
description: Use this template to report a bug. | ||
labels: | ||
- bug | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
We run this project out of our spare time and may not monitor this repository every day. Our support capacity is very limited. | ||
Developers in professional capacity will receive prioritized support. | ||
- type: dropdown | ||
attributes: | ||
label: Version | ||
description: | | ||
Please verify the issue on latest versions. Support on non-latest version is minimal and on a per case basis. | ||
If you are using latest production, please verify against our latest development version as the issue could have been resolved recently. To install latest development version, run `npm install event-as-promise@main`. | ||
multiple: true | ||
options: | ||
- Latest production (@latest) | ||
- Latest development (@main) | ||
- Not latest | ||
validations: | ||
required: true | ||
- type: dropdown | ||
attributes: | ||
label: Module resolution | ||
description: Please describe how you import our package. | ||
multiple: true | ||
options: | ||
- 'ESM: import { EventAsPromise } from "event-as-promise"' | ||
- 'CommonJS: require("event-as-promise")' | ||
- Others or unrelated | ||
validations: | ||
required: true | ||
- type: dropdown | ||
attributes: | ||
label: Bundler | ||
description: For apps, please tell us what bundler is used to create your app bundle. | ||
multiple: true | ||
options: | ||
- 'Webpack: Plain' | ||
- 'Webpack: Complex' | ||
- ESBuild | ||
- 'create-react-app' | ||
- Not an app | ||
- Others or unrelated | ||
validations: | ||
required: true | ||
- type: dropdown | ||
attributes: | ||
label: Environment | ||
description: | | ||
We support [Browserslist "defaults"](https://github.com/browserslist/browserslist#full-list) and [Internet Explorer mode](https://aka.ms/iemode). Support of other environments is minimal. | ||
When using in a sandboxed environment (e.g. SharePoint, Salesforce, etc.), please verify the issue outside of the sandbox. If the issue is related to the sandbox, please file it to your sandbox vendor. | ||
multiple: true | ||
options: | ||
- '> 0.5%, last 2 versions, Firefox ESR, not dead' | ||
- Internet Explorer mode | ||
- Server-side rendering | ||
- Others or unrelated | ||
validations: | ||
required: true | ||
- type: textarea | ||
attributes: | ||
label: Test case | ||
description: | | ||
Please write a minimal test case which fail the scenario with comments in [BDD format (given/when/then)](https://www.thoughtworks.com/insights/blog/applying-bdd-acceptance-criteria-user-stories). | ||
To protect from regressions, once the issue is resolved, your test case will be added to [our test suite](../tree/main/packages/integration-test/). | ||
For your convenience, a basic test case is provided below. For advanced scenarios, please look at [our test suite](../tree/main/packages/integration-test/). | ||
*Support will be slow or denied if a test case is not provided.* | ||
render: js | ||
value: | | ||
import { expect, test } from '@jest/globals'; | ||
test('simple scenario', async () => { | ||
const target = new EventTarget(); | ||
const eventAsPromise = new EventAsPromise(); | ||
target.addEventListener('count', eventAsPromise.eventListener); | ||
const promise = eventAsPromise.one(); | ||
target.dispatchEvent(new CustomEvent('count', { detail: 'one' })); | ||
await expect(promise).resolves.toEqual(expect.objectContaining({ detail: 'one' })); | ||
}); | ||
- type: input | ||
attributes: | ||
label: Coding sandbox URL | ||
description: | | ||
If you have a minimal repro in a coding sandbox, please provide a URL here. Please prepare it from scratch. We cannot work directly on your app source code. | ||
placeholder: 'https://' | ||
- type: textarea | ||
attributes: | ||
label: Console errors | ||
description: Please copy any related errors printed to the console here. | ||
render: js | ||
- type: textarea | ||
attributes: | ||
label: Screenshots | ||
description: Please remove or obscure any personally identifiable information from your screenshots or recordings. | ||
- type: textarea | ||
attributes: | ||
label: Additional context | ||
description: If any of the answers is "others or unrelated", please explain it here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
blank_issues_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
## Changelog | ||
|
||
> Please copy and paste new entries from `CHANGELOG.md` here. | ||
## Specific changes | ||
|
||
> Please list each individual specific change in this pull request. | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Bump dependencies | ||
|
||
on: | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
call-workflow: | ||
permissions: | ||
contents: write | ||
id-token: write | ||
secrets: inherit | ||
uses: compulim/workflows/.github/workflows/bump-dependencies.yml@main | ||
with: | ||
package-name: event-as-promise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Bump scaffold | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
package-name: | ||
default: event-as-promise | ||
description: Name of the package | ||
required: true | ||
type: string | ||
use-react: | ||
default: false | ||
description: Use React | ||
required: true | ||
type: boolean | ||
skip-integration-test: | ||
default: false | ||
description: Skip integration test | ||
required: true | ||
type: boolean | ||
|
||
jobs: | ||
call-workflow: | ||
secrets: inherit | ||
uses: compulim/workflows/.github/workflows/bump-scaffold.yml@main | ||
with: | ||
package-name: ${{ inputs.package-name }} | ||
skip-integration-test: ${{ inputs.skip-integration-test }} | ||
use-react: ${{ inputs.use-react }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Continuous deployment | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths-ignore: | ||
- '.devcontainer/**' | ||
- '.github/**' | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
call-workflow: | ||
permissions: | ||
attestations: write | ||
contents: write | ||
id-token: write | ||
pages: write | ||
secrets: inherit | ||
uses: compulim/workflows/.github/workflows/continuous-deployment.yml@main | ||
with: | ||
package-name: event-as-promise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: List outdated dependencies | ||
|
||
on: | ||
schedule: | ||
- cron: '0 4 * * 1' | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
call-workflow: | ||
uses: compulim/workflows/.github/workflows/list-outdated-dependencies.yml@main |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: Prepare release | ||
|
||
on: | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
call-workflow: | ||
permissions: | ||
contents: write | ||
id-token: write | ||
secrets: inherit | ||
uses: compulim/workflows/.github/workflows/prepare-release.yml@main |
Oops, something went wrong.