nativescript 8.5.1-dev.0 → 8.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/config.json +5 -0
- package/lib/.d.ts +37 -2
- package/lib/base-package-manager.js +1 -3
- package/lib/bootstrap.js +12 -1
- package/lib/commands/build.js +6 -2
- package/lib/commands/clean.js +1 -2
- package/lib/commands/config.js +5 -6
- package/lib/commands/create-project.js +11 -12
- package/lib/commands/debug.js +11 -10
- package/lib/commands/plugin/list-plugins.js +2 -3
- package/lib/commands/post-install.js +5 -3
- package/lib/commands/preview.js +3 -4
- package/lib/commands/run.js +19 -17
- package/lib/commands/test-init.js +15 -14
- package/lib/commands/test.js +3 -0
- package/lib/commands/update.js +1 -1
- package/lib/common/bootstrap.js +1 -0
- package/lib/common/child-process.js +3 -3
- package/lib/common/codeGeneration/code-printer.js +1 -1
- package/lib/common/commands/device/device-log-stream.js +1 -1
- package/lib/common/commands/device/list-devices.js +8 -7
- package/lib/common/commands/generate-messages.js +1 -1
- package/lib/common/constants.js +11 -11
- package/lib/common/declarations.d.ts +53 -1
- package/lib/common/definitions/byline.d.ts +4 -0
- package/lib/common/definitions/colors.d.ts +24 -0
- package/lib/common/definitions/commands-service.d.ts +1 -0
- package/lib/common/definitions/commands.d.ts +1 -0
- package/lib/common/definitions/google-analytics.d.ts +5 -0
- package/lib/common/definitions/marked.d.ts +125 -0
- package/lib/common/definitions/open.d.ts +5 -0
- package/lib/common/definitions/osenv.d.ts +4 -0
- package/lib/common/definitions/plist.d.ts +7 -0
- package/lib/common/definitions/rimraf.d.ts +9 -0
- package/lib/common/definitions/shelljs.d.ts +583 -0
- package/lib/common/definitions/simple-plist.d.ts +7 -0
- package/lib/common/definitions/xmlhttprequest.d.ts +29 -0
- package/lib/common/dispatchers.js +5 -0
- package/lib/common/file-system.js +22 -18
- package/lib/common/host-info.js +4 -4
- package/lib/common/http-client.js +2 -2
- package/lib/common/logger/layouts/cli-layout.js +2 -6
- package/lib/common/logger/logger.js +7 -7
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -1
- package/lib/common/mobile/android/android-log-filter.js +5 -5
- package/lib/common/mobile/android/android-virtual-device-service.js +2 -2
- package/lib/common/mobile/android/genymotion/genymotion-service.js +2 -2
- package/lib/common/mobile/android/logcat-helper.js +1 -1
- package/lib/common/mobile/device-log-provider.js +8 -8
- package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -1
- package/lib/common/mobile/mobile-helper.js +1 -1
- package/lib/common/mobile/wp8/wp8-emulator-services.js +4 -4
- package/lib/common/opener.js +1 -5
- package/lib/common/plist-parser.js +3 -3
- package/lib/common/project-helper.js +2 -2
- package/lib/common/services/analytics/google-analytics-custom-dimensions.d.ts +7 -7
- package/lib/common/services/auto-completion-service.js +2 -2
- package/lib/common/services/commands-service.js +114 -5
- package/lib/common/services/help-service.js +16 -16
- package/lib/common/services/hooks-service.js +2 -3
- package/lib/common/services/json-file-settings-service.js +3 -3
- package/lib/common/services/lock-service.js +5 -5
- package/lib/common/services/messages-service.js +6 -6
- package/lib/common/services/net-service.js +1 -1
- package/lib/common/services/project-files-manager.js +2 -2
- package/lib/common/services/settings-service.js +2 -2
- package/lib/common/test/definitions/mocha.d.ts +86 -0
- package/lib/common/validators/project-name-validator.js +1 -1
- package/lib/common/validators/validation-result.js +1 -1
- package/lib/common/verify-node-version.js +2 -2
- package/lib/config.js +8 -3
- package/lib/constants.js +32 -18
- package/lib/controllers/build-controller.js +5 -5
- package/lib/controllers/company-insights-controller.js +78 -0
- package/lib/controllers/debug-controller.js +2 -2
- package/lib/controllers/migrate-controller.js +20 -21
- package/lib/controllers/preview-app-controller.js +251 -0
- package/lib/controllers/update-controller.js +4 -5
- package/lib/declarations.d.ts +24 -0
- package/lib/definitions/build.d.ts +1 -1
- package/lib/definitions/company-insights-controller.d.ts +59 -0
- package/lib/definitions/email-validator.d.ts +8 -0
- package/lib/definitions/libnpmconfig.d.ts +3 -0
- package/lib/definitions/livesync.d.ts +10 -0
- package/lib/definitions/npm.d.ts +12 -0
- package/lib/definitions/preview-app-livesync.d.ts +116 -0
- package/lib/definitions/project.d.ts +6 -0
- package/lib/definitions/xcode.d.ts +1 -1
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +4 -15
- package/lib/device-sockets/ios/notification.js +1 -1
- package/lib/helpers/android-bundle-validator-helper.js +1 -1
- package/lib/helpers/network-connectivity-validator.js +1 -1
- package/lib/helpers/options-track-helper.js +1 -1
- package/lib/nativescript-cli.js +10 -8
- package/lib/options.js +21 -61
- package/lib/package-installation-manager.js +4 -5
- package/lib/project-data.js +10 -9
- package/lib/providers/project-files-provider.js +3 -3
- package/lib/services/analytics/analytics-broker-process.js +3 -0
- package/lib/services/analytics/analytics-broker.js +5 -5
- package/lib/services/analytics/analytics-service.js +4 -0
- package/lib/services/analytics/analytics.d.ts +8 -1
- package/lib/services/analytics/google-analytics-provider.js +21 -1
- package/lib/services/analytics-settings-service.js +11 -3
- package/lib/services/android-device-debug-service.js +3 -3
- package/lib/services/android-plugin-build-service.js +36 -3
- package/lib/services/android-resources-migration-service.js +1 -1
- package/lib/services/assets-generation/assets-generation-service.js +5 -5
- package/lib/services/{build-artifacts-service.js → build-artefacts-service.js} +4 -4
- package/lib/services/cocoapods-service.js +1 -1
- package/lib/services/device/device-install-app-service.js +3 -3
- package/lib/services/doctor-service.js +9 -10
- package/lib/services/extensibility-service.js +8 -8
- package/lib/services/ios-entitlements-service.js +1 -1
- package/lib/services/ios-project-service.js +5 -5
- package/lib/services/ios-provision-service.js +7 -7
- package/lib/services/ios-watch-app-service.js +1 -1
- package/lib/services/ip-service.js +4 -2
- package/lib/services/itmstransporter-service.js +2 -2
- package/lib/services/livesync/android-device-livesync-sockets-service.js +1 -1
- package/lib/services/livesync/android-livesync-tool.js +5 -5
- package/lib/services/livesync/ios-device-livesync-service.js +2 -2
- package/lib/services/livesync/platform-livesync-service-base.js +1 -2
- package/lib/services/livesync/playground/devices/preview-devices-service.js +67 -0
- package/lib/services/livesync/playground/preview-app-constants.js +23 -0
- package/lib/services/livesync/playground/preview-app-files-service.js +83 -0
- package/lib/services/livesync/playground/preview-app-log-provider.js +14 -0
- package/lib/services/livesync/playground/preview-app-plugins-service.js +134 -0
- package/lib/services/livesync/playground/preview-qr-code-service.js +109 -0
- package/lib/services/livesync/playground/preview-schema-service.js +57 -0
- package/lib/services/livesync/playground/preview-sdk-service.js +112 -0
- package/lib/services/log-parser-service.js +5 -1
- package/lib/services/log-source-map-service.js +7 -10
- package/lib/services/npm-config-service.js +9 -23
- package/lib/services/performance-service.js +3 -3
- package/lib/services/platform-environment-requirements.js +1 -1
- package/lib/services/playground-service.js +65 -0
- package/lib/services/plugins-service.js +19 -19
- package/lib/services/project-backup-service.js +3 -4
- package/lib/services/project-cleanup-service.js +2 -3
- package/lib/services/test-execution-service.js +2 -2
- package/lib/services/timeline-profiler-service.js +1 -4
- package/lib/services/user-settings-service.js +4 -4
- package/lib/tools/config-manipulation/config-transformer.js +3 -3
- package/lib/tools/node-modules/node-modules-builder.js +1 -1
- package/lib/xml-validator.js +47 -0
- package/package.json +90 -88
- package/vendor/gradle-plugin/build.gradle +28 -176
- package/vendor/gradle-plugin/gradle.properties +16 -1
- package/lib/color.js +0 -5
- package/node_modules/@npmcli/move-file/LICENSE.md +0 -22
- package/node_modules/@npmcli/move-file/README.md +0 -69
- package/node_modules/@npmcli/move-file/lib/index.js +0 -185
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +0 -15
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/LICENSE +0 -21
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/bin/cmd.js +0 -68
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/index.js +0 -31
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/find-made.js +0 -29
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/mkdirp-manual.js +0 -64
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/mkdirp-native.js +0 -39
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/opts-arg.js +0 -23
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/path-arg.js +0 -29
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/use-native.js +0 -10
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/package.json +0 -44
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/readme.markdown +0 -266
- package/node_modules/@npmcli/move-file/package.json +0 -47
- package/node_modules/balanced-match/.npmignore +0 -5
- package/node_modules/balanced-match/LICENSE.md +0 -21
- package/node_modules/balanced-match/README.md +0 -91
- package/node_modules/balanced-match/index.js +0 -59
- package/node_modules/balanced-match/package.json +0 -49
- package/node_modules/brace-expansion/LICENSE +0 -21
- package/node_modules/brace-expansion/README.md +0 -129
- package/node_modules/brace-expansion/index.js +0 -201
- package/node_modules/brace-expansion/package.json +0 -47
- package/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/concat-map/LICENSE +0 -18
- package/node_modules/concat-map/README.markdown +0 -62
- package/node_modules/concat-map/example/map.js +0 -6
- package/node_modules/concat-map/index.js +0 -13
- package/node_modules/concat-map/package.json +0 -43
- package/node_modules/concat-map/test/map.js +0 -39
- package/node_modules/fs.realpath/LICENSE +0 -43
- package/node_modules/fs.realpath/README.md +0 -33
- package/node_modules/fs.realpath/index.js +0 -66
- package/node_modules/fs.realpath/old.js +0 -303
- package/node_modules/fs.realpath/package.json +0 -26
- package/node_modules/inflight/LICENSE +0 -15
- package/node_modules/inflight/README.md +0 -37
- package/node_modules/inflight/inflight.js +0 -54
- package/node_modules/inflight/package.json +0 -29
- package/node_modules/inherits/LICENSE +0 -16
- package/node_modules/inherits/README.md +0 -42
- package/node_modules/inherits/inherits.js +0 -9
- package/node_modules/inherits/inherits_browser.js +0 -27
- package/node_modules/inherits/package.json +0 -29
- package/node_modules/once/LICENSE +0 -15
- package/node_modules/once/README.md +0 -79
- package/node_modules/once/once.js +0 -42
- package/node_modules/once/package.json +0 -33
- package/node_modules/path-is-absolute/index.js +0 -20
- package/node_modules/path-is-absolute/license +0 -21
- package/node_modules/path-is-absolute/package.json +0 -43
- package/node_modules/path-is-absolute/readme.md +0 -59
- package/node_modules/rimraf/CHANGELOG.md +0 -65
- package/node_modules/rimraf/LICENSE +0 -15
- package/node_modules/rimraf/README.md +0 -101
- package/node_modules/rimraf/bin.js +0 -68
- package/node_modules/rimraf/node_modules/glob/LICENSE +0 -21
- package/node_modules/rimraf/node_modules/glob/README.md +0 -378
- package/node_modules/rimraf/node_modules/glob/common.js +0 -238
- package/node_modules/rimraf/node_modules/glob/glob.js +0 -790
- package/node_modules/rimraf/node_modules/glob/package.json +0 -55
- package/node_modules/rimraf/node_modules/glob/sync.js +0 -486
- package/node_modules/rimraf/node_modules/minimatch/LICENSE +0 -15
- package/node_modules/rimraf/node_modules/minimatch/README.md +0 -230
- package/node_modules/rimraf/node_modules/minimatch/minimatch.js +0 -947
- package/node_modules/rimraf/node_modules/minimatch/package.json +0 -33
- package/node_modules/rimraf/package.json +0 -32
- package/node_modules/rimraf/rimraf.js +0 -360
- package/node_modules/stringify-package/CHANGELOG.md +0 -16
- package/node_modules/stringify-package/LICENSE +0 -13
- package/node_modules/stringify-package/README.md +0 -55
- package/node_modules/stringify-package/index.js +0 -18
- package/node_modules/stringify-package/package.json +0 -38
- package/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/wrappy/README.md +0 -36
- package/node_modules/wrappy/package.json +0 -29
- package/node_modules/wrappy/wrappy.js +0 -33
|
@@ -14,7 +14,6 @@ const _ = require("lodash");
|
|
|
14
14
|
const constants_1 = require("../constants");
|
|
15
15
|
const helpers_1 = require("../common/helpers");
|
|
16
16
|
const yok_1 = require("../common/yok");
|
|
17
|
-
const color_1 = require("../color");
|
|
18
17
|
class TestInitCommand {
|
|
19
18
|
constructor($packageManager, $projectData, $errors, $options, $prompter, $fs, $resources, $pluginsService, $logger, $testInitializationService) {
|
|
20
19
|
this.$packageManager = $packageManager;
|
|
@@ -100,11 +99,11 @@ class TestInitCommand {
|
|
|
100
99
|
let shouldCreateSampleTests = true;
|
|
101
100
|
if (this.$fs.exists(testsDir)) {
|
|
102
101
|
const specFilenamePattern = `<filename>.spec${projectFilesExtension}`;
|
|
103
|
-
bufferedLogs.push(
|
|
102
|
+
bufferedLogs.push([
|
|
104
103
|
`Note: The "${projectTestsDir}" directory already exists, will not create example tests in the project.`,
|
|
105
104
|
`You may create "${specFilenamePattern}" files anywhere you'd like.`,
|
|
106
105
|
"",
|
|
107
|
-
].join("\n"))
|
|
106
|
+
].join("\n").yellow);
|
|
108
107
|
shouldCreateSampleTests = false;
|
|
109
108
|
}
|
|
110
109
|
this.$fs.ensureDirectoryExists(testsDir);
|
|
@@ -125,40 +124,42 @@ class TestInitCommand {
|
|
|
125
124
|
if (shouldCreateSampleTests && this.$fs.exists(exampleFilePath)) {
|
|
126
125
|
this.$fs.copyFile(exampleFilePath, targetExampleTestPath);
|
|
127
126
|
const targetExampleTestRelativePath = path.relative(projectDir, targetExampleTestPath);
|
|
128
|
-
bufferedLogs.push(`Added example test: ${
|
|
127
|
+
bufferedLogs.push(`Added example test: ${targetExampleTestRelativePath.yellow}`);
|
|
129
128
|
}
|
|
130
129
|
const testMainResourcesPath = this.$resources.resolvePath(`test/test-main${projectFilesExtension}`);
|
|
131
130
|
const testMainPath = path.join(this.$projectData.appDirectoryPath, `test${projectFilesExtension}`);
|
|
132
131
|
if (!this.$fs.exists(testMainPath)) {
|
|
133
132
|
this.$fs.copyFile(testMainResourcesPath, testMainPath);
|
|
134
133
|
const testMainRelativePath = path.relative(projectDir, testMainPath);
|
|
135
|
-
bufferedLogs.push(`Main test entrypoint created: ${
|
|
134
|
+
bufferedLogs.push(`Main test entrypoint created: ${testMainRelativePath.yellow}`);
|
|
136
135
|
}
|
|
137
136
|
const testTsConfigTemplate = this.$resources.readText("test/tsconfig.spec.json");
|
|
138
137
|
const testTsConfig = _.template(testTsConfigTemplate)({
|
|
139
138
|
basePath: this.$projectData.getAppDirectoryRelativePath(),
|
|
140
139
|
});
|
|
141
140
|
this.$fs.writeFile(path.join(projectDir, "tsconfig.spec.json"), testTsConfig);
|
|
142
|
-
bufferedLogs.push(`Added/replaced ${
|
|
143
|
-
const greyDollarSign =
|
|
141
|
+
bufferedLogs.push(`Added/replaced ${"tsconfig.spec.json".yellow}`);
|
|
142
|
+
const greyDollarSign = "$".grey;
|
|
144
143
|
this.$logger.info([
|
|
145
144
|
[
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
145
|
+
`Tests using`.green,
|
|
146
|
+
frameworkToInstall.cyan,
|
|
147
|
+
`were successfully initialized.`.green,
|
|
149
148
|
].join(" "),
|
|
150
149
|
"",
|
|
151
150
|
...bufferedLogs,
|
|
152
151
|
"",
|
|
153
|
-
|
|
152
|
+
`Note: @nativescript/unit-test-runner was included in "dependencies" as a convenience to automatically adjust your app's Info.plist on iOS and AndroidManifest.xml on Android to ensure the socket connects properly.`
|
|
153
|
+
.yellow,
|
|
154
154
|
"",
|
|
155
|
-
|
|
155
|
+
`For production you may want to move to "devDependencies" and manage the settings yourself.`
|
|
156
|
+
.yellow,
|
|
156
157
|
"",
|
|
157
158
|
"",
|
|
158
159
|
`You can now run your tests:`,
|
|
159
160
|
"",
|
|
160
|
-
` ${greyDollarSign} ${
|
|
161
|
-
` ${greyDollarSign} ${
|
|
161
|
+
` ${greyDollarSign} ${"ns test ios".green}`,
|
|
162
|
+
` ${greyDollarSign} ${"ns test android".green}`,
|
|
162
163
|
"",
|
|
163
164
|
].join("\n"));
|
|
164
165
|
});
|
package/lib/commands/test.js
CHANGED
|
@@ -70,6 +70,9 @@ class TestCommandBase {
|
|
|
70
70
|
platform: this.platform,
|
|
71
71
|
projectDir: this.$projectData.projectDir,
|
|
72
72
|
options: this.$options,
|
|
73
|
+
notConfiguredEnvOptions: {
|
|
74
|
+
hideSyncToPreviewAppOption: true,
|
|
75
|
+
},
|
|
73
76
|
});
|
|
74
77
|
const canStartKarmaServer = yield this.$testExecutionService.canStartKarmaServer(this.$projectData);
|
|
75
78
|
if (!canStartKarmaServer) {
|
package/lib/commands/update.js
CHANGED
|
@@ -64,7 +64,7 @@ class UpdateCommand {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
+
exports.UpdateCommand = UpdateCommand;
|
|
67
68
|
UpdateCommand.SHOULD_MIGRATE_PROJECT_MESSAGE = 'This project is not compatible with the current NativeScript version and cannot be updated. Use "ns migrate" to make your project compatible.';
|
|
68
69
|
UpdateCommand.PROJECT_UP_TO_DATE_MESSAGE = "This project is up to date.";
|
|
69
|
-
exports.UpdateCommand = UpdateCommand;
|
|
70
70
|
yok_1.injector.registerCommand("update", UpdateCommand);
|
package/lib/common/bootstrap.js
CHANGED
|
@@ -4,6 +4,7 @@ const yok_1 = require("./yok");
|
|
|
4
4
|
const _ = require("lodash");
|
|
5
5
|
global._ = _;
|
|
6
6
|
global.$injector = yok_1.injector;
|
|
7
|
+
require("colors");
|
|
7
8
|
yok_1.injector.require("errors", "./errors");
|
|
8
9
|
yok_1.injector.requirePublic("fs", "./file-system");
|
|
9
10
|
yok_1.injector.require("hostInfo", "./host-info");
|
|
@@ -44,7 +44,7 @@ class ChildProcess extends events_1.EventEmitter {
|
|
|
44
44
|
}
|
|
45
45
|
execFile(command, args) {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
this.$logger.
|
|
47
|
+
this.$logger.debug("execFile: %s %s", command, this.getArgumentsAsQuotedString(args));
|
|
48
48
|
return new Promise((resolve, reject) => {
|
|
49
49
|
child_process.execFile(command, args, (error, stdout) => {
|
|
50
50
|
if (error) {
|
|
@@ -63,11 +63,11 @@ class ChildProcess extends events_1.EventEmitter {
|
|
|
63
63
|
const cwd = (_a = options === null || options === void 0 ? void 0 : options.cwd) !== null && _a !== void 0 ? _a : process.cwd();
|
|
64
64
|
command = (0, path_1.resolve)(cwd, command);
|
|
65
65
|
}
|
|
66
|
-
this.$logger.
|
|
66
|
+
this.$logger.debug("spawn: %s %s", command, this.getArgumentsAsQuotedString(args));
|
|
67
67
|
return child_process.spawn(command, args, options);
|
|
68
68
|
}
|
|
69
69
|
fork(modulePath, args, options) {
|
|
70
|
-
this.$logger.
|
|
70
|
+
this.$logger.debug("fork: %s %s", modulePath, this.getArgumentsAsQuotedString(args));
|
|
71
71
|
return child_process.fork(modulePath, args, options);
|
|
72
72
|
}
|
|
73
73
|
spawnFromEvent(command, args, event, options, spawnFromEventOptions) {
|
|
@@ -40,9 +40,9 @@ class CodePrinter {
|
|
|
40
40
|
return content;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
exports.CodePrinter = CodePrinter;
|
|
43
44
|
CodePrinter.INDENT_CHAR = "\t";
|
|
44
45
|
CodePrinter.NEW_LINE_CHAR = os_1.EOL;
|
|
45
46
|
CodePrinter.START_BLOCK_CHAR = " {";
|
|
46
47
|
CodePrinter.END_BLOCK_CHAR = "}";
|
|
47
|
-
exports.CodePrinter = CodePrinter;
|
|
48
48
|
yok_1.injector.register("swaggerCodePrinter", CodePrinter);
|
|
@@ -39,6 +39,6 @@ class OpenDeviceLogStreamCommand {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
OpenDeviceLogStreamCommand.NOT_SPECIFIED_DEVICE_ERROR_MESSAGE = "More than one device found. Specify device explicitly.";
|
|
43
42
|
exports.OpenDeviceLogStreamCommand = OpenDeviceLogStreamCommand;
|
|
43
|
+
OpenDeviceLogStreamCommand.NOT_SPECIFIED_DEVICE_ERROR_MESSAGE = "More than one device found. Specify device explicitly.";
|
|
44
44
|
yok_1.injector.registerCommand(["device|log", "devices|log"], OpenDeviceLogStreamCommand);
|
|
@@ -13,7 +13,6 @@ exports.ListDevicesCommand = void 0;
|
|
|
13
13
|
const helpers_1 = require("../../helpers");
|
|
14
14
|
const constants_1 = require("../../../constants");
|
|
15
15
|
const yok_1 = require("../../yok");
|
|
16
|
-
const color_1 = require("../../../color");
|
|
17
16
|
class ListDevicesCommand {
|
|
18
17
|
constructor($devicesService, $errors, $emulatorHelper, $logger, $stringParameter, $mobileHelper, $options) {
|
|
19
18
|
this.$devicesService = $devicesService;
|
|
@@ -39,10 +38,12 @@ class ListDevicesCommand {
|
|
|
39
38
|
const emulators = this.$emulatorHelper.getEmulatorsFromAvailableEmulatorsOutput(availableEmulatorsOutput);
|
|
40
39
|
devices.available = emulators;
|
|
41
40
|
if (!this.$options.json) {
|
|
42
|
-
this
|
|
43
|
-
this.printEmulators(emulators);
|
|
41
|
+
this.printEmulators("\nAvailable emulators", emulators);
|
|
44
42
|
}
|
|
45
43
|
}
|
|
44
|
+
if (!this.$options.json) {
|
|
45
|
+
this.$logger.info("\nConnected devices & emulators");
|
|
46
|
+
}
|
|
46
47
|
let index = 1;
|
|
47
48
|
yield this.$devicesService.initialize({
|
|
48
49
|
platform: args[0],
|
|
@@ -52,9 +53,6 @@ class ListDevicesCommand {
|
|
|
52
53
|
skipEmulatorStart: true,
|
|
53
54
|
fullDiscovery: true,
|
|
54
55
|
});
|
|
55
|
-
if (!this.$options.json) {
|
|
56
|
-
this.$logger.info(color_1.color.bold("\n Connected devices & emulators"));
|
|
57
|
-
}
|
|
58
56
|
const table = (0, helpers_1.createTable)([
|
|
59
57
|
"#",
|
|
60
58
|
"Device Name",
|
|
@@ -96,13 +94,15 @@ class ListDevicesCommand {
|
|
|
96
94
|
}
|
|
97
95
|
});
|
|
98
96
|
}
|
|
99
|
-
printEmulators(emulators) {
|
|
97
|
+
printEmulators(title, emulators) {
|
|
98
|
+
this.$logger.info(title);
|
|
100
99
|
const table = (0, helpers_1.createTable)([
|
|
101
100
|
"Device Name",
|
|
102
101
|
"Platform",
|
|
103
102
|
"Version",
|
|
104
103
|
"Device Identifier",
|
|
105
104
|
"Image Identifier",
|
|
105
|
+
"Error Help",
|
|
106
106
|
], []);
|
|
107
107
|
for (const info of emulators) {
|
|
108
108
|
table.push([
|
|
@@ -111,6 +111,7 @@ class ListDevicesCommand {
|
|
|
111
111
|
info.version,
|
|
112
112
|
info.identifier || "",
|
|
113
113
|
info.imageIdentifier || "",
|
|
114
|
+
info.errorHelp || "",
|
|
114
115
|
]);
|
|
115
116
|
}
|
|
116
117
|
this.$logger.info(table.toString());
|
|
@@ -39,7 +39,7 @@ class GenerateMessages {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
+
exports.GenerateMessages = GenerateMessages;
|
|
42
43
|
GenerateMessages.MESSAGES_DEFINITIONS_FILE_NAME = "messages.interface.d.ts";
|
|
43
44
|
GenerateMessages.MESSAGES_IMPLEMENTATION_FILE_NAME = "messages.ts";
|
|
44
|
-
exports.GenerateMessages = GenerateMessages;
|
|
45
45
|
yok_1.injector.registerCommand("dev-generate-messages", GenerateMessages);
|
package/lib/common/constants.js
CHANGED
|
@@ -3,17 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SOCKET_CONNECTION_TIMEOUT_MS = exports.AndroidVirtualDevice = exports.ATTACH_REQUEST_EVENT_NAME = exports.DEBUGGER_PORT_FOUND_EVENT_NAME = exports.DEFAULT_CHUNK_SIZE = exports.HttpProtocolToPort = exports.HttpStatusCodes = exports.Proxy = exports.IOS_RELAY_NOTIFICATION_COMMAND_TYPE = exports.IOS_OBSERVE_NOTIFICATION_COMMAND_TYPE = exports.IOS_POST_NOTIFICATION_COMMAND_TYPE = exports.FileExtensions = exports.TNS_CORE_MODULES = exports.NODE_MODULES_DIR_NAME = exports.Configurations = exports.TARGET_FRAMEWORK_IDENTIFIERS = exports.FAIL_LIVESYNC_LOG_REGEX = exports.IOS_APP_CRASH_LOG_REG_EXP = exports.IOS_LOG_PREDICATE = exports.DEVICE_LOG_EVENT_NAME = exports.EmulatorDiscoveryNames = exports.DeviceDiscoveryEventNames = exports.HmrConstants = exports.LiveSyncPaths = exports.APPLE_VENDOR_NAME = exports.NOT_RUNNING_EMULATOR_STATUS = exports.RUNNING_EMULATOR_STATUS = exports.CONNECTED_STATUS = exports.UNREACHABLE_STATUS = exports.ERROR_NO_VALID_SUBCOMMAND_FORMAT = exports.ERROR_CANNOT_RESOLVE_DEVICE = exports.ERROR_NO_DEVICES_CANT_USE_IOS_SIMULATOR = exports.ERROR_CANT_USE_SIMULATOR = exports.ERROR_NO_DEVICES = exports.APP_RESOURCES_FOLDER_NAME = exports.DeviceTypes = exports.ProvisionType = void 0;
|
|
4
4
|
class ProvisionType {
|
|
5
5
|
}
|
|
6
|
+
exports.ProvisionType = ProvisionType;
|
|
6
7
|
ProvisionType.Development = "Development";
|
|
7
8
|
ProvisionType.AdHoc = "AdHoc";
|
|
8
9
|
ProvisionType.AppStore = "AppStore";
|
|
9
10
|
ProvisionType.Enterprise = "Enterprise";
|
|
10
|
-
exports.ProvisionType = ProvisionType;
|
|
11
11
|
class DeviceTypes {
|
|
12
12
|
}
|
|
13
|
+
exports.DeviceTypes = DeviceTypes;
|
|
13
14
|
DeviceTypes.Emulator = "Emulator";
|
|
14
15
|
DeviceTypes.Simulator = "Simulator";
|
|
15
16
|
DeviceTypes.Device = "Device";
|
|
16
|
-
exports.DeviceTypes = DeviceTypes;
|
|
17
17
|
exports.APP_RESOURCES_FOLDER_NAME = "App_Resources";
|
|
18
18
|
exports.ERROR_NO_DEVICES = "Cannot find connected devices. Reconnect any connected devices, verify that your system recognizes them, and run this command again.";
|
|
19
19
|
exports.ERROR_CANT_USE_SIMULATOR = "You can use iOS simulator only on OS X.";
|
|
@@ -27,29 +27,29 @@ exports.NOT_RUNNING_EMULATOR_STATUS = "Not running";
|
|
|
27
27
|
exports.APPLE_VENDOR_NAME = "Apple";
|
|
28
28
|
class LiveSyncPaths {
|
|
29
29
|
}
|
|
30
|
+
exports.LiveSyncPaths = LiveSyncPaths;
|
|
30
31
|
LiveSyncPaths.SYNC_DIR_NAME = "sync";
|
|
31
32
|
LiveSyncPaths.REMOVEDSYNC_DIR_NAME = "removedsync";
|
|
32
33
|
LiveSyncPaths.FULLSYNC_DIR_NAME = "fullsync";
|
|
33
34
|
LiveSyncPaths.IOS_DEVICE_PROJECT_ROOT_PATH = "Library/Application Support/LiveSync";
|
|
34
35
|
LiveSyncPaths.IOS_DEVICE_SYNC_ZIP_PATH = "Library/Application Support/LiveSync/sync.zip";
|
|
35
36
|
LiveSyncPaths.ANDROID_TMP_DIR_NAME = "/data/local/tmp";
|
|
36
|
-
exports.LiveSyncPaths = LiveSyncPaths;
|
|
37
37
|
class HmrConstants {
|
|
38
38
|
}
|
|
39
|
+
exports.HmrConstants = HmrConstants;
|
|
39
40
|
HmrConstants.HMR_ERROR_STATUS = 3;
|
|
40
41
|
HmrConstants.HMR_SUCCESS_STATUS = 2;
|
|
41
|
-
exports.HmrConstants = HmrConstants;
|
|
42
42
|
class DeviceDiscoveryEventNames {
|
|
43
43
|
}
|
|
44
|
+
exports.DeviceDiscoveryEventNames = DeviceDiscoveryEventNames;
|
|
44
45
|
DeviceDiscoveryEventNames.DEVICE_FOUND = "deviceFound";
|
|
45
46
|
DeviceDiscoveryEventNames.DEVICE_UPDATED = "deviceUpdated";
|
|
46
47
|
DeviceDiscoveryEventNames.DEVICE_LOST = "deviceLost";
|
|
47
|
-
exports.DeviceDiscoveryEventNames = DeviceDiscoveryEventNames;
|
|
48
48
|
class EmulatorDiscoveryNames {
|
|
49
49
|
}
|
|
50
|
+
exports.EmulatorDiscoveryNames = EmulatorDiscoveryNames;
|
|
50
51
|
EmulatorDiscoveryNames.EMULATOR_IMAGE_FOUND = "emulatorImageFound";
|
|
51
52
|
EmulatorDiscoveryNames.EMULATOR_IMAGE_LOST = "emulatorImageLost";
|
|
52
|
-
exports.EmulatorDiscoveryNames = EmulatorDiscoveryNames;
|
|
53
53
|
exports.DEVICE_LOG_EVENT_NAME = "deviceLogData";
|
|
54
54
|
exports.IOS_LOG_PREDICATE = 'senderImagePath contains "NativeScript"';
|
|
55
55
|
exports.IOS_APP_CRASH_LOG_REG_EXP = /Fatal JavaScript exception \- application has been terminated/;
|
|
@@ -60,36 +60,36 @@ exports.TARGET_FRAMEWORK_IDENTIFIERS = {
|
|
|
60
60
|
};
|
|
61
61
|
class Configurations {
|
|
62
62
|
}
|
|
63
|
+
exports.Configurations = Configurations;
|
|
63
64
|
Configurations.Debug = "Debug";
|
|
64
65
|
Configurations.Release = "Release";
|
|
65
|
-
exports.Configurations = Configurations;
|
|
66
66
|
exports.NODE_MODULES_DIR_NAME = "node_modules";
|
|
67
67
|
exports.TNS_CORE_MODULES = "tns-core-modules";
|
|
68
68
|
class FileExtensions {
|
|
69
69
|
}
|
|
70
|
+
exports.FileExtensions = FileExtensions;
|
|
70
71
|
FileExtensions.TYPESCRIPT_DEFINITION_FILE = ".d.ts";
|
|
71
72
|
FileExtensions.TYPESCRIPT_FILE = ".ts";
|
|
72
73
|
FileExtensions.PNG_FILE = ".png";
|
|
73
74
|
FileExtensions.NINE_PATCH_PNG_FILE = ".9.png";
|
|
74
|
-
exports.FileExtensions = FileExtensions;
|
|
75
75
|
exports.IOS_POST_NOTIFICATION_COMMAND_TYPE = "PostNotification";
|
|
76
76
|
exports.IOS_OBSERVE_NOTIFICATION_COMMAND_TYPE = "ObserveNotification";
|
|
77
77
|
exports.IOS_RELAY_NOTIFICATION_COMMAND_TYPE = "RelayNotification";
|
|
78
78
|
class Proxy {
|
|
79
79
|
}
|
|
80
|
+
exports.Proxy = Proxy;
|
|
80
81
|
Proxy.CACHE_FILE_NAME = "proxy-cache.json";
|
|
81
82
|
Proxy.USE_PROXY = "USE_PROXY";
|
|
82
83
|
Proxy.PROXY_PORT = "PROXY_PORT";
|
|
83
84
|
Proxy.PROXY_HOSTNAME = "PROXY_HOSTNAME";
|
|
84
|
-
exports.Proxy = Proxy;
|
|
85
85
|
class HttpStatusCodes {
|
|
86
86
|
}
|
|
87
|
+
exports.HttpStatusCodes = HttpStatusCodes;
|
|
87
88
|
HttpStatusCodes.SEE_OTHER = 303;
|
|
88
89
|
HttpStatusCodes.NOT_MODIFIED = 304;
|
|
89
90
|
HttpStatusCodes.PAYMENT_REQUIRED = 402;
|
|
90
91
|
HttpStatusCodes.PROXY_AUTHENTICATION_REQUIRED = 407;
|
|
91
92
|
HttpStatusCodes.CONFLICTING_RESOURCE = 409;
|
|
92
|
-
exports.HttpStatusCodes = HttpStatusCodes;
|
|
93
93
|
exports.HttpProtocolToPort = {
|
|
94
94
|
"http:": 80,
|
|
95
95
|
"https:": 443,
|
|
@@ -99,6 +99,7 @@ exports.DEBUGGER_PORT_FOUND_EVENT_NAME = "DEBUGGER_PORT_FOUND";
|
|
|
99
99
|
exports.ATTACH_REQUEST_EVENT_NAME = "ATTACH_REQUEST";
|
|
100
100
|
class AndroidVirtualDevice {
|
|
101
101
|
}
|
|
102
|
+
exports.AndroidVirtualDevice = AndroidVirtualDevice;
|
|
102
103
|
AndroidVirtualDevice.ANDROID_DIR_NAME = ".android";
|
|
103
104
|
AndroidVirtualDevice.AVD_DIR_NAME = "avd";
|
|
104
105
|
AndroidVirtualDevice.ENCODING_MASK = /^avd\.ini\.encoding=(.*)$/;
|
|
@@ -118,5 +119,4 @@ AndroidVirtualDevice.AVD_VENDOR_NAME = "Avd";
|
|
|
118
119
|
AndroidVirtualDevice.TIMEOUT_SECONDS = 120;
|
|
119
120
|
AndroidVirtualDevice.GENYMOTION_DEFAULT_STDERR_STRING = "Logging activities to file";
|
|
120
121
|
AndroidVirtualDevice.UNABLE_TO_START_EMULATOR_MESSAGE = "Cannot run the app in the selected native emulator. Try to restart the adb server by running the `adb kill-server` command in the Command Prompt, or increase the allocated RAM of the virtual device through the Android Virtual Device manager. NativeScript CLI users can try to increase the timeout of the operation by adding the `--timeout` flag.";
|
|
121
|
-
exports.AndroidVirtualDevice = AndroidVirtualDevice;
|
|
122
122
|
exports.SOCKET_CONNECTION_TIMEOUT_MS = 30000;
|
|
@@ -217,6 +217,11 @@ declare const enum TrackingTypes {
|
|
|
217
217
|
*/
|
|
218
218
|
GoogleAnalyticsData = "googleAnalyticsData",
|
|
219
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Defines that the broker process should get and track the data from preview app to Google Analytics
|
|
222
|
+
*/
|
|
223
|
+
PreviewAppData = "PreviewAppData",
|
|
224
|
+
|
|
220
225
|
/**
|
|
221
226
|
* Defines that the broker process should send all the pending information to Analytics.
|
|
222
227
|
* After that the process should send information it has finished tracking and die gracefully.
|
|
@@ -550,7 +555,7 @@ interface IFileSystem {
|
|
|
550
555
|
*/
|
|
551
556
|
getFileShasum(
|
|
552
557
|
fileName: string,
|
|
553
|
-
options?: { algorithm?: string; encoding?: "hex" | "base64" }
|
|
558
|
+
options?: { algorithm?: string; encoding?: "latin1" | "hex" | "base64" }
|
|
554
559
|
): Promise<string>;
|
|
555
560
|
|
|
556
561
|
// shell.js wrappers
|
|
@@ -668,6 +673,7 @@ interface IFutureDispatcher {
|
|
|
668
673
|
|
|
669
674
|
interface ICommandDispatcher {
|
|
670
675
|
dispatchCommand(): Promise<void>;
|
|
676
|
+
completeCommand(): Promise<boolean>;
|
|
671
677
|
}
|
|
672
678
|
|
|
673
679
|
interface ICancellationService extends IDisposable {
|
|
@@ -802,6 +808,11 @@ interface IAnalyticsService {
|
|
|
802
808
|
*/
|
|
803
809
|
trackEventActionInGoogleAnalytics(data: IEventActionData): Promise<void>;
|
|
804
810
|
|
|
811
|
+
/**
|
|
812
|
+
* Tracks preview's app data to Google Analytics project.
|
|
813
|
+
*/
|
|
814
|
+
trackPreviewAppData(platform: string, projectDir: string): Promise<void>;
|
|
815
|
+
|
|
805
816
|
/**
|
|
806
817
|
* Defines if the instance should be disposed.
|
|
807
818
|
* @param {boolean} shouldDispose Defines if the instance should be disposed and the child processes should be disconnected.
|
|
@@ -867,6 +878,37 @@ interface IAnalyticsSettingsService {
|
|
|
867
878
|
* @returns {string} The user agent string.
|
|
868
879
|
*/
|
|
869
880
|
getUserAgentString(identifier: string): string;
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* Gets information for projects that are exported from playground
|
|
884
|
+
* @param projectDir Project directory path
|
|
885
|
+
*/
|
|
886
|
+
getPlaygroundInfo(projectDir?: string): Promise<IPlaygroundInfo>;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* Designed for getting information for projects that are exported from playground.
|
|
891
|
+
*/
|
|
892
|
+
interface IPlaygroundService {
|
|
893
|
+
/**
|
|
894
|
+
* Gets information for projects that are exported from playground
|
|
895
|
+
* @return {Promise<IPlaygroundInfo>} collected info
|
|
896
|
+
* @param projectDir Project directory path
|
|
897
|
+
*/
|
|
898
|
+
getPlaygroundInfo(projectDir?: string): Promise<IPlaygroundInfo>;
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
* Describes information about project that is exported from playground.
|
|
902
|
+
*/
|
|
903
|
+
interface IPlaygroundInfo {
|
|
904
|
+
/**
|
|
905
|
+
* The unique client identifier
|
|
906
|
+
*/
|
|
907
|
+
id: string;
|
|
908
|
+
/**
|
|
909
|
+
* Whether the user comes from tutorial page. Can be true or false
|
|
910
|
+
*/
|
|
911
|
+
usedTutorial: boolean;
|
|
870
912
|
}
|
|
871
913
|
|
|
872
914
|
interface IAutoCompletionService {
|
|
@@ -1690,6 +1732,16 @@ interface IiOSNotificationService {
|
|
|
1690
1732
|
): Promise<number>;
|
|
1691
1733
|
}
|
|
1692
1734
|
|
|
1735
|
+
// declare module "stringify-package" {
|
|
1736
|
+
// function stringifyPackage(data: any, indent: any, newline: string): string
|
|
1737
|
+
// export = stringifyPackage
|
|
1738
|
+
// }
|
|
1739
|
+
|
|
1740
|
+
// declare module "detect-newline" {
|
|
1741
|
+
// function detectNewline(data: string): string | null;
|
|
1742
|
+
// export = detectNewline
|
|
1743
|
+
// }
|
|
1744
|
+
|
|
1693
1745
|
/**
|
|
1694
1746
|
* Describes information for application.
|
|
1695
1747
|
*/
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare module "colors" {
|
|
2
|
+
export function setTheme(theme: any): void;
|
|
3
|
+
export function addSequencer(name: string, callback: Function): void;
|
|
4
|
+
|
|
5
|
+
// none, browser, console
|
|
6
|
+
export var mode: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
interface String {
|
|
10
|
+
// In ES6 there's a method called `bold` in String interface.
|
|
11
|
+
// bold: String;
|
|
12
|
+
italic: String;
|
|
13
|
+
underline: String;
|
|
14
|
+
inverse: String;
|
|
15
|
+
white: String;
|
|
16
|
+
grey: String;
|
|
17
|
+
black: String;
|
|
18
|
+
blue: String;
|
|
19
|
+
cyan: String;
|
|
20
|
+
green: String;
|
|
21
|
+
magenta: String;
|
|
22
|
+
red: String;
|
|
23
|
+
yellow: String;
|
|
24
|
+
}
|
|
@@ -15,6 +15,11 @@ interface IGoogleAnalyticsData {
|
|
|
15
15
|
customDimensions?: IStringDictionary;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
interface IPreviewAppGoogleAnalyticsData {
|
|
19
|
+
platform: string;
|
|
20
|
+
additionalData?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
/**
|
|
19
24
|
* Describes information about event that should be tracked.
|
|
20
25
|
*/
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// Type definitions for Marked
|
|
2
|
+
// Project: https://github.com/chjj/marked
|
|
3
|
+
// Definitions by: William Orr <https://github.com/worr>
|
|
4
|
+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
|
5
|
+
|
|
6
|
+
interface MarkedStatic {
|
|
7
|
+
/**
|
|
8
|
+
* Compiles markdown to HTML.
|
|
9
|
+
*
|
|
10
|
+
* @param src String of markdown source to be compiled
|
|
11
|
+
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
|
|
12
|
+
* @return String of compiled HTML
|
|
13
|
+
*/
|
|
14
|
+
(src: string, callback?: Function): string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Compiles markdown to HTML.
|
|
18
|
+
*
|
|
19
|
+
* @param src String of markdown source to be compiled
|
|
20
|
+
* @param options Hash of options
|
|
21
|
+
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
|
|
22
|
+
* @return String of compiled HTML
|
|
23
|
+
*/
|
|
24
|
+
(src: string, options?: MarkedOptions, callback?: Function): string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param src String of markdown source to be compiled
|
|
28
|
+
* @param options Hash of options
|
|
29
|
+
*/
|
|
30
|
+
lexer(src: string, options?: MarkedOptions): any[];
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Compiles markdown to HTML.
|
|
34
|
+
*
|
|
35
|
+
* @param src String of markdown source to be compiled
|
|
36
|
+
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
|
|
37
|
+
* @return String of compiled HTML
|
|
38
|
+
*/
|
|
39
|
+
parse(src: string, callback: Function): string;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Compiles markdown to HTML.
|
|
43
|
+
*
|
|
44
|
+
* @param src String of markdown source to be compiled
|
|
45
|
+
* @param options Hash of options
|
|
46
|
+
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
|
|
47
|
+
* @return String of compiled HTML
|
|
48
|
+
*/
|
|
49
|
+
parse(src: string, options?: MarkedOptions, callback?: Function): string;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param options Hash of options
|
|
53
|
+
*/
|
|
54
|
+
parser(src: any[], options?: MarkedOptions): string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Sets the default options.
|
|
58
|
+
*
|
|
59
|
+
* @param options Hash of options
|
|
60
|
+
*/
|
|
61
|
+
setOptions(options: MarkedOptions): void;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface MarkedOptions {
|
|
65
|
+
/**
|
|
66
|
+
* Enable GitHub flavored markdown.
|
|
67
|
+
*/
|
|
68
|
+
gfm?: boolean;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Enable GFM tables. This option requires the gfm option to be true.
|
|
72
|
+
*/
|
|
73
|
+
tables?: boolean;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Enable GFM line breaks. This option requires the gfm option to be true.
|
|
77
|
+
*/
|
|
78
|
+
breaks?: boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
|
|
82
|
+
*/
|
|
83
|
+
pedantic?: boolean;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Sanitize the output. Ignore any HTML that has been input.
|
|
87
|
+
*/
|
|
88
|
+
sanitize?: boolean;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.
|
|
92
|
+
*/
|
|
93
|
+
smartLists?: boolean;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Shows an HTML error message when rendering fails.
|
|
97
|
+
*/
|
|
98
|
+
silent?: boolean;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* A function to highlight code blocks. The function takes three arguments: code, lang, and callback.
|
|
102
|
+
*/
|
|
103
|
+
highlight?(code: string, lang: string, callback?: Function): string;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Set the prefix for code block classes.
|
|
107
|
+
*/
|
|
108
|
+
langPrefix?: string;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Use "smart" typograhic punctuation for things like quotes and dashes.
|
|
112
|
+
*/
|
|
113
|
+
smartypants?: boolean;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* An object containing functions to render tokens to HTML.
|
|
117
|
+
*/
|
|
118
|
+
renderer?: any;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
declare module "marked" {
|
|
122
|
+
export = marked;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare var marked: MarkedStatic;
|