Skip to content

Commit

Permalink
Noun/Verb Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Cox authored and Dan Cox committed Dec 17, 2023
1 parent 44140d1 commit fc1c9c1
Show file tree
Hide file tree
Showing 139 changed files with 1,753 additions and 1,753 deletions.
210 changes: 0 additions & 210 deletions bin/extwee.js

This file was deleted.

66 changes: 23 additions & 43 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,29 @@
import TweeParser from './src/TweeParser.js';
import JSONParser from './src/JSONParser.js';
import StoryFormatParser from './src/StoryFormatParser.js';
import Twine1HTMLParser from './src/Twine1HTMLParser.js';
import Twine2HTMLParser from './src/Twine2HTMLParser.js';
import Twine2ArchiveHTMLParser from './src/Twine2ArchiveHTMLParser.js';
import Twine1HTMLCompiler from './src/Twine1HTMLCompiler.js';
import Twine2ArchiveHTMLCompiler from './src/Twine2ArchiveHTMLCompiler.js';
import Twine2HTMLCompiler from './src/Twine2HTMLCompiler.js';
import { parse as parseTwee } from './src/Twee/parse.js';
import { parse as parseJSON } from './src/JSON/parse.js';
import { parse as parseStoryFormat } from './src/StoryFormat/parse.js';
import { parse as parseTwine1HTML } from './src/Twine1HTML/parse.js';
import { parse as parseTwine2HTML } from './src/Twine2HTML/parse.js';
import { parse as parseTwine2ArchiveHTML } from './src/Twine2ArchiveHTML/parse.js';
import { parse as parseTWS } from './src/TWS/parse.js';
import { compile as compileTwine1HTML } from './src/Twine1HTML/compile.js';
import { compile as compileTwine2HTML } from './src/Twine2HTML/compile.js';
import { compile as compileTwine2ArchiveHTML } from './src/Twine2ArchiveHTML/compile.js';
import Story from './src/Story.js';
import Passage from './src/Passage.js';
import StoryFormat from './src/StoryFormat.js';

// Code objects.
export { StoryFormat };
export { Passage };
export { Story };

// Parsers.
export { TweeParser };
export { JSONParser };
export { StoryFormatParser };
export { Twine2HTMLParser };
export { Twine1HTMLParser };
export { Twine2ArchiveHTMLParser };

// Compilers.
export { Twine2HTMLCompiler };
export { Twine1HTMLCompiler };
export { Twine2ArchiveHTMLCompiler };

// Export everything by default.
export default {
// Objects
StoryFormat,
Passage,
export {
parseTwee,
parseJSON,
parseTWS,
parseStoryFormat,
parseTwine1HTML,
parseTwine2HTML,
parseTwine2ArchiveHTML,
compileTwine1HTML,
compileTwine2HTML,
compileTwine2ArchiveHTML,
Story,
// Parser shortcuts.
parseTwee: TweeParser.parse,
parseJSON: JSONParser.parse,
parseStoryFormat: StoryFormatParser.parse,
parseTwine1HTML: Twine1HTMLParser.parse,
parseTwine2HTML: Twine2HTMLParser.parse,
parseTwine2ArchiveHTML: Twine2ArchiveHTMLParser.parse,
// Compiler shortcuts.
compileTwine2HTML: Twine2HTMLCompiler.compile,
compileTwine1HTML: Twine1HTMLCompiler.compile,
compileTwine2ArchiveHTML: Twine2ArchiveHTMLCompiler.compile
Passage,
StoryFormat
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"author": "Dan Cox",
"main": "index.js",
"bin": {
"extwee": "bin/extwee.js"
"extwee": "src/extwee.js"
},
"scripts": {
"test": "jest --runInBand --coverage --colors",
"lint": "eslint ./src/**/*.js --fix",
"lint:test": "eslint ./test/*.test.js --fix",
"lint:test": "eslint ./test/**/*.test.js --fix",
"build": "webpack",
"all": "npm run lint && npm run lint:test && npm run test && npm run build"
},
Expand Down
Loading

0 comments on commit fc1c9c1

Please sign in to comment.