diff --git a/package-lock.json b/package-lock.json index 908ab7d..9d55e46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "create-next2d-app", - "version": "2.5.1", + "version": "2.6.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "create-next2d-app", - "version": "2.5.1", + "version": "2.6.0", "license": "MIT", "bin": { "create-next2d-app": "dist/index.js" @@ -20,7 +20,7 @@ "@vitest/coverage-v8": "^5.0.5", "eslint": "^10.14.0", "eslint-plugin-unused-imports": "^4.4.1", - "globals": "^17.13.0", + "globals": "^17.14.0", "typescript": "^6.0.3", "vitest": "^5.0.5" } @@ -164,9 +164,9 @@ } }, "node_modules/@eslint/config-array/node_modules/brace-expansion": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", - "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "license": "MIT", "dependencies": { @@ -751,9 +751,9 @@ "license": "MIT" }, "node_modules/@types/estree": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.10.tgz", + "integrity": "sha512-lTyOMnOcmRBzdCv6/4zUZCrEhV0xrqQiUZBZtVcbmLHBXKLnN8q89v/wKRF/Q0HbwVsqbIG3o5HDoFl9sduM+g==", "dev": true, "license": "MIT" }, @@ -803,47 +803,28 @@ "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.1.tgz", - "integrity": "sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.14.tgz", + "integrity": "sha512-wCBiZ77u1tuWde6G/nfOtLaCTYcFDU5yCzARzK10y+rLhzYoL7a7yEemcopcc2Mzow7gZOIjnV2ym1NYmdiJOQ==", "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/typescript-estree": "8.72.1", - "@typescript-eslint/utils": "8.72.1", - "debug": "^4.4.3", - "ts-api-utils": "^2.5.0" - }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" + "node": ">= 4" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { + "node_modules/@typescript-eslint/parser": { "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.1.tgz", - "integrity": "sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.1.tgz", + "integrity": "sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.72.1", - "@typescript-eslint/tsconfig-utils": "8.72.1", + "@typescript-eslint/scope-manager": "8.72.1", "@typescript-eslint/types": "8.72.1", + "@typescript-eslint/typescript-estree": "8.72.1", "@typescript-eslint/visitor-keys": "8.72.1", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" + "debug": "^4.4.3" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -853,10 +834,11 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": { + "node_modules/@typescript-eslint/project-service": { "version": "8.72.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.1.tgz", "integrity": "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==", @@ -878,34 +860,15 @@ "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz", - "integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "node_modules/@typescript-eslint/scope-manager": { "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.1.tgz", - "integrity": "sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.1.tgz", + "integrity": "sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.72.1", "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/typescript-estree": "8.72.1" + "@typescript-eslint/visitor-keys": "8.72.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -913,29 +876,14 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { + "node_modules/@typescript-eslint/tsconfig-utils": { "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.1.tgz", - "integrity": "sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz", + "integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==", "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/project-service": "8.72.1", - "@typescript-eslint/tsconfig-utils": "8.72.1", - "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/visitor-keys": "8.72.1", - "debug": "^4.4.3", - "minimatch": "^10.2.2", - "semver": "^7.7.3", - "tinyglobby": "^0.2.15", - "ts-api-utils": "^2.5.0" - }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -947,16 +895,18 @@ "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": { + "node_modules/@typescript-eslint/type-utils": { "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.1.tgz", - "integrity": "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.72.1.tgz", + "integrity": "sha512-iY2wlmyrXJmx4yxUGP3aYCFF3cA/6ShddOKmLU2dx7LnEykbAM8WThlxZEfd1NddqceF6eJmZUayxx9oKIYNlg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.72.1", - "@typescript-eslint/types": "^8.72.1", - "debug": "^4.4.3" + "@typescript-eslint/types": "8.72.1", + "@typescript-eslint/typescript-estree": "8.72.1", + "@typescript-eslint/utils": "8.72.1", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -966,101 +916,25 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz", - "integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/balanced-match": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", - "dev": true, - "license": "MIT", - "engines": { - "node": "18 || 20 || >=22" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^4.0.2" - }, - "engines": { - "node": "20 || >=22" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.8.tgz", - "integrity": "sha512-YYNsSlXBjMk92SKnkwvB5LOVSa6OznlFUGcsvrFgNJbJCd0M1XKeFVRc8ZByeCqz32FivYNHJVooLmdqrmvp/Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/minimatch": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", - "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "brace-expansion": "^5.0.8" - }, - "engines": { - "node": "18 || 20 || >=22" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@typescript-eslint/parser": { + "node_modules/@typescript-eslint/types": { "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.72.1.tgz", - "integrity": "sha512-ZGwZP4OCfyA0AQTpEAMWz+rtX01DRhQWW5hB0ucKDEIX5U7jdmPSaMx94rQfaPAQzIYz2BimOgKOJtjfpRFQ9g==", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.1.tgz", + "integrity": "sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==", "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/scope-manager": "8.72.1", - "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/typescript-estree": "8.72.1", - "@typescript-eslint/visitor-keys": "8.72.1", - "debug": "^4.4.3" - }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", - "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "node_modules/@typescript-eslint/typescript-estree": { "version": "8.72.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.72.1.tgz", "integrity": "sha512-DAlUoUV93hIvrtIQLwCbmZQYVZwOMhiHJrOVUUIWicFZaIYjTRqlY3I/NZevfkLmSqkNHRu2qYDcq9lrn16oOQ==", @@ -1088,46 +962,7 @@ "typescript": ">=4.8.4 <6.1.0" } }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/project-service": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.72.1.tgz", - "integrity": "sha512-fAuVMkwdO/huI8nyo/WKnNKf6Gag93S56Rh3Ts5mGcavwSdaN8tRg1gCeIGX8PF+nzp1BjGfO4gHhGzW1J6jTg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.72.1", - "@typescript-eslint/types": "^8.72.1", - "debug": "^4.4.3" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree/node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.72.1.tgz", - "integrity": "sha512-e4D5R5vpeAEPBxT2BAzsFQL3sbwyeeeo5+aczgNSRK1V734jE7pTqaGFU+fXapWEQwnZbpFaTn32+Z8DwS6OTg==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "typescript": ">=4.8.4 <6.1.0" - } - }, - "node_modules/@typescript-eslint/parser/node_modules/balanced-match": { + "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", @@ -1137,7 +972,7 @@ "node": "18 || 20 || >=22" } }, - "node_modules/@typescript-eslint/parser/node_modules/brace-expansion": { + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "version": "5.0.12", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", @@ -1150,7 +985,7 @@ "node": "20 || >=22" } }, - "node_modules/@typescript-eslint/parser/node_modules/minimatch": { + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { "version": "10.2.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", @@ -1166,15 +1001,17 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@typescript-eslint/scope-manager": { + "node_modules/@typescript-eslint/utils": { "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.72.1.tgz", - "integrity": "sha512-lC/t6eMCZZQAAKZEYGL6RDVSuFehpdmMT6h+nJIjIa6oylN/PwDgDVtEIbB7O9xFfZYtZAYLoLlDNWKJhtF+uQ==", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.72.1.tgz", + "integrity": "sha512-5v5liypurJBFHCBNqh/RjsymAD+VWcE0djuGY/BUqp5fC3Qn+luWDEksjuTtWjPn6i5zQlUtkZCRG/CYG0yCkA==", "dev": true, "license": "MIT", "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.72.1", "@typescript-eslint/types": "8.72.1", - "@typescript-eslint/visitor-keys": "8.72.1" + "@typescript-eslint/typescript-estree": "8.72.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1182,20 +1019,10 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/types": { - "version": "8.72.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.72.1.tgz", - "integrity": "sha512-LmE5IhQet1BWOWEXqBrVtBPsMAOQ6Nzk35d+WLh3mk4EUF33sqlfxjio1MdYeSvKSG5skactKKuixBIKXhL4Rw==", - "dev": true, - "license": "MIT", - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/visitor-keys": { @@ -1320,9 +1147,9 @@ } }, "node_modules/acorn": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", - "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.19.0.tgz", + "integrity": "sha512-oJlA3XiRm7Cyk6qFD2Jn8ak9B7jSy0qy00ADO3+8dpT0LSjFihQYv4C02LFCSYJV3Q37xYwwRy5m+IpIiUzqWw==", "dev": true, "license": "MIT", "bin": { @@ -1396,9 +1223,9 @@ "license": "MIT" }, "node_modules/brace-expansion": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.18.tgz", - "integrity": "sha512-Edep/X9fGqVNmzKBVsDYIOtD+z1tuezV70LBjdCst9Tqu76lsnvRiZ6oTic1n+/BIwX6QDGAO94PN4N2SADvtw==", + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.21.tgz", + "integrity": "sha512-9zeA+KLZNNzglF2TPKRQEDyx6Yby7daAkuy8MiPzpXPsYDWi/DRM8jmwUDxokQjYqBpv5DgPiwD4h4ZZSy1Ujw==", "dev": true, "license": "MIT", "dependencies": { @@ -1636,9 +1463,9 @@ } }, "node_modules/eslint/node_modules/brace-expansion": { - "version": "5.0.9", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz", - "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==", + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1907,9 +1734,9 @@ } }, "node_modules/globals": { - "version": "17.13.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-17.13.0.tgz", - "integrity": "sha512-RwMTC61u7hrG3ZJMkZQOK4JLJrKS8QtoTii63EmWvFXHqycY9FObBJQCbsLxSO8kjKhWE5kV1GC+Vb1g3RI0Zg==", + "version": "17.14.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-17.14.0.tgz", + "integrity": "sha512-UtdkTVyAJePQv0J2M9Xe4L0ruNSDV314XiIJsADI2Zf40bcdAonE/D/OhAU8AT99oij9mhLByb+NvA3QWZYgCg==", "dev": true, "license": "MIT", "engines": { @@ -2744,9 +2571,9 @@ } }, "node_modules/tinybench": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.2.tgz", - "integrity": "sha512-nIZ2N2dFpjBsg2hgitKu7mA+FvsIJuGJOwysRngmVRRmWgR/UyPjwJj8c/fT/dhm8EkHnF5EOogRf+0Z2qrimA==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.3.tgz", + "integrity": "sha512-Al01C2JIBnO2CXCAPbpAl6sUiOZHeThGtHYNTa51JRw9PyWOCdr+9Ong05R4qg/Sk3+H645E8ov1h2c58ityNw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index e4651c6..ac6a7f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-next2d-app", - "version": "2.5.1", + "version": "2.6.0", "description": "Create Next2D apps with no build configuration.", "author": "Toshiyuki Ienaga", "license": "MIT", @@ -14,7 +14,7 @@ "create-next2d-app" ], "scripts": { - "lint": "eslint src/index.ts", + "lint": "eslint src", "release": "tsc", "test": "vitest run --coverage" }, @@ -37,7 +37,7 @@ "@vitest/coverage-v8": "^5.0.5", "eslint": "^10.14.0", "eslint-plugin-unused-imports": "^4.4.1", - "globals": "^17.13.0", + "globals": "^17.14.0", "typescript": "^6.0.3", "vitest": "^5.0.5" } diff --git a/src/index.ts b/src/index.ts index 988447a..082696a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,6 +14,8 @@ import os from "os"; import { gte as semverGte } from "./lib/semver.js"; import spawn from "./lib/spawn.js"; import { initializeElectronConfig } from "./lib/electron-config.js"; +import { initializeXboxConfig } from "./lib/xbox-config.js"; +import { createIgnoreList, createScripts } from "./lib/project-files.js"; const recommendedVersion: number = 22; const version: string = process.versions.node; @@ -173,6 +175,9 @@ interface Packages { }, devDependencies?: { [key: string]: string + }, + scripts?: { + [key: string]: string } } @@ -245,6 +250,10 @@ const install = ( const templatePackage: Packages | void = templateJson.package; if (templatePackage) { + if (templatePackage.scripts) { + packageJson.scripts = createScripts(templatePackage.scripts); + } + const templateDependencies = templatePackage.dependencies; if (templateDependencies) { const keys: string[] = Object.keys(templateDependencies); @@ -283,6 +292,7 @@ const install = ( if (fs.existsSync(templateDir)) { fs.copySync(templateDir, root); initializeElectronConfig(root, app_name); + initializeXboxConfig(root, app_name); } else { console.error( `Could not locate supplied template: ${pc.green(templateDir)}` @@ -425,26 +435,7 @@ const createApp = ( "version": "0.0.1", "private": true, "type": "module", - "scripts": { - "start": "vite --host", - "preview:ios": "npx -y @next2d/builder --platform ios --preview", - "preview:android": "npx -y @next2d/builder --platform android --preview", - "preview:macos": "npx -y @next2d/builder --platform macos --preview", - "preview:windows": "npx -y @next2d/builder --platform windows --preview", - "preview:linux": "npx -y @next2d/builder --platform linux --preview", - "open:ios": "npx -y @next2d/builder --platform ios --open", - "open:android": "npx -y @next2d/builder --platform android --open", - "build:steam:windows": "npx -y @next2d/builder --platform steam:windows --env prd", - "build:steam:macos": "npx -y @next2d/builder --platform steam:macos --env prd", - "build:steam:linux": "npx -y @next2d/builder --platform steam:linux --env prd", - "build:steam:manifest": "npx -y @next2d/builder --env prd --steam-manifest", - "build:web": "npx -y @next2d/builder --platform web --env prd", - "build:ios": "npx -y @next2d/builder --platform ios --env prd --build", - "build:android": "npx -y @next2d/builder --platform android --env prd --build", - "build:xbox": "npx -y @next2d/builder --platform xbox --env prd", - "test": "npx vitest", - "generate": "npx -y @next2d/view-generator" - } + "scripts": createScripts() }, null, 2) + os.EOL ); @@ -465,36 +456,11 @@ const createApp = ( } } - const ignoreList: string[] = [ - "# Logs", - "logs", - "*.log", - "npm-debug.log*", - "yarn-debug.log*", - "yarn-error.log*", - "pnpm-debug.log*", - "lerna-debug.log*", - "node_modules", - "dist", - "dist-ssr", - "*.local", - "# Editor directories and files", - ".vscode/*", - "!.vscode/extensions.json", - ".idea", - ".DS_Store", - "*.suo", - "*.ntvs*", - "*.njsproj", - "*.sln", - "*.sw?", - "src/Packages.ts", - "src/config/Config.ts" - ]; + const ignoreList: string[] = createIgnoreList(); fs.writeFileSync( path.join(root, ".gitignore"), - ignoreList.join(os.EOL) + ignoreList.join(os.EOL) + os.EOL ); install(root, appName, template, ["@next2d/framework"], [ diff --git a/src/lib/colors.ts b/src/lib/colors.ts index 96ec5fc..9b16704 100644 --- a/src/lib/colors.ts +++ b/src/lib/colors.ts @@ -19,7 +19,7 @@ const isColorSupported: boolean = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || process.platform === "win32" || - ((process.stdout || {}).isTTY && env.TERM !== "dumb") || + (process.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI); const replaceClose = ( diff --git a/src/lib/project-files.ts b/src/lib/project-files.ts new file mode 100644 index 0000000..7696a17 --- /dev/null +++ b/src/lib/project-files.ts @@ -0,0 +1,87 @@ +const BUILDER: string = "npx -y @next2d/builder"; + +/** + * @description 生成するプロジェクトの npm scripts。 + * テンプレートの template.json に `package.scripts` があれば上書き・追加する。 + * npm scripts of the generated project. `package.scripts` in the + * template's template.json overrides or extends these. + * + * @param {Record} [templateScripts] + * @return {Record} + * @method + * @public + */ +export const createScripts = ( + templateScripts: Record = {} +): Record => { + return { + "start": "vite --host", + "preview:web": `${BUILDER} --platform web --env prd --preview`, + "preview:ios": `${BUILDER} --platform ios --env prd --preview`, + "preview:android": `${BUILDER} --platform android --env prd --preview`, + "preview:macos": `${BUILDER} --platform macos --env prd --preview`, + "preview:windows": `${BUILDER} --platform windows --env prd --preview`, + "preview:linux": `${BUILDER} --platform linux --env prd --preview`, + "open:ios": `${BUILDER} --platform ios --env prd --open`, + "open:android": `${BUILDER} --platform android --env prd --open`, + "open:xbox": `${BUILDER} --platform xbox --env prd --open`, + "build:web": `${BUILDER} --platform web --env prd`, + "build:ios": `${BUILDER} --platform ios --env prd --build`, + "build:android": `${BUILDER} --platform android --env prd --build`, + "build:xbox": `${BUILDER} --platform xbox --env prd`, + "build:steam:windows": `${BUILDER} --platform steam:windows --env prd`, + "build:steam:macos": `${BUILDER} --platform steam:macos --env prd`, + "build:steam:linux": `${BUILDER} --platform steam:linux --env prd`, + // builder は --steam-manifest に steam:* の --platform を必須とする (OS はどれでもよい) + "build:steam:manifest": `${BUILDER} --platform steam:macos --env prd --steam-manifest`, + "upload:steam": `${BUILDER} --steam-upload --env prd`, + "upload:steam:dry-run": `${BUILDER} --steam-upload --env prd --dry-run`, + "test": "npx vitest", + "generate": "npx -y @next2d/view-generator", + ...templateScripts + }; +}; + +/** + * @description 生成するプロジェクトの .gitignore の行。 + * npm はテンプレート内の .gitignore を公開しないため、ここで生成する。 + * Lines of the generated .gitignore. npm does not publish a + * template's .gitignore, so it is generated here. + * + * @return {string[]} + * @method + * @public + */ +export const createIgnoreList = (): string[] => { + return [ + "# Logs", + "logs", + "*.log", + "npm-debug.log*", + "yarn-debug.log*", + "yarn-error.log*", + "pnpm-debug.log*", + "lerna-debug.log*", + "node_modules", + "dist", + "dist-ssr", + "*.local", + "# Editor directories and files", + ".vscode/*", + "!.vscode/extensions.json", + ".idea", + ".DS_Store", + "*.suo", + "*.ntvs*", + "*.njsproj", + "*.sln", + "*.sw?", + "# Generated by @next2d/vite-plugin-next2d-auto-loader", + "src/Packages.ts", + "src/Packages.js", + "src/config/Config.ts", + "src/config/Config.js", + "# Xbox: C++/CMake host generated by @next2d/builder (MicrosoftGame.config is kept at the root)", + "/xbox" + ]; +}; diff --git a/src/lib/spawn.ts b/src/lib/spawn.ts index 6ccc6d9..9c8f9bd 100644 --- a/src/lib/spawn.ts +++ b/src/lib/spawn.ts @@ -24,7 +24,7 @@ const spawnFn = ( ): ChildProcess => { const opts: SpawnOptions = isWindows ? { ...options, "shell": true } - : (options ?? {}); + : options ?? {}; return nodeSpawn(command, args ?? [], opts); }; @@ -35,7 +35,7 @@ const spawnSyncFn = ( ) => { const opts: SpawnSyncOptions = isWindows ? { ...options, "shell": true } - : (options ?? {}); + : options ?? {}; return nodeSpawnSync(command, args ?? [], opts); }; diff --git a/src/lib/xbox-config.ts b/src/lib/xbox-config.ts new file mode 100644 index 0000000..dac0c13 --- /dev/null +++ b/src/lib/xbox-config.ts @@ -0,0 +1,47 @@ +import fs from "node:fs"; +import path from "node:path"; + +/** + * @description XML 属性値として安全な文字列に変換する + * Escape a string for use as an XML attribute value + * + * @param {string} value + * @return {string} + * @method + * @private + */ +const escapeXmlAttribute = (value: string): string => { + return value + .replace(/&/g, "&") + .replace(/"/g, """) + .replace(//g, ">"); +}; + +/** + * @description テンプレートコピー後、MicrosoftGame.config の表示名をプロジェクト名にする。 + * ID@Xbox 発行値 (TitleId / StoreId 等) はユーザーが置き換えるため変更しない。 + * Set the display name in MicrosoftGame.config to the project name after + * copying a template. Values issued by ID@Xbox are left for the user. + * + * @param {string} root + * @param {string} appName + * @return {void} + * @method + * @public + */ +export const initializeXboxConfig = (root: string, appName: string): void => { + const configPath = path.join(root, "MicrosoftGame.config"); + // Custom templates without Xbox support need no GDK configuration. + if (!fs.existsSync(configPath)) { + return; + } + const source = fs.readFileSync(configPath, "utf8"); + const updated = source.replace( + /(]*?\bDefaultDisplayName=")[^"]*(")/, + (_match: string, before: string, after: string): string => `${before}${escapeXmlAttribute(appName)}${after}` + ); + if (updated !== source) { + fs.writeFileSync(configPath, updated); + } +}; diff --git a/test/project-files.test.ts b/test/project-files.test.ts new file mode 100644 index 0000000..31e0695 --- /dev/null +++ b/test/project-files.test.ts @@ -0,0 +1,33 @@ +import { test, expect } from "vitest"; +import { createIgnoreList, createScripts } from "../src/lib/project-files"; + +test("every builder script selects a target and a default environment", () => { + const builderScripts = Object.entries(createScripts()) + .filter(([, command]) => command.startsWith("npx -y @next2d/builder ")); + expect(builderScripts.length).toBeGreaterThan(0); + for (const [name, command] of builderScripts) { + const args = command.split(" "); + expect(args.includes("--platform") || args.includes("--steam-upload"), name).toBe(true); + expect(args[args.indexOf("--env") + 1], name).toBe("prd"); + expect(command, name).not.toMatch(/ {2}/); + } +}); + +test("steam manifest script passes a steam platform", () => { + expect(createScripts()["build:steam:manifest"]).toContain("--platform steam:"); +}); + +test("template scripts override and extend the defaults", () => { + const scripts = createScripts({ "lint": "eslint src", "test": "vitest run" }); + expect(scripts.lint).toBe("eslint src"); + expect(scripts.test).toBe("vitest run"); + expect(scripts.start).toBe("vite --host"); +}); + +test("gitignore covers generated files of JavaScript and TypeScript templates and the Xbox host", () => { + const list = createIgnoreList(); + for (const entry of ["node_modules", "dist", "src/Packages.ts", "src/Packages.js", "src/config/Config.ts", "src/config/Config.js", "/xbox"]) { + expect(list).toContain(entry); + } + expect(list).not.toContain("MicrosoftGame.config"); +}); diff --git a/test/xbox-config.test.ts b/test/xbox-config.test.ts new file mode 100644 index 0000000..3f92f04 --- /dev/null +++ b/test/xbox-config.test.ts @@ -0,0 +1,56 @@ +import { test, expect, afterEach } from "vitest"; +import fs from "node:fs"; +import os from "node:os"; +import path from "node:path"; +import { initializeXboxConfig } from "../src/lib/xbox-config"; + +const roots: string[] = []; +const fixture = (): string => { + const root = fs.mkdtempSync(path.join(os.tmpdir(), "next2d-xbox-config-")); + roots.push(root); + return root; +}; +afterEach(() => { + for (const root of roots.splice(0)) { + fs.rmSync(root, { "recursive": true, "force": true }); + } +}); + +const CONFIG = ` + + + + 00000000 + +`; + +test("sets the display name and keeps ID@Xbox values", () => { + const root = fixture(); + const file = path.join(root, "MicrosoftGame.config"); + fs.writeFileSync(file, CONFIG); + initializeXboxConfig(root, "my-game"); + expect(fs.readFileSync(file, "utf8")).toBe(CONFIG.replace("Example-Product-Name", "my-game")); +}); + +test("escapes XML special characters in the display name", () => { + const root = fixture(); + const file = path.join(root, "MicrosoftGame.config"); + fs.writeFileSync(file, CONFIG); + initializeXboxConfig(root, "a&\""); + expect(fs.readFileSync(file, "utf8")).toContain("DefaultDisplayName=\"a&"<b>\""); +}); + +test("leaves configs without ShellVisuals unchanged", () => { + const root = fixture(); + const file = path.join(root, "MicrosoftGame.config"); + fs.writeFileSync(file, ""); + initializeXboxConfig(root, "my-game"); + expect(fs.readFileSync(file, "utf8")).toBe(""); +}); + +test("custom templates without Xbox configuration remain unchanged", () => { + const root = fixture(); + initializeXboxConfig(root, "web-game"); + expect(fs.readdirSync(root)).toEqual([]); +});