Skip to content

Commit

Permalink
fix(types): fix issues with skipLibCheck: false
Browse files Browse the repository at this point in the history
Close #1025
Close #1028

# Conflicts:
#	packages/@interactjs/arrange/start.ts
#	packages/@interactjs/feedback/pointers.ts
#	packages/@interactjs/symbol-tree/SymbolTree.ts
#	packages/@interactjs/symbol-tree/package.json
  • Loading branch information
taye authored and CI committed Mar 28, 2024
1 parent 8240375 commit 3571837
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.10.27

- fix(types): fix issues with `skipLibCheck: false`

## v1.10.26

- fix: improve build; check output for ES2018 compatibility
Expand Down
2 changes: 1 addition & 1 deletion esnext.rollup.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const {
isPro,
} = require('./scripts/utils')

const BUNDLED_DEPS = ['rebound', 'symbol-tree']
const BUNDLED_DEPS = ['rebound']
const INPUT_EXTENSIONS = ['.ts', '.tsx', '.vue']
const moduleDirectory = getModuleDirectories()

Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"@types/node": "^17.0.42",
"@types/react": "^18.2.43",
"@types/shelljs": "^0.8.11",
"@types/symbol-tree": "^3.2.3",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"@vitejs/plugin-vue": "^4.5.2",
Expand Down Expand Up @@ -90,7 +89,6 @@
"stylelint-config-html": "^1.1.0",
"stylelint-config-recess-order": "^4.2.0",
"stylelint-config-standard": "^35.0.0",
"symbol-tree": "^3.2.4",
"temp": "^0.9.4",
"ts-node": "^10.9.2",
"typedoc": "^0.25.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/@interactjs/core/BaseEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class BaseEvent<T extends ActionName | null = never> {

// defined outside of class definition to avoid assignment of undefined during
// construction
export interface BaseEvent<T extends ActionName> {
export interface BaseEvent<T extends ActionName | null = never> {
interaction: InteractionProxy<T>
}

Expand Down
2 changes: 1 addition & 1 deletion packages/@interactjs/core/Interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ declare module '@interactjs/core/scope' {

export type InteractionProxy<T extends ActionName | null = never> = Pick<
Interaction<T>,
keyof typeof _ProxyValues | keyof typeof _ProxyMethods
Exclude<keyof typeof _ProxyValues | keyof typeof _ProxyMethods, '_proxy'>
>

let idCounter = 0
Expand Down
6 changes: 5 additions & 1 deletion packages/@interactjs/core/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ interface DocSignalArg {
options: Record<string, any>
}

/** @internal */
export interface Plugin {
[key: string]: any
id?: string
Expand Down Expand Up @@ -257,6 +256,11 @@ export class Scope {
}
}

// Keep Scope class internal, but expose minimal interface to avoid broken types when Scope is stripped out
export interface Scope {
fire<T extends ListenerName>(name: T, arg: SignalArgs[T]): void | false
}

/** @internal */
export function initScope(scope: Scope, window: Window | typeof globalThis) {
scope.isInitialized = true
Expand Down
3 changes: 1 addition & 2 deletions scripts/bin/clean.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
const fs = require('fs')
const path = require('path')

const del = require('del')
const shell = require('shelljs')

const { getBuiltJsFiles } = require('../utils')

console.log('removing typescript generated files.')
shell.exec('tsc -b types.tsconfig.json --clean')

getBuiltJsFiles().then(async (filenames) => {
Promise.all([getBuiltJsFiles(), import('del').then((m) => m.deleteAsync)]).then(async ([filenames, del]) => {
console.log(`removing ${filenames.length} generated files and directories.`)

await Promise.all(
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/dependentTsProject/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"module": "commonjs",
"lib": ["dom", "esnext"],
"strict": true,
"skipLibCheck": true,
"skipLibCheck": false,
"esModuleInterop": true,
"noEmit": true
}
Expand Down
2 changes: 1 addition & 1 deletion types.tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"include": ["packages/@interactjs", "shims.d.ts"],
"exclude": ["**/*.spec.ts"],
"exclude": ["**/*.spec.ts", "packages/@interactjs/vue", "packages/@interactjs/react"],
"compilerOptions": {
"target": "esnext",
"module": "esnext",
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1911,11 +1911,6 @@
resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8"
integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==

"@types/symbol-tree@^3.2.3":
version "3.2.5"
resolved "https://registry.npmjs.org/@types/symbol-tree/-/symbol-tree-3.2.5.tgz#70a848c75bccdbcededd259493cee33bcb57b097"
integrity sha512-zXnnyENt1TYQcS21MkPaJCVjfcPq7p7yc5mo5JACuumXp6sly5jnlS0IokHd+xmmuCbx6V7JqkMBpswR+nZAcw==

"@types/testing-library__jest-dom@^5.9.1":
version "5.14.9"
resolved "https://registry.npmjs.org/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.9.tgz#0fb1e6a0278d87b6737db55af5967570b67cb466"
Expand Down

0 comments on commit 3571837

Please sign in to comment.