Skip to content

Commit

Permalink
rename factory to builder
Browse files Browse the repository at this point in the history
  • Loading branch information
soryy708 committed Mar 18, 2024
1 parent 0f0de8b commit 16cafc4
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
{
"files": [
"utils/**", // TODO
"src/exportMapFactory.js", // TODO
"src/exportMapBuilder.js", // TODO
],
"rules": {
"no-use-before-define": "off",
Expand Down
10 changes: 5 additions & 5 deletions src/exportMapFactory.js → src/exportMapBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ const availableDocStyleParsers = {

const supportedImportTypes = new Set(['ImportDefaultSpecifier', 'ImportNamespaceSpecifier']);

export default class ExportMapFactory {
export default class ExportMapBuilder {
static get(source, context) {
const path = resolve(source, context);
if (path == null) { return null; }

return ExportMapFactory.for(childContext(path, context));
return ExportMapBuilder.for(childContext(path, context));
}

static for(context) {
Expand Down Expand Up @@ -167,7 +167,7 @@ export default class ExportMapFactory {
}

log('cache miss', cacheKey, 'for path', path);
exportMap = ExportMapFactory.parse(path, content, context);
exportMap = ExportMapBuilder.parse(path, content, context);

// ambiguous modules return null
if (exportMap == null) {
Expand Down Expand Up @@ -271,7 +271,7 @@ export default class ExportMapFactory {
function resolveImport(value) {
const rp = remotePath(value);
if (rp == null) { return null; }
return ExportMapFactory.for(childContext(rp, context));
return ExportMapBuilder.for(childContext(rp, context));
}

function getNamespace(identifier) {
Expand Down Expand Up @@ -562,7 +562,7 @@ export default class ExportMapFactory {
* caused memory leaks. See #1266.
*/
function thunkFor(p, context) {
return () => ExportMapFactory.for(childContext(p, context));
return () => ExportMapBuilder.for(childContext(p, context));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/rules/default.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Exports from '../exportMapFactory';
import Exports from '../exportMapBuilder';
import docsUrl from '../docsUrl';

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/export.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ExportMap, { recursivePatternCapture } from '../exportMapFactory';
import ExportMap, { recursivePatternCapture } from '../exportMapBuilder';
import docsUrl from '../docsUrl';
import includes from 'array-includes';
import flatMap from 'array.prototype.flatmap';
Expand Down
2 changes: 1 addition & 1 deletion src/rules/named.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as path from 'path';
import Exports from '../exportMapFactory';
import Exports from '../exportMapBuilder';
import docsUrl from '../docsUrl';

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/namespace.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import declaredScope from 'eslint-module-utils/declaredScope';
import Exports from '../exportMapFactory';
import Exports from '../exportMapBuilder';
import ExportMap from '../exportMap';
import importDeclaration from '../importDeclaration';
import docsUrl from '../docsUrl';
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-cycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import resolve from 'eslint-module-utils/resolve';
import Exports from '../exportMapFactory';
import Exports from '../exportMapBuilder';
import { isExternalModule } from '../core/importType';
import moduleVisitor, { makeOptionsSchema } from 'eslint-module-utils/moduleVisitor';
import docsUrl from '../docsUrl';
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-deprecated.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import declaredScope from 'eslint-module-utils/declaredScope';
import Exports from '../exportMapFactory';
import Exports from '../exportMapBuilder';
import ExportMap from '../exportMap';
import docsUrl from '../docsUrl';

Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-named-as-default-member.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @copyright 2016 Desmond Brand. All rights reserved.
* See LICENSE in root directory for full license.
*/
import Exports from '../exportMapFactory';
import Exports from '../exportMapBuilder';
import importDeclaration from '../importDeclaration';
import docsUrl from '../docsUrl';

Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-named-as-default.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Exports from '../exportMapFactory';
import Exports from '../exportMapBuilder';
import importDeclaration from '../importDeclaration';
import docsUrl from '../docsUrl';

Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-unused-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import values from 'object.values';
import includes from 'array-includes';
import flatMap from 'array.prototype.flatmap';

import Exports, { recursivePatternCapture } from '../exportMapFactory';
import Exports, { recursivePatternCapture } from '../exportMapBuilder';
import docsUrl from '../docsUrl';

let FileEnumerator;
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/getExports.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import sinon from 'sinon';
import eslintPkg from 'eslint/package.json';
import typescriptPkg from 'typescript/package.json';
import * as tsConfigLoader from 'tsconfig-paths/lib/tsconfig-loader';
import ExportMap from '../../../src/exportMapFactory';
import ExportMap from '../../../src/exportMapBuilder';

import * as fs from 'fs';

Expand Down

0 comments on commit 16cafc4

Please sign in to comment.