mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
[ts] Update main dependencies, add formatting script, add Biome for linting, temporary commit
This commit is contained in:
parent
b544dd99ed
commit
8eb9ba957b
1
.gitignore
vendored
1
.gitignore
vendored
@ -251,3 +251,4 @@ spine-libgdx/.factorypath
|
|||||||
spine-libgdx/.project
|
spine-libgdx/.project
|
||||||
.clang-format
|
.clang-format
|
||||||
spine-c/codegen/spine-cpp-types.json
|
spine-c/codegen/spine-cpp-types.json
|
||||||
|
spine-flutter/example/devtools_options.yaml
|
||||||
|
|||||||
11
spine-ts/biome.json
Normal file
11
spine-ts/biome.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"formatter": {
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
|
"rules": {
|
||||||
|
"recommended": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1013
spine-ts/package-lock.json
generated
1013
spine-ts/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -10,6 +10,8 @@
|
|||||||
"prepublish": "npm run clean && npm run build",
|
"prepublish": "npm run clean && npm run build",
|
||||||
"clean": "npx rimraf spine-core/dist spine-canvas/dist spine-canvaskit/dist spine-webgl/dist spine-phaser-v3/dist spine-phaser-v4/dist spine-player/dist spine-threejs/dist spine-pixi-v7/dist spine-pixi-v8/dist spine-webcomponents/dist",
|
"clean": "npx rimraf spine-core/dist spine-canvas/dist spine-canvaskit/dist spine-webgl/dist spine-phaser-v3/dist spine-phaser-v4/dist spine-player/dist spine-threejs/dist spine-pixi-v7/dist spine-pixi-v8/dist spine-webcomponents/dist",
|
||||||
"build": "npm run clean && npm run build:modules && concurrently 'npm run build:core:iife' 'npm run build:core:esm' 'npm run build:canvas:iife' 'npm run build:canvas:esm' 'npm run build:canvaskit:iife' 'npm run build:canvaskit:esm' 'npm run build:webgl:iife' 'npm run build:webgl:esm' 'npm run build:phaser-v3:iife' 'npm run build:phaser-v4:iife' 'npm run build:phaser-v3:esm' 'npm run build:phaser-v4:esm' 'npm run build:player:iife' 'npm run build:player:esm' 'npm run build:player:css' 'npm run build:threejs:iife' 'npm run build:threejs:esm' 'npm run build:pixi-v7:iife' 'npm run build:pixi-v7:esm' 'npm run build:pixi-v8:iife' 'npm run build:pixi-v8:esm' 'npm run build:webcomponents:iife' 'npm run build:webcomponents:esm'",
|
"build": "npm run clean && npm run build:modules && concurrently 'npm run build:core:iife' 'npm run build:core:esm' 'npm run build:canvas:iife' 'npm run build:canvas:esm' 'npm run build:canvaskit:iife' 'npm run build:canvaskit:esm' 'npm run build:webgl:iife' 'npm run build:webgl:esm' 'npm run build:phaser-v3:iife' 'npm run build:phaser-v4:iife' 'npm run build:phaser-v3:esm' 'npm run build:phaser-v4:esm' 'npm run build:player:iife' 'npm run build:player:esm' 'npm run build:player:css' 'npm run build:threejs:iife' 'npm run build:threejs:esm' 'npm run build:pixi-v7:iife' 'npm run build:pixi-v7:esm' 'npm run build:pixi-v8:iife' 'npm run build:pixi-v8:esm' 'npm run build:webcomponents:iife' 'npm run build:webcomponents:esm'",
|
||||||
|
"format": "npx tsx scripts/format.ts",
|
||||||
|
"lint": "npx biome lint .",
|
||||||
"postbuild": "npm run minify",
|
"postbuild": "npm run minify",
|
||||||
"build:modules": "npx tsc -b -clean && npx tsc -b",
|
"build:modules": "npx tsc -b -clean && npx tsc -b",
|
||||||
"build:core:iife": "npx esbuild --bundle spine-core/src/index.ts --tsconfig=spine-core/tsconfig.json --sourcemap --outfile=spine-core/dist/iife/spine-core.js --format=iife --global-name=spine",
|
"build:core:iife": "npx esbuild --bundle spine-core/src/index.ts --tsconfig=spine-core/tsconfig.json --sourcemap --outfile=spine-core/dist/iife/spine-core.js --format=iife --global-name=spine",
|
||||||
@ -82,12 +84,15 @@
|
|||||||
"spine-webcomponents"
|
"spine-webcomponents"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/offscreencanvas": "^2019.6.4",
|
"@types/offscreencanvas": "^2019.7.3",
|
||||||
"concurrently": "^7.6.0",
|
"concurrently": "^9.2.0",
|
||||||
"copyfiles": "^2.4.1",
|
"copyfiles": "^2.4.1",
|
||||||
"esbuild": "^0.25.4",
|
"esbuild": "^0.25.6",
|
||||||
"alive-server": "^1.3.0",
|
"alive-server": "^1.3.0",
|
||||||
"rimraf": "^3.0.2",
|
"rimraf": "^6.0.1",
|
||||||
"typescript": "5.6.2"
|
"typescript": "^5.8.3",
|
||||||
|
"typescript-formatter": "^7.2.2",
|
||||||
|
"@biomejs/biome": "^2.1.1",
|
||||||
|
"tsx": "^4.19.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
38
spine-ts/scripts/format.ts
Normal file
38
spine-ts/scripts/format.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { execSync } from 'node:child_process';
|
||||||
|
import * as fs from 'node:fs';
|
||||||
|
import * as path from 'node:path';
|
||||||
|
|
||||||
|
function findTypeScriptFiles(dir: string, files: string[] = []): string[] {
|
||||||
|
if (!fs.existsSync(dir)) return files;
|
||||||
|
|
||||||
|
fs.readdirSync(dir).forEach(name => {
|
||||||
|
const filePath = path.join(dir, name);
|
||||||
|
const stat = fs.statSync(filePath);
|
||||||
|
|
||||||
|
if (stat.isDirectory()) {
|
||||||
|
// Skip node_modules and dist directories
|
||||||
|
if (name !== 'node_modules' && name !== 'dist') {
|
||||||
|
findTypeScriptFiles(filePath, files);
|
||||||
|
}
|
||||||
|
} else if (name.endsWith('.ts') && !name.endsWith('.d.ts')) {
|
||||||
|
files.push(filePath);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return files;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Find all TypeScript files in spine-* directories
|
||||||
|
const allFiles: string[] = [];
|
||||||
|
fs.readdirSync('.').forEach(name => {
|
||||||
|
if (name.startsWith('spine-') && fs.statSync(name).isDirectory()) {
|
||||||
|
findTypeScriptFiles(name, allFiles);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (allFiles.length > 0) {
|
||||||
|
console.log(`Formatting ${allFiles.length} TypeScript files...`);
|
||||||
|
execSync(`npx tsfmt -r ${allFiles.join(' ')}`, { stdio: 'inherit' });
|
||||||
|
} else {
|
||||||
|
console.log('No TypeScript files found to format.');
|
||||||
|
}
|
||||||
12
spine-ts/scripts/tsconfig.json
Normal file
12
spine-ts/scripts/tsconfig.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2020",
|
||||||
|
"module": "commonjs",
|
||||||
|
"lib": ["ES2020"],
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"strict": true
|
||||||
|
},
|
||||||
|
"include": ["*.ts"]
|
||||||
|
}
|
||||||
@ -4,8 +4,8 @@ export * from './SpineDebugRenderer.js';
|
|||||||
export * from './SpineTexture.js';
|
export * from './SpineTexture.js';
|
||||||
export * from './SlotMesh.js';
|
export * from './SlotMesh.js';
|
||||||
export * from './DarkSlotMesh.js';
|
export * from './DarkSlotMesh.js';
|
||||||
export * from './assets/atlasLoader.js';
|
export * from './assets/Atlas-Loader.js';
|
||||||
export * from './assets/skeletonLoader.js';
|
export * from './assets/Skeleton-Loader.js';
|
||||||
export * from './darkTintMesh/DarkTintBatchGeom.js';
|
export * from './darkTintMesh/DarkTintBatchGeom.js';
|
||||||
export * from './darkTintMesh/DarkTintGeom.js';
|
export * from './darkTintMesh/DarkTintGeom.js';
|
||||||
export * from './darkTintMesh/DarkTintMaterial.js';
|
export * from './darkTintMesh/DarkTintMaterial.js';
|
||||||
@ -14,5 +14,5 @@ export * from './darkTintMesh/DarkTintRenderer.js';
|
|||||||
export * from "@esotericsoftware/spine-core";
|
export * from "@esotericsoftware/spine-core";
|
||||||
|
|
||||||
|
|
||||||
import './assets/atlasLoader.js'; // Side effects install the loaders into pixi
|
import './assets/Atlas-Loader.js'; // Side effects install the loaders into pixi
|
||||||
import './assets/skeletonLoader.js'; // Side effects install the loaders into pixi
|
import './assets/Skeleton-Loader.js'; // Side effects install the loaders into pixi
|
||||||
|
|||||||
@ -28,13 +28,13 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
import './require-shim.js'; // Side effects add require pixi.js to global scope
|
import './require-shim.js'; // Side effects add require pixi.js to global scope
|
||||||
import './assets/atlasLoader.js'; // Side effects install the loaders into pixi
|
import './assets/Atlas-Loader.js'; // Side effects install the loaders into pixi
|
||||||
import './assets/skeletonLoader.js'; // Side effects install the loaders into pixi
|
import './assets/Skeleton-Loader.js'; // Side effects install the loaders into pixi
|
||||||
import './darktint/DarkTintBatcher.js'; // Side effects install the batcher into pixi
|
import './darktint/DarkTintBatcher.js'; // Side effects install the batcher into pixi
|
||||||
import './SpinePipe.js';
|
import './SpinePipe.js';
|
||||||
|
|
||||||
export * from './assets/atlasLoader.js';
|
export * from './assets/Atlas-Loader.js';
|
||||||
export * from './assets/skeletonLoader.js';
|
export * from './assets/Skeleton-Loader.js';
|
||||||
export * from './require-shim.js';
|
export * from './require-shim.js';
|
||||||
export * from './Spine.js';
|
export * from './Spine.js';
|
||||||
export * from './SpineDebugRenderer.js';
|
export * from './SpineDebugRenderer.js';
|
||||||
|
|||||||
11
tests/biome.json
Normal file
11
tests/biome.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"formatter": {
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
"linter": {
|
||||||
|
"enabled": true,
|
||||||
|
"rules": {
|
||||||
|
"recommended": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,11 +3,15 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compare": "tsx compare-with-reference-impl.ts"
|
"compare": "tsx compare-with-reference-impl.ts",
|
||||||
|
"format": "npx tsfmt -r ./**/*.ts",
|
||||||
|
"lint": "npx biome lint ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.0.0",
|
"@types/node": "^20.0.0",
|
||||||
"tsx": "^4.0.0"
|
"tsx": "^4.0.0",
|
||||||
|
"typescript-formatter": "^7.2.2",
|
||||||
|
"@biomejs/biome": "^2.1.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mariozechner/lsp-cli": "^0.1.3"
|
"@mariozechner/lsp-cli": "^0.1.3"
|
||||||
|
|||||||
24
tests/tsfmt.json
Normal file
24
tests/tsfmt.json
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"baseIndentSize": 0,
|
||||||
|
"indentSize": 4,
|
||||||
|
"tabSize": 4,
|
||||||
|
"indentStyle": 2,
|
||||||
|
"newLineCharacter": "\n",
|
||||||
|
"convertTabsToSpaces": false,
|
||||||
|
"insertSpaceAfterCommaDelimiter": true,
|
||||||
|
"insertSpaceAfterSemicolonInForStatements": true,
|
||||||
|
"insertSpaceBeforeAndAfterBinaryOperators": true,
|
||||||
|
"insertSpaceAfterConstructor": true,
|
||||||
|
"insertSpaceAfterKeywordsInControlFlowStatements": true,
|
||||||
|
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
|
||||||
|
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
|
||||||
|
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
|
||||||
|
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
|
||||||
|
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
|
||||||
|
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
|
||||||
|
"insertSpaceAfterTypeAssertion": false,
|
||||||
|
"insertSpaceBeforeFunctionParenthesis": true,
|
||||||
|
"insertSpaceBeforeTypeAnnotation": false,
|
||||||
|
"placeOpenBraceOnNewLineForFunctions": false,
|
||||||
|
"placeOpenBraceOnNewLineForControlBlocks": false
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user