Skip to content

Commit

Permalink
starting 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanpopelyshev committed Aug 3, 2022
1 parent 948f15c commit d6100e6
Show file tree
Hide file tree
Showing 66 changed files with 9,919 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bundles/all-4.0/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pixi-spine/all-4.0",
"version": "3.0.16",
"description": "Pixi integration with EsotericSoftware Spine, big, contains runtime for 3.8",
"description": "Pixi integration with EsotericSoftware Spine, big, contains runtime for 4.0",
"main": "lib/all-4.0.js",
"module": "lib/all-4.0.es.js",
"bundle": "dist/pixi-spine-4.0.umd.js",
Expand Down
5 changes: 5 additions & 0 deletions bundles/all-4.1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# pixi-spine

Spine 4.1 implementation for PixiJS v6.

Please open the github repo to get more information.
26 changes: 26 additions & 0 deletions bundles/all-4.1/SPINE-LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Spine Runtimes License Agreement
Last updated January 1, 2020. Replaces all prior versions.

Copyright (c) 2013-2020, Esoteric Software LLC

Integration of the Spine Runtimes into software or otherwise creating
derivative works of the Spine Runtimes is permitted under the terms and
conditions of Section 2 of the Spine Editor License Agreement:
http://esotericsoftware.com/spine-editor-license

Otherwise, it is permitted to integrate the Spine Runtimes into software
or otherwise create derivative works of the Spine Runtimes (collectively,
"Products"), provided that each user of the Products must obtain their own
Spine Editor license and redistribution of the Products in any form must
include this license and copyright notice.

THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,
BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THE SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 changes: 40 additions & 0 deletions bundles/all-4.1/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/compile/index.d.ts",
"bundledPackages": [
"pixi-spine"
],
"compiler": {
"tsconfigFilePath": "<projectFolder>/tsconfig-api.json"
},
"apiReport": {
"enabled": false
},
"docModel": {
"enabled": false
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "<projectFolder>/index.d.ts"
},
"tsdocMetadata": {
"enabled": false
},
"messages": {
"compilerMessageReporting": {
"default": {
"logLevel": "warning"
}
},
"extractorMessageReporting": {
"default": {
"logLevel": "warning"
}
},
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
}
}
}
60 changes: 60 additions & 0 deletions bundles/all-4.1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "@pixi-spine/all-4.1",
"version": "3.0.16",
"description": "Pixi integration with EsotericSoftware Spine, big, contains runtime for 4.1",
"main": "lib/all-4.1.js",
"module": "lib/all-4.1.es.js",
"bundle": "dist/pixi-spine-4.1.umd.js",
"types": "./index.d.ts",
"namespace": "PIXI.spine",
"dependencies": {
"@pixi-spine/base": "~3.0.16",
"@pixi-spine/loader-4.1": "~3.0.16",
"@pixi-spine/loader-base": "~3.0.16",
"@pixi-spine/runtime-4.1": "~3.0.16"
},
"scripts": {
"build": "rollup -c rollup.config.js --silent",
"build:types": "rimraf compile && tsc -p tsconfig-api.json && api-extractor run"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pixijs/pixi-spine.git"
},
"files": [
"lib",
"dist",
"*.d.ts",
"SPINE-LICENSE"
],
"keywords": [
"pixi.js",
"pixi",
"spine",
"SPINE-LICENSE"
],
"author": "Ivan Igorevich Popelyshev <[email protected]>",
"contributors": [
"Mat Groves",
"Chad Engler <[email protected]>",
"Richard Davey <[email protected]>",
"Shukant K. Pal <[email protected]>",
"Yevhenii Huselietov <[email protected]>"
],
"bugs": {
"url": "https://github.com/pixijs/pixi-spine/issues"
},
"license": "SEE SPINE-LICENSE",
"homepage": "https://github.com/pixijs/pixi-spine/#readme",
"devDependencies": {
"@pixi-spine/eslint-config": "~1.0.0",
"@pixi-spine/rollup-config": "~1.0.0",
"chai": "~4.2.0",
"eslint": "~7.13.0",
"prepend": "=1.0.2",
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.3.0"
}
}
31 changes: 31 additions & 0 deletions bundles/all-4.1/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const { main } = require('@pixi-spine/rollup-config/main');

const results = main({
globals: {
'@pixi-spine/base': 'PIXI.spine',
'@pixi-spine/runtime-4.0': 'PIXI.spine40',
'@pixi-spine/loader-base': 'PIXI.spine',
'@pixi-spine/loader-4.0': 'PIXI.spine',
},
});

// TODO: get sorted deps of all our @pixi-spine deps

const umdDeps = ['@pixi/app', '@pixi/constants', '@pixi/core', '@pixi/display', '@pixi/graphics',
'@pixi/loaders', '@pixi/math', '@pixi/mesh-extras', '@pixi/sprite', '@pixi/utils'];

const license1 = 'is licensed under the MIT License.\n * http://www.opensource.org/licenses/mit-license';
const licenseSpine = 'is licensed under SPINE-LICENSE\n * http://esotericsoftware.com/spine-runtimes-license';

results.forEach((entry) => {
if (entry.output.banner) {
entry.output.banner = entry.output.banner.replace(license1, licenseSpine);
}
if (entry.output.format === 'umd') {
entry.external = entry.external.filter((moduleName) => {
return moduleName.indexOf('@pixi-spine') !== 0;
}).concat(umdDeps);
}
})

module.exports = results;
6 changes: 6 additions & 0 deletions bundles/all-4.1/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {SpineParser} from '@pixi-spine/loader-4.1';
export {SpineParser};
export * from '@pixi-spine/runtime-4.1';
export * from '@pixi-spine/base';

SpineParser.registerLoaderPlugin();
15 changes: 15 additions & 0 deletions bundles/all-4.1/tsconfig-api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "compile",
"declaration": true,
"declarationMap": true,
"skipLibCheck": true
},
"include": [
"src/*.ts"
],
"exclude": [
"node_modules"
]
}
18 changes: 18 additions & 0 deletions bundles/all-4.1/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "compile",
"baseUrl": "./",
"paths": {
"@pixi-spine/*": [
"packages/*/src"
]
}
},
"include": [
"src/*.ts"
],
"exclude": [
"node_modules"
]
}
40 changes: 40 additions & 0 deletions packages/loader-4.1/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "<projectFolder>/compile/index.d.ts",
"bundledPackages": [
"@pixi-spine/loader-4.0"
],
"compiler": {
"tsconfigFilePath": "<projectFolder>/tsconfig-api.json"
},
"apiReport": {
"enabled": false
},
"docModel": {
"enabled": false
},
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "<projectFolder>/index.d.ts"
},
"tsdocMetadata": {
"enabled": false
},
"messages": {
"compilerMessageReporting": {
"default": {
"logLevel": "warning"
}
},
"extractorMessageReporting": {
"default": {
"logLevel": "warning"
}
},
"tsdocMessageReporting": {
"default": {
"logLevel": "none"
}
}
}
}
6 changes: 6 additions & 0 deletions packages/loader-4.1/global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
declare namespace GlobalMixins
{
interface LoaderResource {
spineData?: import('@pixi-spine/runtime-4.0').SkeletonData;
}
}
56 changes: 56 additions & 0 deletions packages/loader-4.1/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "@pixi-spine/loader-4.1",
"version": "3.0.16",
"description": "Pixi loader middleware for spine 4.1 models",
"main": "lib/loader-4.1.js",
"module": "lib/loader-4.1.es.js",
"bundle": "dist/loader-4.1.js",
"types": "./index.d.ts",
"namespace": "PIXI.spine",
"peerDependencies": {
"@pixi/app": "^6.1.0",
"@pixi/core": "^6.1.0",
"@pixi/display": "^6.1.0",
"@pixi/loaders": "^6.1.0",
"resource-loader": "~3.0.1"
},
"dependencies": {
"@pixi-spine/base": "~3.0.16",
"@pixi-spine/loader-base": "~3.0.16",
"@pixi-spine/runtime-4.0": "~3.0.16"
},
"scripts": {
"build": "rollup -c rollup.config.js --silent",
"build:types": "rimraf compile && tsc -p tsconfig-api.json && api-extractor run && node scripts/injectGlobalMixins"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pixijs/pixi-spine.git"
},
"files": [
"lib",
"dist",
"*.d.ts"
],
"keywords": [
"pixi.js",
"pixi",
"spine"
],
"author": "Ivan Igorevich Popelyshev <[email protected]>",
"bugs": {
"url": "https://github.com/pixijs/pixi-spine/issues"
},
"homepage": "https://github.com/pixijs/pixi-spine/#readme",
"devDependencies": {
"@pixi-spine/eslint-config": "~1.0.0",
"@pixi-spine/rollup-config": "~1.0.0",
"chai": "~4.2.0",
"eslint": "~7.13.0",
"prepend": "=1.0.2",
"rimraf": "3.0.2",
"rollup": "^2.53.3",
"tslib": "~2.2.0",
"typescript": "~4.3.0"
}
}
9 changes: 9 additions & 0 deletions packages/loader-4.1/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const {main} = require('@pixi-spine/rollup-config/main');

module.exports = main({
globals: {
'@pixi-spine/base': 'PIXI.spine.base',
'@pixi-spine/runtime-3.8': 'PIXI.spine',
'@pixi-spine/loader-base': 'PIXI.spine',
},
});
7 changes: 7 additions & 0 deletions packages/loader-4.1/scripts/injectGlobalMixins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var prepend = require('prepend');

prepend('index.d.ts', '/// <reference path="./global.d.ts" />\n', function(error) {
if (error)
console.error(error.message);
});

32 changes: 32 additions & 0 deletions packages/loader-4.1/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/// <reference path="../global.d.ts" />
import {AbstractSpineParser} from '@pixi-spine/loader-base';
import {ISkeletonParser, TextureAtlas} from '@pixi-spine/base';
import {LoaderResource, Loader} from "@pixi/loaders";
import {AtlasAttachmentLoader, SkeletonBinary, SkeletonJson} from "@pixi-spine/runtime-4.1";

/**
* @public
*/
export class SpineParser extends AbstractSpineParser {
createBinaryParser(): ISkeletonParser {
return new SkeletonBinary(null);
}

createJsonParser(): ISkeletonParser {
return new SkeletonJson(null);
}

parseData(resource: LoaderResource, parser: ISkeletonParser, atlas: TextureAtlas, dataToParse: any): void {
const parserCast = parser as SkeletonBinary | SkeletonJson;

parserCast.attachmentLoader = new AtlasAttachmentLoader(atlas);
resource.spineData = parserCast.readSkeletonData(dataToParse);
resource.spineAtlas = atlas;
}

static use = new SpineParser().genMiddleware().use;

static registerLoaderPlugin() {
Loader.registerPlugin(SpineParser);
}
}
14 changes: 14 additions & 0 deletions packages/loader-4.1/tsconfig-api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "compile",
"declaration": true,
"declarationMap": true
},
"include": [
"src/*.ts"
],
"exclude": [
"node_modules"
]
}
Loading

0 comments on commit d6100e6

Please sign in to comment.