Skip to content

Commit acfb8cc

Browse files
authored
feat: Update ace to v1.39.1 (Acode-Foundation#1254)
* feat: Update ace to v1.39.1 * fix: linting
1 parent 6856414 commit acfb8cc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+105
-50
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
pnpm-lock.yaml
1313
.zed
1414
.idea
15+
ace-builds

biome.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3-
"formatter": { "enabled": true, "indentStyle": "tab" },
4-
"organizeImports": { "enabled": true },
3+
"formatter": {
4+
"enabled": true,
5+
"indentStyle": "tab"
6+
},
7+
"organizeImports": {
8+
"enabled": true
9+
},
510
"linter": {
611
"enabled": true,
712
"rules": {
813
"recommended": false,
914
"complexity": {
10-
"noForEach": "warn",
15+
"noForEach": "off",
1116
"noStaticOnlyClass": "error",
1217
"noUselessSwitchCase": "error",
1318
"useFlatMap": "error"
@@ -25,10 +30,13 @@
2530
}
2631
}
2732
},
28-
"javascript": { "globals": ["Global1"] },
33+
"javascript": {
34+
"globals": ["Global1"]
35+
},
2936
"files": {
3037
"include": ["src/**/*", "utils/**/*.js", "www/**/*.js", "www/res/**/*.css"],
3138
"ignore": [
39+
"ace-builds",
3240
"www/js/**/*.js",
3341
"www/css/**/*.css",
3442
"src/plugins/**/*",

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"setup": "node ./utils/setup.js",
1313
"lint": "biome lint --write",
1414
"format": "biome format --write",
15-
"check": "biome check --write"
15+
"check": "biome check --write",
16+
"updateAce": "node ./utils/updateAce.js"
1617
},
1718
"keywords": [
1819
"ecosystem:cordova"
@@ -112,4 +113,4 @@
112113
"yargs": "^17.7.2"
113114
},
114115
"browserslist": "cover 100%,not android < 5"
115-
}
116+
}

utils/updateAce.js

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
const fs = require("node:fs");
2+
const path = require("node:path");
3+
4+
const sourceDir = "./ace-builds/src-min";
5+
const destDir = "./www/js/ace";
6+
7+
function updateAce() {
8+
try {
9+
// Remove existing destination directory if it exists
10+
if (fs.existsSync(destDir)) {
11+
fs.rmSync(destDir, { recursive: true });
12+
console.log("Removed existing destination directory");
13+
}
14+
15+
// Create destination directory
16+
fs.mkdirSync(destDir, { recursive: true });
17+
console.log("Created new destination directory");
18+
19+
// Read all files from source directory
20+
const files = fs.readdirSync(sourceDir);
21+
22+
files.forEach((file) => {
23+
const sourcePath = path.join(sourceDir, file);
24+
const destPath = path.join(destDir, file);
25+
26+
// Skip snippets directory and worker files
27+
if (file === "snippets" || file.startsWith("worker-")) {
28+
console.log(`Skipping: ${file}`);
29+
return;
30+
}
31+
32+
// Copy if it's a file
33+
if (fs.statSync(sourcePath).isFile()) {
34+
fs.copyFileSync(sourcePath, destPath);
35+
console.log(`Copied: ${file}`);
36+
}
37+
});
38+
39+
console.log("Ace editor files updated successfully!");
40+
} catch (error) {
41+
console.error("Error updating Ace editor files:", error);
42+
}
43+
}
44+
45+
updateAce();

www/js/ace/ace.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www/js/ace/ext-inline_autocomplete.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www/js/ace/ext-language_tools.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www/js/ace/ext-prompt.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www/js/ace/ext-searchbox.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

www/js/ace/mode-astro.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)