typescript: Move TS files into JS directory.

This is just a code reorganization to avoid making it difficult to
find things as we migrate more file to TypeScript.
This commit is contained in:
Thomas Ip 2019-03-24 15:37:53 +08:00 committed by Tim Abbott
parent 9ed1dcc4b6
commit a2872c107e
31 changed files with 31 additions and 38 deletions

View File

@ -1,7 +1,7 @@
require('ts-node').register({
project: 'static/ts/tsconfig.json',
project: 'static/js/tsconfig.json',
compilerOptions: {
typeRoots: ["node_modules/@types", "../../static/ts/js_typings"],
typeRoots: ["node_modules/@types", "../../static/js/js_typings"],
// We don't have webpack to handle es6 modules here so directly
// transpile to CommonJS format.
module: "commonjs",
@ -27,7 +27,7 @@ global.window = _.extend({}, windowObj, {
},
});
global.Dict = require('ts/dict.ts').Dict;
global.Dict = require('js/dict').Dict;
// Create a helper function to avoid sneaky delays in tests.
function immediate(f) {

View File

@ -20,19 +20,12 @@ exports.patch_builtin = function (name, val) {
};
exports.zrequire = function (name, fn) {
var path;
if (fn === undefined) {
try {
path = require.resolve('js/' + name);
} catch (_e /* MODULE_NOT_FOUND */) {
path = require.resolve('ts/' + name);
}
} else {
path = require.resolve(fn);
fn = 'js/' + name;
}
delete require.cache[path];
var obj = require(path);
requires.push(path);
delete require.cache[require.resolve(fn)];
var obj = require(fn);
requires.push(fn);
set_global(name, obj);
return obj;
};

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var activity = (function () {
var exports = {};

View File

@ -37,7 +37,7 @@ import "js/search_util.js";
import "js/keydown_util.js";
import "js/lightbox_canvas.js";
import "js/rtl.js";
import "ts/dict.ts";
import "js/dict.ts";
import "js/scroll_util.js";
import "js/components.js";
import "js/feedback_widget.js";

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var color_data = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var condense = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var muting = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var narrow_state = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var people = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var pm_conversations = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var reactions = (function () {
var exports = {};

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var recent_senders = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var settings_sections = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var settings_streams = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var starred_messages = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var stream_data = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var stream_list = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var topic_data = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var topic_list = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var typeahead_helper = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var typing_data = (function () {
var exports = {};

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
// See https://zulip.readthedocs.io/en/latest/subsystems/pointer.html for notes on
// how this system is designed.

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var user_groups = (function () {

View File

@ -1,4 +1,4 @@
var Dict = require('../ts/dict').Dict;
var Dict = require('./dict').Dict;
var user_status = (function () {

View File

@ -93,7 +93,7 @@ def run():
linter_config.external_linter('eslint', ['node', 'node_modules/.bin/eslint',
'--quiet', '--cache'], ['js'])
linter_config.external_linter('tslint', ['node', 'node_modules/.bin/tslint', '-c',
'static/ts/tslint.json'], ['ts'])
'static/js/tslint.json'], ['ts'])
linter_config.external_linter('puppet', ['puppet', 'parser', 'validate'], ['pp'])
linter_config.external_linter('puppet-lint',
['puppet-lint'] + PUPPET_CHECK_RULES_TO_EXCLUDE, ['pp'])

View File

@ -29,7 +29,7 @@ export default (env?: string) : webpack.Configuration => {
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
configFile: require.resolve('../static/ts/tsconfig.json')
configFile: require.resolve('../static/js/tsconfig.json')
}
},
// Uses script-loader on minified files so we don't change global variables in them.