Skip to content

Commit

Permalink
test also against older version of typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
nightwing committed Jan 31, 2025
1 parent 78fbb22 commit 0ebb0c7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 12 deletions.
11 changes: 7 additions & 4 deletions demo/test_package/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,13 @@ editor.session.startOperation();
editor.session.endOperation();

editor.on("paste", (e) => {
var htmlString = e.event?.clipboardData?.getData("text/html")
if (htmlString) {
e.text = htmlString
if (e.event && e.event.clipboardData) {
var htmlString = e.event.clipboardData.getData("text/html")
if (htmlString) {
e.text = htmlString
}
}
})

themesByName.textmate?.theme;
if (themesByName.textmate)
console.log(themesByName.textmate.theme);
4 changes: 2 additions & 2 deletions demo/test_package/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
// "noUncheckedIndexedAccess": true,
// "noImplicitOverride": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"module": "commonjs",
Expand Down
18 changes: 12 additions & 6 deletions tool/test-npm-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,25 @@ PACKAGE_FILE=$(ls ace-*.tgz | sort -V | tail -n 1)
mv "$PACKAGE_FILE" ace-code-latest.tgz


# Install the ace package from the npm pack result
# npm install "../../$PACKAGE_FILE"

cd demo/test_package

# Clean up previous installation
rm -rf node_modules/ace-code
rm -rf node_modules
rm -f package-lock.json


# Install the ace package from the npm pack result
npm i ../../ace-code-latest.tgz

# Install TypeScript
npm install
npm i typescript@latest
rm index.js
npm run build
npm run test

# Run TypeScript type checking
# Install old version of TypeScript
npm i [email protected]
rm index.js
npm run build
npm run test

Expand Down
19 changes: 19 additions & 0 deletions types/ace-modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4749,6 +4749,25 @@ declare module "ace-code/src/incremental_search" {
import { Editor } from "ace-code/src/editor";
import { Range } from "ace-code/src/range";
}
declare module "ace-code/src/scope" {
export class Scope {
constructor(name: any, parent?: Scope);
get(name: any, extraId?: string | undefined): any;
find(states: any): any;
hasParent(states: any): boolean;
count(): number;
getAllScopeNames(): string[];
toStack(): any[];
/**
* Retrieves the scope for the given stack and current state.
*
* @param {string[]} stack - The stack of scopes.
* @param {string | Scope} currentState - The current state.
* @returns {Scope} The scope for the given stack and current state.
*/
fromStack(stack: string[], currentState: string | Scope): Scope;
}
}
declare module "ace-code/src/split" {
export type ISplit = import("ace-code").Ace.EventEmitter<any> & {
[key: string]: any;
Expand Down

0 comments on commit 0ebb0c7

Please sign in to comment.