Skip to content

Commit 14bbeb3

Browse files
ark120202Perryvw
authored andcommitted
Small package-level improvements (#408)
* Replace .npmignore with files property * Add EditorConfig * Remove year from license * Swap index and tstl cli files * Replace deprecated circular-json with flatted * Change tsconfig target to es2017 Supported node version (>=8.5.0) supports it. * Replace exclude in tsconfig with include + exclude * Remove uselss files ignore pattern * Change editorconfig indent for yaml files to 2 spaces
1 parent b5dd8ef commit 14bbeb3

File tree

11 files changed

+45
-32
lines changed

11 files changed

+45
-32
lines changed

.codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ coverage:
88
threshold: null
99
base: auto
1010
changes: off
11-
patch: off
11+
patch: off

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.yml]
12+
indent_size = 2

.npmignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 [fullname]
3+
Copyright (c) [fullname]
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,13 @@
99
"tstl",
1010
"transpiler"
1111
],
12-
"main": "dist/tstl.js",
13-
"types": "dist/tstl.d.ts",
12+
"files": [
13+
"dist/**/*.js",
14+
"dist/**/*.lua",
15+
"dist/**/*.ts"
16+
],
17+
"main": "dist/index.js",
18+
"types": "dist/index.d.ts",
1419
"scripts": {
1520
"build": "tsc -p tsconfig.json && npm run build-lualib",
1621
"build-lualib": "ts-node ./build_lualib.ts",
@@ -30,7 +35,7 @@
3035
"style-check": "tslint -p . && tslint -c ./tslint.json src/lualib/*.ts"
3136
},
3237
"bin": {
33-
"tstl": "./dist/index.js"
38+
"tstl": "./dist/tstl.js"
3439
},
3540
"nyc": {
3641
"all": true,
@@ -54,10 +59,10 @@
5459
"@types/glob": "^5.0.35",
5560
"@types/node": "^9.6.23",
5661
"alsatian": "^2.3.0",
57-
"circular-json": "^0.5.5",
5862
"codecov": "3.0.2",
5963
"deep-equal": "^1.0.1",
6064
"fengari": "^0.1.2",
65+
"flatted": "^2.0.0",
6166
"glob": "^7.1.2",
6267
"nyc": "^13.3.0",
6368
"rimraf": "^2.6.3",

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#!/usr/bin/env node
2-
3-
import {compile} from "./Compiler";
4-
5-
compile(process.argv.slice(2));
1+
export {parseCommandLine} from "./CommandLineParser";
2+
export {compile, compileFilesWithOptions, transpileString, watchWithOptions} from "./Compiler";
3+
export {CompilerOptions, LuaLibImportKind, LuaTarget,} from "./CompilerOptions";
4+
export {LuaLibFeature,} from "./LuaLib";
5+
export {LuaTranspiler,} from "./LuaTranspiler";

src/tstl.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export {parseCommandLine} from "./CommandLineParser";
2-
export {compile, compileFilesWithOptions, transpileString, watchWithOptions} from "./Compiler";
3-
export {CompilerOptions, LuaLibImportKind, LuaTarget,} from "./CompilerOptions";
4-
export {LuaLibFeature,} from "./LuaLib";
5-
export {LuaTranspiler,} from "./LuaTranspiler";
1+
#!/usr/bin/env node
2+
3+
import {compile} from "./Compiler";
4+
5+
compile(process.argv.slice(2));

test/test_thread.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { MatchError, TestRunner, TestSet, TestOutcome } from "alsatian";
2-
import * as JSON from "circular-json";
2+
import * as flatted from "flatted";
33

44
module.exports = (input, done) => {
55
const testSet = TestSet.create();
@@ -12,7 +12,7 @@ module.exports = (input, done) => {
1212
testRunner.onTestComplete(result => {
1313
if (result.outcome === TestOutcome.Fail) {
1414
if (result.error instanceof MatchError) {
15-
console.log(`Test ${result.testFixture.description}, ${result.test.key}(${JSON.stringify(result.testCase.caseArguments)}) Failed!`);
15+
console.log(`Test ${result.testFixture.description}, ${result.test.key}(${flatted.stringify(result.testCase.caseArguments)}) Failed!`);
1616
console.log(" ---\n" +
1717
' message: "' +
1818
result.error.message +

test/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"experimentalDecorators": true,
44
"sourceMap": true,
5-
"target": "es6",
5+
"target": "es2017",
66
"module": "commonjs"
77
},
88
"exclude": [

0 commit comments

Comments
 (0)