Skip to content

Commit

Permalink
Simplify build
Browse files Browse the repository at this point in the history
  • Loading branch information
cursedcoder committed Aug 29, 2017
1 parent 6c93fd4 commit 89a4622
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 108 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,3 @@ dist
gh-pages
build-es6
.idea

# build temp
compilation.ts
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
language: node_js

node_js:
- "6"
- "6.1"
- "5.11"
- "7.10"
- "8.4"

cache:
yarn: true
Expand Down
24 changes: 10 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@
"prestart": "yarn cleanup",
"start": "parallelshell \"yarn watch\"",
"watch": "tsc -w",
"prebuild": "yarn cleanup && yarn concat",
"postbuild": "yarn patch-dts && yarn shx -- rm compilation.ts",
"build": "tsc -p tsconfig.compilation.json",
"prebuild": "yarn cleanup",
"build": "tsc && scripts/make_dts.js",
"docs": "jsdoc -c scripts/jsdoc.conf.json -R README.md",
"patch-dts": "node scripts/patch-dts.js",
"concat": "node scripts/concat.js",
"checkpack:browserify": "yarn checkpack -- browserify -e test/checkpack.ts",
"checkpack:webpack": "yarn checkpack -- webpack -e test/checkpack.ts",
"checkpack:vanillajs": "yarn checkpack -- vanillajs -e test/checkpack.ts",
"checkpack:all": "yarn build && yarn sandbox:browserify && yarn sandbox:webpack && yarn sandbox:vanillajs"
"check:browserify": "yarn checkpack -- browserify -e test/checkpack.ts",
"check:webpack": "yarn checkpack -- webpack -e test/checkpack.ts",
"check:vanillajs": "yarn checkpack -- vanillajs -e test/checkpack.ts",
"check:all": "yarn build && yarn check:browserify && yarn check:webpack && yarn check:vanillajs"
},
"files": [
"bin/",
Expand All @@ -44,7 +41,7 @@
"README.md"
],
"devDependencies": {
"concat-files": "~0.1.1",
"checkpack": "~0.0.1",
"del": "~2.2.0",
"glob": "~7.1.1",
"jaguarjs-jsdoc": "~1.0.1",
Expand All @@ -53,12 +50,11 @@
"parallelshell": "~2.0.0",
"pixi.js": "~4.5",
"rimraf": "~2.5.3",
"shx": "^0.2.2",
"tmp": "^0.0.33",
"ts-helpers": "~1.1.2",
"typescript": "~2.2"
"typescript": "~2.4"
},
"dependencies": {
"@types/pixi.js": "^4.5.3",
"checkpack": "^0.0.1"
"@types/pixi.js": "^4.5.3"
}
}
11 changes: 0 additions & 11 deletions scripts/concat.js

This file was deleted.

33 changes: 33 additions & 0 deletions scripts/make_dts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env node
var fs = require('fs');
var glob = require('glob');
var path = require('path');

var sourcePath = path.resolve(__dirname, '../src');
var files = glob.sync(sourcePath + '/**/*.ts');

var filesCompilation = '';

for (var i in files) {
var filePath = files[i];
var fileContents = fs.readFileSync(filePath);

filesCompilation += fileContents;
}

var tmp = require('tmp');
var process = require('child_process');

tmp.file(function (err, filename) {
fs.writeFileSync(filename, filesCompilation);

process.exec('tsc ' + filename + ' -d --removeComments', function(err, stdout, stderr) {
var dtsPath = filename.replace('.ts', '.d.ts');
var dtsContent = '' + fs.readFileSync(dtsPath);

fs.writeFileSync(
path.resolve('bin/pixi-spine.d.ts'),
dtsContent.replace(/namespace pixi_spine/g, 'module PIXI.spine')
);
});
}, {postfix: '.ts'});
14 changes: 0 additions & 14 deletions scripts/patch-dts.js

This file was deleted.

22 changes: 0 additions & 22 deletions tsconfig.compilation.json

This file was deleted.

42 changes: 22 additions & 20 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
{
"compilerOptions": {
"target": "es5",
"module": "none",
"outFile": "bin/pixi-spine-with-namespace.js",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"preserveConstEnums": true,
"removeComments": true,
"inlineSources": true,
"declaration": true,
"typeRoots": ["node_modules/@types"]
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules/**/*",
"compilation.ts",
"bin"
"compilerOptions": {
"target": "es5",
"module": "none",
"outFile": "bin/pixi-spine.js",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"preserveConstEnums": true,
"removeComments": true,
"inlineSources": true,
"declaration": false,
"typeRoots": [
"node_modules/@types"
]
},
"include": [
"src/core/**/*.ts",
"src/*.ts"
],
"exclude": [
"node_modules/**/*",
"bin"
]
}
21 changes: 0 additions & 21 deletions tsconfig.sandbox.json

This file was deleted.

0 comments on commit 89a4622

Please sign in to comment.