Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
takefumi-yoshii committed Sep 4, 2019
1 parent 7a8bcc9 commit 452a155
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
var ts = __importStar(require("typescript"));
//_______________________________________________________
//
exports.importModule = function (fileInfo, constants) {
return ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(ts.createIdentifier(constants.MODULE))), ts.createStringLiteral(fileInfo.importModulePath));
exports.importClause = function (name, from) {
return ts.createImportDeclaration(undefined, undefined, ts.createImportClause(undefined, ts.createNamespaceImport(ts.createIdentifier(name))), ts.createStringLiteral(from));
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
var ts = __importStar(require("typescript"));
//_______________________________________________________
//
exports.importByLiteral = function (literal) {
exports.importDeclaration = function (literal) {
return ts.createImportDeclaration(undefined, undefined, undefined, ts.createStringLiteral(literal));
};
8 changes: 4 additions & 4 deletions dist/createModuleAst/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var importModule_1 = require("../astFactories/importModule");
var importByLiteral_1 = require("../astFactories/importByLiteral");
var importClause_1 = require("../astFactories/importClause");
var importDeclaration_1 = require("../astFactories/importDeclaration");
var declareModule_1 = require("../astFactories/declareModule");
var createInterfaceForModules_1 = require("./createInterfaceForModules");
var createInterfaceForLocalState_1 = require("./createInterfaceForLocalState");
Expand All @@ -11,8 +11,8 @@ var createInterfaceForLocalContext_1 = require("./createInterfaceForLocalContext
//_______________________________________________________
//
exports.createModuleAst = function (sourceFile, fileInfo, constants) { return [
importModule_1.importModule(fileInfo, constants),
importByLiteral_1.importByLiteral(constants.VUEX),
importClause_1.importClause(constants.MODULE, fileInfo.importModulePath),
importDeclaration_1.importDeclaration(constants.VUEX),
declareModule_1.declareModule(constants.VUEX, [
createInterfaceForModules_1.createInterfaceForModules(fileInfo, constants),
createInterfaceForLocalState_1.createInterfaceForLocalState(fileInfo, constants),
Expand Down
4 changes: 2 additions & 2 deletions dist/createShimsAst/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var importByLiteral_1 = require("../astFactories/importByLiteral");
var importDeclaration_1 = require("../astFactories/importDeclaration");
var declareModule_1 = require("../astFactories/declareModule");
var argument2_1 = require("./argument2");
var strictCommit_1 = require("./strictCommit");
Expand All @@ -12,7 +12,7 @@ var rootContext_1 = require("./rootContext");
//_______________________________________________________
//
exports.createShimsAst = function (fileInfos, constants) { return [
importByLiteral_1.importByLiteral(constants.VUEX),
importDeclaration_1.importDeclaration(constants.VUEX),
declareModule_1.declareModule(constants.VUEX, [
argument2_1.argument2(constants)
].concat(strictCommit_1.strictCommit(constants), strictDispatch_1.strictDispatch(constants), [
Expand Down
13 changes: 13 additions & 0 deletions src/astFactories/importClause.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as ts from 'typescript'
//_______________________________________________________
//
export const importClause = (name: string, from: string) =>
ts.createImportDeclaration(
undefined,
undefined,
ts.createImportClause(
undefined,
ts.createNamespaceImport(ts.createIdentifier(name))
),
ts.createStringLiteral(from)
)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ts from 'typescript'
//_______________________________________________________
//
export const importByLiteral = (literal: string) =>
export const importDeclaration = (literal: string) =>
ts.createImportDeclaration(
undefined,
undefined,
Expand Down
19 changes: 0 additions & 19 deletions src/astFactories/importModule.ts

This file was deleted.

8 changes: 4 additions & 4 deletions src/createModuleAst/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as ts from 'typescript'
import { FileInfo, Constants } from '../types'
import { importModule } from '../astFactories/importModule'
import { importByLiteral } from '../astFactories/importByLiteral'
import { importClause } from '../astFactories/importClause'
import { importDeclaration } from '../astFactories/importDeclaration'
import { declareModule } from '../astFactories/declareModule'
import { createInterfaceForModules } from './createInterfaceForModules'
import { createInterfaceForLocalState } from './createInterfaceForLocalState'
Expand All @@ -15,8 +15,8 @@ export const createModuleAst = (
fileInfo: FileInfo,
constants: Constants
) => [
importModule(fileInfo, constants),
importByLiteral(constants.VUEX),
importClause(constants.MODULE, fileInfo.importModulePath),
importDeclaration(constants.VUEX),
declareModule(constants.VUEX, [
createInterfaceForModules(fileInfo, constants),
createInterfaceForLocalState(fileInfo, constants),
Expand Down
4 changes: 2 additions & 2 deletions src/createShimsAst/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Constants, FileInfo } from '../types'
import { importByLiteral } from '../astFactories/importByLiteral'
import { importDeclaration } from '../astFactories/importDeclaration'
import { declareModule } from '../astFactories/declareModule'
import { argument2 } from './argument2'
import { strictCommit } from './strictCommit'
Expand All @@ -14,7 +14,7 @@ export const createShimsAst = (
fileInfos: FileInfo[],
constants: Constants
) => [
importByLiteral(constants.VUEX),
importDeclaration(constants.VUEX),
declareModule(constants.VUEX, [
argument2(constants),
...strictCommit(constants),
Expand Down

0 comments on commit 452a155

Please sign in to comment.