Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- main
pull_request:

permissions:
actions: read
contents: read
Expand All @@ -22,21 +21,16 @@ jobs:
with:
version: 9

# This enables task distribution via Nx Cloud
# Run this command as early as possible, before dependencies are installed
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"

# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- run: pnpm install --frozen-lockfile
- run: pnpm install --no-frozen-lockfile
- uses: nrwl/nx-set-shas@v4

# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: pnpm exec nx-cloud record -- echo Hello World
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
- run: pnpm exec nx affected -t build && pnpm build
- run: pnpx nx affected -t build && pnpm build
3 changes: 2 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default [
'**/.nx',
'**/pnpm-*.yaml',
'**/node_modules',
'**/dist'
'**/dist',
'**/*.html'
]
},
{
Expand Down
3 changes: 1 addition & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,5 @@
"sharedGlobals"
]
},
"nxCloudId": "681f1bf43845db51336764b6",
"nxCloudAccessToken": "OWM0ZThhYWItODQwYS00ZjgzLWJhMWMtODYyOTgzMDVjMmZhfHJlYWQtd3JpdGU="
"nxCloudId": "681f1bf43845db51336764b6"
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "git",
"url": "https://github.com/ArcStackLab/webapis.git"
},
"packageManager": "pnpm@9.2.0",
"packageManager": "pnpm@9",
"description": "A Comprehensive Integration of All Web Standard APIs",
"scripts": {
"build": "tsup",
Expand Down Expand Up @@ -52,8 +52,11 @@
"esbuild": "^0.23.1",
"eslint": "^9.9.1",
"globals": "^15.9.0",
"gulp": "^5.0.0",
"gulp-cli": "^3.0.0",
"husky": "^9.1.5",
"lint-staged": "^15.2.10",
"netlify-cli": "^21.4.2",
"nx": "19.8.0",
"prettier": "^3.3.3",
"tslib": "^2.7.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/permissions/demo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function createOptionTag(value) {
}

/**
* @type {ReturnType<PermissionsAPI.getPermissionHandler>}
* @type {ReturnType<getPermissionHandler>}
*/
let permissionHandler
const closeButton = document.querySelector('#close')
Expand Down Expand Up @@ -49,7 +49,7 @@ const stateColor = {
}

function handlePermission(option) {
permissionHandler = PermissionsAPI.getPermissionHandler(option, {
permissionHandler = getPermissionHandler(option, {
granted: (permission) => {
console.log('Permission Granted:', permission)
state.replaceChildren(
Expand Down
2 changes: 2 additions & 0 deletions packages/permissions/src/PermissionsAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ export class PermissionsAPI {
getPermission: () => {
const _events = PermissionsAPI.#events.get(_handler)

if (!_events || _handler === null) throw new Error('Cannot get permission: handler has been closed')

PermissionsAPI.getPermission(permissionOption).then(
({ error, permission }) => {
if (error) {
Expand Down
1 change: 1 addition & 0 deletions packages/permissions/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export type PermissionHandler<T = void> = {
/**
* Executes the permission request.
* @returns {T} - The result of the permission request.
* @throws {Error} - Throws if handler is already closed
*/
getPermission: () => T

Expand Down