mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +08:00
Remove grunt-ts dependency.
Compile code using tsconfig.json files and plain tsc invocations. Call those using grunt-shell.
This commit is contained in:
66
gruntfile.js
66
gruntfile.js
@ -321,59 +321,6 @@ module.exports = function(grunt) {
|
|||||||
dest: "<%= grunt.option('path') %>/node_modules/tns-core-modules/",
|
dest: "<%= grunt.option('path') %>/node_modules/tns-core-modules/",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ts: {
|
|
||||||
build: {
|
|
||||||
tsconfig: {
|
|
||||||
tsconfig: 'tsconfig.json',
|
|
||||||
passThrough: true,
|
|
||||||
},
|
|
||||||
outDir: localCfg.outDir,
|
|
||||||
dest: localCfg.outDir,
|
|
||||||
options: tsOptions
|
|
||||||
},
|
|
||||||
buildNodeTests: {
|
|
||||||
src: [
|
|
||||||
'tns-core-modules/js-libs/easysax/**/*.ts',
|
|
||||||
'tns-core-modules/module.d.ts',
|
|
||||||
'tns-core-modules/xml/**/*.ts',
|
|
||||||
'tns-core-modules/lib.core.d.ts',
|
|
||||||
'tns-core-modules/lib.dom.d.ts',
|
|
||||||
'tns-core-modules/es-collections.d.ts',
|
|
||||||
'tns-core-modules/declarations.d.ts',
|
|
||||||
'tns-core-modules/es6-promise.d.ts',
|
|
||||||
'node-tests/**/*.ts'
|
|
||||||
],
|
|
||||||
outDir: localCfg.outDir,
|
|
||||||
dest: localCfg.outDir,
|
|
||||||
options: tsOptions
|
|
||||||
},
|
|
||||||
buildDts: {
|
|
||||||
src: [
|
|
||||||
'tns-core-modules/**/*.d.ts',
|
|
||||||
'!org.nativescript.widgets.d.ts',
|
|
||||||
'!**/*.android.d.ts',
|
|
||||||
'!**/node_modules/**/*',
|
|
||||||
'!**/platforms/**/*',
|
|
||||||
'!bin/**/*',
|
|
||||||
'!**/references.d.ts',
|
|
||||||
'!tns-core-modules/references.d.ts',
|
|
||||||
'!tns-core-modules/android17.d.ts',
|
|
||||||
'!tns-core-modules/ios/**/*',
|
|
||||||
'!tns-core-modules/org.nativescript.widgets.d.ts',
|
|
||||||
],
|
|
||||||
outDir: localCfg.outDir,
|
|
||||||
dest: localCfg.outDir,
|
|
||||||
options: tsOptions
|
|
||||||
},
|
|
||||||
testCombinedDts: {
|
|
||||||
src: [
|
|
||||||
path.join(localCfg.outTnsCoreModules, 'tns-core-modules.d.ts'),
|
|
||||||
],
|
|
||||||
outDir: localCfg.outDir,
|
|
||||||
dest: localCfg.outDir,
|
|
||||||
options: Object.assign({}, tsOptions, { noLib: false })
|
|
||||||
}
|
|
||||||
},
|
|
||||||
tslint: {
|
tslint: {
|
||||||
build: {
|
build: {
|
||||||
files: {
|
files: {
|
||||||
@ -400,6 +347,10 @@ module.exports = function(grunt) {
|
|||||||
callback: assignGitSHA
|
callback: assignGitSHA
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
compileAll: "npm run compile-all",
|
||||||
|
compileNodeTests: "npm run compile-node-tests",
|
||||||
|
compileCheckBaseDts: "npm run compile-check-base-dts",
|
||||||
|
compileCheckCombinedDts: "npm run compile-check-combined-dts",
|
||||||
},
|
},
|
||||||
simplemocha: {
|
simplemocha: {
|
||||||
node: {
|
node: {
|
||||||
@ -431,7 +382,6 @@ module.exports = function(grunt) {
|
|||||||
|
|
||||||
grunt.loadNpmTasks("grunt-contrib-clean");
|
grunt.loadNpmTasks("grunt-contrib-clean");
|
||||||
grunt.loadNpmTasks("grunt-contrib-copy");
|
grunt.loadNpmTasks("grunt-contrib-copy");
|
||||||
grunt.loadNpmTasks("grunt-ts");
|
|
||||||
grunt.loadNpmTasks("grunt-tslint");
|
grunt.loadNpmTasks("grunt-tslint");
|
||||||
grunt.loadNpmTasks("grunt-exec");
|
grunt.loadNpmTasks("grunt-exec");
|
||||||
grunt.loadNpmTasks("grunt-shell");
|
grunt.loadNpmTasks("grunt-shell");
|
||||||
@ -446,8 +396,8 @@ module.exports = function(grunt) {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
grunt.registerTask("compile-ts", [
|
grunt.registerTask("compile-ts", [
|
||||||
"ts:buildDts",
|
"shell:compileCheckBaseDts",
|
||||||
"ts:build",
|
"shell:compileAll",
|
||||||
"clean:typeScriptLeftovers",
|
"clean:typeScriptLeftovers",
|
||||||
"copy:childPackageFiles"
|
"copy:childPackageFiles"
|
||||||
]);
|
]);
|
||||||
@ -508,12 +458,12 @@ module.exports = function(grunt) {
|
|||||||
"copy:definitionFiles",
|
"copy:definitionFiles",
|
||||||
"copy:jsLibs",
|
"copy:jsLibs",
|
||||||
"generate-tns-core-modules-dts",
|
"generate-tns-core-modules-dts",
|
||||||
"ts:testCombinedDts",
|
"shell:compileCheckCombinedDts",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
grunt.registerTask("node-tests", [
|
grunt.registerTask("node-tests", [
|
||||||
"clean:nodeTests",
|
"clean:nodeTests",
|
||||||
"ts:buildNodeTests",
|
"shell:compileNodeTests",
|
||||||
"copy:childPackageFiles",
|
"copy:childPackageFiles",
|
||||||
"copy:jsLibs",
|
"copy:jsLibs",
|
||||||
"env:nodeTests",
|
"env:nodeTests",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {assert} from "chai";
|
import {assert} from "chai";
|
||||||
import * as xmlModule from "xml";
|
//TODO: use a path mapping to the "xml" module after upgrading to TS 2.1
|
||||||
var xml: typeof xmlModule = require("../tns-core-modules/xml");
|
var xml = require("../tns-core-modules/xml");
|
||||||
|
|
||||||
describe("angular xml parser", () => {
|
describe("angular xml parser", () => {
|
||||||
let last_element = null;
|
let last_element = null;
|
||||||
@ -8,7 +8,7 @@ describe("angular xml parser", () => {
|
|||||||
let parser = null;
|
let parser = null;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
parser = new xml.XmlParser(function (event: xmlModule.ParserEvent) {
|
parser = new xml.XmlParser(function (event) {
|
||||||
switch (event.eventType) {
|
switch (event.eventType) {
|
||||||
case xml.ParserEventType.StartElement:
|
case xml.ParserEventType.StartElement:
|
||||||
last_element = event.elementName;
|
last_element = event.elementName;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {assert} from "chai";
|
import {assert} from "chai";
|
||||||
import * as xmlModule from "xml";
|
//TODO: use a path mapping to the "xml" module after upgrading to TS 2.1
|
||||||
var xml: typeof xmlModule = require("../tns-core-modules/xml");
|
var xml = require("../tns-core-modules/xml");
|
||||||
|
|
||||||
describe("xml parser", () => {
|
describe("xml parser", () => {
|
||||||
let last_element = null;
|
let last_element = null;
|
||||||
@ -9,7 +9,7 @@ describe("xml parser", () => {
|
|||||||
let parser = null;
|
let parser = null;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
parser = new xml.XmlParser(function (event: xmlModule.ParserEvent) {
|
parser = new xml.XmlParser(function (event) {
|
||||||
switch (event.eventType) {
|
switch (event.eventType) {
|
||||||
case xml.ParserEventType.StartElement:
|
case xml.ParserEventType.StartElement:
|
||||||
last_element = event.elementName;
|
last_element = event.elementName;
|
||||||
|
@ -16,13 +16,10 @@
|
|||||||
"grunt-env": "0.4.4",
|
"grunt-env": "0.4.4",
|
||||||
"grunt-exec": "1.0.1",
|
"grunt-exec": "1.0.1",
|
||||||
"grunt-mkdir": "1.0.0",
|
"grunt-mkdir": "1.0.0",
|
||||||
"grunt-multi-dest": "1.0.0",
|
|
||||||
"grunt-shell": "2.1.0",
|
"grunt-shell": "2.1.0",
|
||||||
"grunt-simple-mocha": "0.4.1",
|
"grunt-simple-mocha": "0.4.1",
|
||||||
"grunt-ts": "5.3.2",
|
|
||||||
"grunt-tslint": "4.0.0",
|
"grunt-tslint": "4.0.0",
|
||||||
"grunt-typedoc": "0.2.4",
|
"grunt-typedoc": "0.2.4",
|
||||||
"grunt-untar": "0.0.1",
|
|
||||||
"http-server": "^0.9.0",
|
"http-server": "^0.9.0",
|
||||||
"markdown-snippet-injector": "0.1.1",
|
"markdown-snippet-injector": "0.1.1",
|
||||||
"mocha": "2.2.5",
|
"mocha": "2.2.5",
|
||||||
@ -36,6 +33,10 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"setup": "npm run dev-link-tns-platform-declarations && npm run dev-link-tns-core-modules && npm run dev-link-tests && npm run dev-link-apps",
|
"setup": "npm run dev-link-tns-platform-declarations && npm run dev-link-tns-core-modules && npm run dev-link-tests && npm run dev-link-apps",
|
||||||
"tsc": "tsc",
|
"tsc": "tsc",
|
||||||
|
"compile-all": "tsc -p tsconfig.json --outDir bin/dist",
|
||||||
|
"compile-check-base-dts": "tsc -p tsconfig.base-dts.json",
|
||||||
|
"compile-node-tests": "tsc -p tsconfig.node-tests.json --outDir bin/dist/node-tests",
|
||||||
|
"compile-check-combined-dts": "tsc -p tsconfig.combined-dts.json",
|
||||||
"tsc-w": "tsc --skipLibCheck -w",
|
"tsc-w": "tsc --skipLibCheck -w",
|
||||||
"dev-tsc-tns-platform-declarations": "tsc -p tns-platform-declarations",
|
"dev-tsc-tns-platform-declarations": "tsc -p tns-platform-declarations",
|
||||||
"dev-tsc-tests": "tsc -p tests",
|
"dev-tsc-tests": "tsc -p tests",
|
||||||
|
45
tsconfig.base-dts.json
Normal file
45
tsconfig.base-dts.json
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true,
|
||||||
|
"noEmitOnError": true,
|
||||||
|
"noEmitHelpers": true,
|
||||||
|
"target": "es5",
|
||||||
|
"module": "commonjs",
|
||||||
|
"declaration": false,
|
||||||
|
"noImplicitAny": false,
|
||||||
|
"noImplicitUseStrict": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"jsx": "react",
|
||||||
|
"reactNamespace": "UIBuilder",
|
||||||
|
"lib": [
|
||||||
|
"es2016"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"tns-core-modules/**/*.d.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"tns-platform-declarations/node_modules/",
|
||||||
|
"tns-platform-declarations/package/",
|
||||||
|
"tns-core-modules/node_modules/",
|
||||||
|
"tns-core-modules/package/",
|
||||||
|
"tests/node_modules",
|
||||||
|
"tests/package/",
|
||||||
|
"tests/platforms",
|
||||||
|
"apps/node_modules",
|
||||||
|
"apps/package/",
|
||||||
|
"apps/platforms",
|
||||||
|
"node_modules/",
|
||||||
|
"package/",
|
||||||
|
"bin",
|
||||||
|
"build",
|
||||||
|
"Deploy",
|
||||||
|
"out",
|
||||||
|
"obj",
|
||||||
|
"tns-platform-declarations/references.d.ts",
|
||||||
|
"tns-core-modules/references.d.ts",
|
||||||
|
"tns-platform-declarations/ios/objc-x86_64/",
|
||||||
|
"tns-platform-declarations/android/"
|
||||||
|
]
|
||||||
|
}
|
19
tsconfig.combined-dts.json
Normal file
19
tsconfig.combined-dts.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmit": true,
|
||||||
|
"noEmitOnError": true,
|
||||||
|
"noEmitHelpers": true,
|
||||||
|
"target": "es5",
|
||||||
|
"module": "commonjs",
|
||||||
|
"declaration": false,
|
||||||
|
"noImplicitAny": false,
|
||||||
|
"noImplicitUseStrict": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"jsx": "react",
|
||||||
|
"reactNamespace": "UIBuilder"
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"bin/dist/tns-core-modules/tns-core-modules.d.ts"
|
||||||
|
]
|
||||||
|
}
|
@ -7,6 +7,7 @@
|
|||||||
"declaration": false,
|
"declaration": false,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"noImplicitUseStrict": true,
|
"noImplicitUseStrict": true,
|
||||||
|
"removeComments": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"diagnostics": true,
|
"diagnostics": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
|
28
tsconfig.node-tests.json
Normal file
28
tsconfig.node-tests.json
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"noEmitOnError": true,
|
||||||
|
"noEmitHelpers": true,
|
||||||
|
"target": "es5",
|
||||||
|
"module": "commonjs",
|
||||||
|
"declaration": false,
|
||||||
|
"noImplicitAny": false,
|
||||||
|
"noImplicitUseStrict": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"jsx": "react",
|
||||||
|
"reactNamespace": "UIBuilder",
|
||||||
|
"lib": [
|
||||||
|
"es2016"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"tns-core-modules/js-libs/easysax/**/*.ts",
|
||||||
|
"tns-core-modules/module.d.ts",
|
||||||
|
"tns-core-modules/lib.core.d.ts",
|
||||||
|
"tns-core-modules/lib.dom.d.ts",
|
||||||
|
"tns-core-modules/es-collections.d.ts",
|
||||||
|
"tns-core-modules/declarations.d.ts",
|
||||||
|
"tns-core-modules/es6-promise.d.ts",
|
||||||
|
"node-tests/**/*.ts"
|
||||||
|
]
|
||||||
|
}
|
Reference in New Issue
Block a user