mirror of https://github.com/zulip/zulip.git
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:
parent
9ed1dcc4b6
commit
a2872c107e
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
fn = 'js/' + name;
|
||||
}
|
||||
} else {
|
||||
path = require.resolve(fn);
|
||||
}
|
||||
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;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var activity = (function () {
|
||||
var exports = {};
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var color_data = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var condense = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var muting = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var narrow_state = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var people = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var pm_conversations = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var reactions = (function () {
|
||||
var exports = {};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var recent_senders = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var settings_sections = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var settings_streams = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var starred_messages = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var stream_data = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var stream_list = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var topic_data = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var topic_list = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var typeahead_helper = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var typing_data = (function () {
|
||||
var exports = {};
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var user_groups = (function () {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Dict = require('../ts/dict').Dict;
|
||||
var Dict = require('./dict').Dict;
|
||||
|
||||
var user_status = (function () {
|
||||
|
||||
|
|
|
@ -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'])
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue