Skip to content

Commit

Permalink
move js subfolder to ts
Browse files Browse the repository at this point in the history
  • Loading branch information
WuTheFWasThat committed May 2, 2017
1 parent 6e5ca23 commit a2b3a00
Show file tree
Hide file tree
Showing 63 changed files with 66 additions and 66 deletions.
6 changes: 3 additions & 3 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ A plugin registers using
Plugins.register(metadata, enable: fn, disable: ?fn)
```
where
- `metadata`: For the detailed format, read the type definitions in [plugins.ts](../src/assets/js/plugins.ts)
- `metadata`: For the detailed format, read the type definitions in [plugins.ts](../src/assets/ts/plugins.ts)
- name: string
This will be displayed to the user in options. It should not be changed!
- version: number
Expand Down Expand Up @@ -73,7 +73,7 @@ Actions may optionally accept motions and do something with the motion
(e.g. move the cursor according to the movement, or delete text according to the movement).
To accept a motion, an action's mapping must have a special key '<motion>' which means any sequence for a motion.

For other example usages, see the folder [`src/assets/js/definitions`](../src/assets/js/definitions), and the easy-motion plugin.
For other example usages, see the folder [`src/assets/ts/definitions`](../src/assets/ts/definitions), and the easy-motion plugin.

```
api.registerMode(metadata) -> mode
Expand All @@ -94,7 +94,7 @@ You can also manually call each deregister, but this is not recomended
api.deregisterDefaultMappings(mode, mappings)
```

See [`keyDefinitions.ts`](../src/assets/js/keyDefinitions.ts) for detailed schema for the metadata of each of these.
See [`keyDefinitions.ts`](../src/assets/ts/keyDefinitions.ts) for detailed schema for the metadata of each of these.

#### vimflowy internals

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/assets/js/document.ts → src/assets/ts/document.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ the document itself includes:
- the parent/child relationships and collapsed-ness of lines
also deals with loading the initial document from the datastore, and serializing the document to a string
Currently, the separation between the Session and Document classes is not very good. (see session.js)
Currently, the separation between the Session and Document classes is not very good. (see session.ts)
*/

type SearchOptions = {nresults?: number, case_sensitive?: boolean};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ModeId, CursorOptions } from './types';

// NOTE: this is a special key, which accepts any motion keys.
// It causes definition functions to take an extra cursor argument.
// For more info/context, see keyBindings.js and definitions of CHANGE/DELETE/YANK
// For more info/context, see keyBindings.ts and definitions of CHANGE/DELETE/YANK
export const motionKey = '<motion>';

type MotionName = string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A key corresponds to a keypress in the browser, including modifiers/special keys
The core function is to take browser keypress events, and normalize the key to have a string representation.
For more info, see its consumer, keyHandler.js, as well as keyBindings.js
For more info, see its consumer, keyHandler.ts, as well as keyBindings.ts
Note that one-character keys are treated specially, in that they are insertable in insert mode.
*/

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/assets/js/session.ts → src/assets/ts/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ a Session represents a session with a vimflowy document
It holds a Cursor, a Document object
It exposes methods for manipulation of the document, and movement of the cursor
Currently, the separation between the Session and Document classes is not very good. (see document.js)
Currently, the separation between the Session and Document classes is not very good. (see document.ts)
Ideally, session shouldn't do much more than handle cursors and history
*/

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/plugins/debug_mode/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react'; // tslint:disable-line no-unused-variable

import { registerPlugin } from '../../assets/js/plugins';
import { registerPlugin } from '../../assets/ts/plugins';

registerPlugin({
name: 'ID Debug Mode',
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/easy_motion/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as _ from 'lodash';
import * as React from 'react'; // tslint:disable-line no-unused-variable

import Path from '../../assets/js/path';
import { registerPlugin } from '../../assets/js/plugins';
import Path from '../../assets/ts/path';
import { registerPlugin } from '../../assets/ts/plugins';

type EasyMotionMappings = {
key_to_path: {[key: string]: Path},
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/examples/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { registerPlugin } from '../../assets/js/plugins';
import { registerPlugin } from '../../assets/ts/plugins';

registerPlugin({
name: 'Hello World example',
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/html/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react'; // tslint:disable-line no-unused-variable

import { Token, RegexTokenizerSplitter, EmitFn, Tokenizer } from '../../assets/js/utils/token_unfolder';
import { registerPlugin } from '../../assets/js/plugins';
import { Token, RegexTokenizerSplitter, EmitFn, Tokenizer } from '../../assets/ts/utils/token_unfolder';
import { registerPlugin } from '../../assets/ts/plugins';

const htmlTypes: Array<string> = [
'div',
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/latex/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import * as React from 'react'; // tslint:disable-line no-unused-variable
import * as katex from 'katex';
import 'katex/dist/katex.min.css';

import { Tokenizer, Token, RegexTokenizerSplitter, EmitFn } from '../../assets/js/utils/token_unfolder';
import { registerPlugin } from '../../assets/js/plugins';
import { matchWordRegex } from '../../assets/js/utils';
import { Tokenizer, Token, RegexTokenizerSplitter, EmitFn } from '../../assets/ts/utils/token_unfolder';
import { registerPlugin } from '../../assets/ts/plugins';
import { matchWordRegex } from '../../assets/ts/utils';

registerPlugin(
{
Expand Down
32 changes: 16 additions & 16 deletions src/plugins/marks/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import * as _ from 'lodash';
import * as React from 'react'; // tslint:disable-line no-unused-variable

import { registerPlugin, PluginApi } from '../../assets/js/plugins';
import Menu from '../../assets/js/menu';
import * as DataStore from '../../assets/js/datastore';
import Document from '../../assets/js/document';
import Session from '../../assets/js/session';
import LineComponent from '../../assets/js/components/line';
import Mutation from '../../assets/js/mutations';
import * as errors from '../../assets/js/errors';
import { Logger } from '../../assets/js/logger';
import Path from '../../assets/js/path';
import { Row } from '../../assets/js/types';
import { PartialUnfolder, Token, EmitFn, Tokenizer } from '../../assets/js/utils/token_unfolder';

import { SINGLE_LINE_MOTIONS } from '../../assets/js/definitions/motions';
import { INSERT_MOTION_MAPPINGS } from '../../assets/js/configurations/vim';
import { motionKey } from '../../assets/js/keyDefinitions';
import { registerPlugin, PluginApi } from '../../assets/ts/plugins';
import Menu from '../../assets/ts/menu';
import * as DataStore from '../../assets/ts/datastore';
import Document from '../../assets/ts/document';
import Session from '../../assets/ts/session';
import LineComponent from '../../assets/ts/components/line';
import Mutation from '../../assets/ts/mutations';
import * as errors from '../../assets/ts/errors';
import { Logger } from '../../assets/ts/logger';
import Path from '../../assets/ts/path';
import { Row } from '../../assets/ts/types';
import { PartialUnfolder, Token, EmitFn, Tokenizer } from '../../assets/ts/utils/token_unfolder';

import { SINGLE_LINE_MOTIONS } from '../../assets/ts/definitions/motions';
import { INSERT_MOTION_MAPPINGS } from '../../assets/ts/configurations/vim';
import { motionKey } from '../../assets/ts/keyDefinitions';

// TODO: do this elsewhere
declare const process: any;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/text_formatting/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import * as React from 'react'; // tslint:disable-line no-unused-variable

import './index.sass';

import { hideBorderAndModify, RegexTokenizerModifier } from '../../assets/js/utils/token_unfolder';
import { registerPlugin } from '../../assets/js/plugins';
import { matchWordRegex } from '../../assets/js/utils';
import { hideBorderAndModify, RegexTokenizerModifier } from '../../assets/ts/utils/token_unfolder';
import { registerPlugin } from '../../assets/ts/plugins';
import { matchWordRegex } from '../../assets/ts/utils';

const boldClass = 'bold';
const italicsClass = 'italic';
Expand Down
8 changes: 4 additions & 4 deletions src/plugins/time_tracking/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ NOTES:
import * as $ from 'jquery';
import * as React from 'react'; // tslint:disable-line no-unused-variable

import { registerPlugin, PluginApi } from '../../assets/js/plugins';
import { Logger } from '../../assets/js/logger';
import Path from '../../assets/js/path';
import { Row } from '../../assets/js/types';
import { registerPlugin, PluginApi } from '../../assets/ts/plugins';
import { Logger } from '../../assets/ts/logger';
import Path from '../../assets/ts/path';
import { Row } from '../../assets/ts/types';

function pad(num: number, length: number, padChar: string = '0') {
const val = '' + num;
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/todo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import * as _ from 'lodash';

import './index.sass';

import { hideBorderAndModify, RegexTokenizerModifier } from '../../assets/js/utils/token_unfolder';
import { registerPlugin } from '../../assets/js/plugins';
import { matchWordRegex } from '../../assets/js/utils';
import { Row } from '../../assets/js/types';
import Session from '../../assets/js/session';
import { hideBorderAndModify, RegexTokenizerModifier } from '../../assets/ts/utils/token_unfolder';
import { registerPlugin } from '../../assets/ts/plugins';
import { matchWordRegex } from '../../assets/ts/utils';
import { Row } from '../../assets/ts/types';
import Session from '../../assets/ts/session';

const strikethroughClass = 'strikethrough';

Expand Down
30 changes: 15 additions & 15 deletions test/testcase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
import 'mocha';
import * as _ from 'lodash';

import { InMemory } from '../src/assets/js/datastore';
import Document from '../src/assets/js/document';
import Session from '../src/assets/js/session';
import Register, { RegisterTypes, SerializedRegister } from '../src/assets/js/register';
import '../src/assets/js/definitions';
import mainDefinitions from '../src/assets/js/keyDefinitions';
import KeyBindings from '../src/assets/js/keyBindings';
import Config from '../src/assets/js/config';
import vimConfig from '../src/assets/js/configurations/vim';
import KeyHandler from '../src/assets/js/keyHandler';
import logger, * as Logger from '../src/assets/js/logger';
import { PluginsManager, PluginStatus } from '../src/assets/js/plugins';
import Cursor from '../src/assets/js/cursor';
import Path from '../src/assets/js/path';
import { SerializedBlock, Row, Col, Key } from '../src/assets/js/types';
import { InMemory } from '../src/assets/ts/datastore';
import Document from '../src/assets/ts/document';
import Session from '../src/assets/ts/session';
import Register, { RegisterTypes, SerializedRegister } from '../src/assets/ts/register';
import '../src/assets/ts/definitions';
import mainDefinitions from '../src/assets/ts/keyDefinitions';
import KeyBindings from '../src/assets/ts/keyBindings';
import Config from '../src/assets/ts/config';
import vimConfig from '../src/assets/ts/configurations/vim';
import KeyHandler from '../src/assets/ts/keyHandler';
import logger, * as Logger from '../src/assets/ts/logger';
import { PluginsManager, PluginStatus } from '../src/assets/ts/plugins';
import Cursor from '../src/assets/ts/cursor';
import Path from '../src/assets/ts/path';
import { SerializedBlock, Row, Col, Key } from '../src/assets/ts/types';

// logger.setLevel(Logger.LEVEL.DEBUG);
logger.setStream(Logger.STREAM.QUEUE);
Expand Down
2 changes: 1 addition & 1 deletion test/tests/enter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* globals describe, it */
import TestCase from '../testcase';
import { RegisterTypes } from '../../src/assets/js/register';
import { RegisterTypes } from '../../src/assets/ts/register';

describe('enter', function() {
it('works in basic case', async function() {
Expand Down
4 changes: 2 additions & 2 deletions test/tests/marks.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* globals describe, it */
import TestCase from '../testcase';
import * as Marks from '../../src/plugins/marks';
import '../../src/assets/js/plugins';
import { Row } from '../../src/assets/js/types';
import '../../src/assets/ts/plugins';
import { Row } from '../../src/assets/ts/types';

// Testing
class MarksTestCase extends TestCase {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/todo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* globals describe, it */
import TestCase from '../testcase';
import * as Todo from '../../src/plugins/todo';
import '../../src/assets/js/plugins';
import '../../src/assets/ts/plugins';

const toggleStrikethroughKey = 'ctrl+enter';

Expand Down
2 changes: 1 addition & 1 deletion test/tests/yank.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* globals describe, it */
import TestCase from '../testcase';
import { RegisterTypes } from '../../src/assets/js/register';
import { RegisterTypes } from '../../src/assets/ts/register';

describe('yank', function() {
describe('characters', function() {
Expand Down
2 changes: 1 addition & 1 deletion webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./src/assets/js/app.tsx'
'./src/assets/ts/app.tsx'
],
module: {
loaders: [
Expand Down
2 changes: 1 addition & 1 deletion webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var SRC_DIR = path.join(__dirname, 'src');

module.exports = {
devtool: 'source-map',
entry: './src/assets/js/app.tsx',
entry: './src/assets/ts/app.tsx',
module: {
loaders: [
{
Expand Down

0 comments on commit a2b3a00

Please sign in to comment.