From 23537546fec0d8148af1aa1ceda0609e346209c8 Mon Sep 17 00:00:00 2001 From: Scott Nonnenberg Date: Thu, 5 Apr 2018 15:30:40 -0700 Subject: [PATCH] Big refactor: ts/ directory for all typescript, including react Split out test-specific and general utility react components too. And moved our test/legacy* files for the Style Guide into a styleguide/ subdirectory of test/. I think we'll be able to live in this directory structure for a while. --- .eslintignore | 2 +- .gitignore | 2 +- Gruntfile.js | 4 +--- background.html | 6 +++++ package.json | 6 ++--- styleguide.config.js | 17 +++++++++----- test/{ => styleguide}/legacy_bridge.js | 7 +++--- test/{ => styleguide}/legacy_templates.js | 19 +++++++++++----- .../components}/conversation/Message.md | 0 .../components}/conversation/Message.tsx | 0 .../components}/conversation/Reply.md | 0 .../components}/conversation/Reply.tsx | 0 .../components/utility}/BackboneWrapper.md | 0 .../components/utility}/BackboneWrapper.tsx | 2 +- .../util => ts/test}/ConversationContext.md | 0 .../util => ts/test}/ConversationContext.tsx | 2 +- .../index.ts => ts/test/StyleGuideUtil.ts | 22 +++++++++---------- tsconfig.json | 2 +- 18 files changed, 54 insertions(+), 37 deletions(-) rename test/{ => styleguide}/legacy_bridge.js (88%) rename test/{ => styleguide}/legacy_templates.js (68%) rename {js/react => ts/components}/conversation/Message.md (100%) rename {js/react => ts/components}/conversation/Message.tsx (100%) rename {js/react => ts/components}/conversation/Reply.md (100%) rename {js/react => ts/components}/conversation/Reply.tsx (100%) rename {js/react/util => ts/components/utility}/BackboneWrapper.md (100%) rename {js/react/util => ts/components/utility}/BackboneWrapper.tsx (98%) rename {js/react/util => ts/test}/ConversationContext.md (100%) rename {js/react/util => ts/test}/ConversationContext.tsx (92%) rename js/react/util/index.ts => ts/test/StyleGuideUtil.ts (67%) diff --git a/.eslintignore b/.eslintignore index c810ffb50..c29c5fbb8 100644 --- a/.eslintignore +++ b/.eslintignore @@ -14,7 +14,7 @@ test/views/*.js /*.js # typescript-generated files -js/react/**/*.js +ts/**/*.js # ES2015+ files diff --git a/.gitignore b/.gitignore index ac02d8728..c1f9a6d9a 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,4 @@ test/test.js libtextsecure/test/test.js # React / TypeScript -js/react/**/*.js +ts/**/*.js diff --git a/Gruntfile.js b/Gruntfile.js index c5f360d08..46abd1ec2 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -107,7 +107,6 @@ module.exports = function(grunt) { '!js/logging.js', '!js/modules/**/*.js', '!js/Mp3LameEncoder.min.js', - '!js/react/**/*.js', '!js/signal_protocol_store.js', '!js/views/conversation_search_view.js', '!js/views/debug_log_view.js', @@ -162,7 +161,6 @@ module.exports = function(grunt) { '!js/libtextsecure.js', '!js/modules/**/*.js', '!js/Mp3LameEncoder.min.js', - '!js/react/**/*.js', '!js/WebAudioRecorderMp3.js', 'test/**/*.js', '!test/blanket_mocha.js', @@ -193,7 +191,7 @@ module.exports = function(grunt) { tasks: ['jscs'] }, transpile: { - files: ['./js/react/**/*.js'], + files: ['./ts/**/*.js'], tasks: ['exec:transpile'] } }, diff --git a/background.html b/background.html index 930015b70..ac5db582d 100644 --- a/background.html +++ b/background.html @@ -20,6 +20,12 @@ Signal + + +