Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Commit

Permalink
s/unmock/unmock-core/g
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Solomon committed Apr 20, 2019
1 parent 085c9a4 commit cb7ff68
Show file tree
Hide file tree
Showing 41 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -62,7 +62,7 @@ The latest version of unmock supports all currently maintained Node versions, se
In your unit tests, you can invoke unmock like this:

```js
import { unmock } from "unmock";
import { unmock } from "unmock-core";

beforeEach(async () => await unmock());

Expand Down
2 changes: 1 addition & 1 deletion jest.config.base.js
Expand Up @@ -8,7 +8,7 @@ module.exports = {
testPathIgnorePatterns: ["/node_modules/", "/dist/"],
moduleFileExtensions: [...defaults.moduleFileExtensions, "ts", "tsx"],
moduleNameMapper: {
"^(unmock|unmock-cli|unmock-jsdom|unmock-node)(?:/dist)?((?:/.*)|$)":
"^(unmock-core|unmock-cli|unmock-jsdom|unmock-node)(?:/dist)?((?:/.*)|$)":
"<rootDir>/../../packages/$1/src$2"
},
setupFilesAfterEnv: ["<rootDir>/../../jest.setup.js"],
Expand Down
20 changes: 10 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -55,7 +55,7 @@
"url": "https://github.com/unmock/unmock-js/issues"
},
"dependencies": {
"unmock": "file:packages/unmock",
"unmock-core": "file:packages/unmock-core",
"unmock-cli": "file:packages/unmock-cli",
"unmock-jsdom": "file:packages/unmock-jsdom",
"unmock-node": "file:packages/unmock-node"
Expand Down
2 changes: 1 addition & 1 deletion packages/unmock-cli/.npmignore
@@ -1,5 +1,5 @@
src
.unmock
test
__tests__
.env
.env.example
5 changes: 5 additions & 0 deletions packages/unmock-core/.npmignore
@@ -0,0 +1,5 @@
src
.unmock
__tests__
.env
.env.example
File renamed without changes.
@@ -1,6 +1,6 @@
{
"name": "unmock",
"displayName": "unmock",
"name": "unmock-core",
"displayName": "unmock-core",
"main": "dist/index.js",
"license": "MIT",
"repository": {
Expand Down
@@ -1,4 +1,4 @@
import { defaultOptions, ignoreAuth } from "unmock";
import { defaultOptions, ignoreAuth } from "unmock-core";
import computeHash, { makeHashable } from "../../../hash/v0";

describe("Hash function", () => {
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.
2 changes: 1 addition & 1 deletion packages/unmock-jsdom/.npmignore
@@ -1,5 +1,5 @@
src
.unmock
test
__tests__
.env
.env.example
2 changes: 1 addition & 1 deletion packages/unmock-jsdom/package.json
Expand Up @@ -13,6 +13,6 @@
},
"dependencies": {
"js-yaml": "^3.13.1",
"unmock": "file:../unmock"
"unmock-core": "file:../unmock-core"
}
}
6 changes: 3 additions & 3 deletions packages/unmock-jsdom/src/backend/index.ts
@@ -1,6 +1,6 @@
import { IUnmockInternalOptions } from "unmock";
import { util } from "unmock";
import { IBackend } from "unmock";
import { IUnmockInternalOptions } from "unmock-core";
import { util } from "unmock-core";
import { IBackend } from "unmock-core";

const {
buildPath,
Expand Down
6 changes: 3 additions & 3 deletions packages/unmock-jsdom/src/index.ts
Expand Up @@ -5,16 +5,16 @@ import {
IUnmockInternalOptions,
kcomnu as _kcomnu,
unmock as _unmock,
} from "unmock";
} from "unmock-core";
import JSDomBackend from "./backend";
import BrowserLogger from "./logger/browser-logger";
import LocalStoragePersistence from "./persistence/local-storage-persistence";
import BrowserStoragePersistence from "./persistence/local-storage-persistence";

export const defaultOptions: IUnmockInternalOptions = {
..._defaultOptions,
backend: new JSDomBackend(),
logger: new BrowserLogger(),
persistence: new LocalStoragePersistence(),
persistence: new BrowserStoragePersistence(),
};

export const ignoreStory = _ignoreStory(defaultOptions);
Expand Down
2 changes: 1 addition & 1 deletion packages/unmock-jsdom/src/logger/browser-logger.ts
@@ -1,4 +1,4 @@
import { ILogger } from "unmock";
import { ILogger } from "unmock-core";

export default class BrowserLogger implements ILogger {
public log(message: string) {
Expand Down
@@ -1,6 +1,6 @@
import * as yml from "js-yaml";
import * as path from "path";
import { IPersistableData, IPersistence } from "unmock";
import { IPersistableData, IPersistence } from "unmock-core";

// Uses directory structure for keys in window local storage
const UNMOCK_KEY = ".unmock";
Expand All @@ -9,7 +9,7 @@ const TOKEN_FULL_KEY = path.join(UNMOCK_KEY, TOKEN_KEY);
const SAVE_PATH = path.join(UNMOCK_KEY, "save");
const UNMOCK_FILE = "unmock.yml";

export default class LocalStoragePersistence implements IPersistence {
export default class BrowserStoragePersistence implements IPersistence {
private token: string | undefined;

constructor(private savePath = SAVE_PATH) {}
Expand Down
2 changes: 1 addition & 1 deletion packages/unmock-jsdom/tsconfig.json
Expand Up @@ -7,6 +7,6 @@
"include": ["src/**/*"],
"exclude": ["**/__tests__"],
"references": [
{ "path": "../unmock" }
{ "path": "../unmock-core" }
]
}
2 changes: 1 addition & 1 deletion packages/unmock-node/.npmignore
@@ -1,5 +1,5 @@
src
.unmock
test
__tests__
.env
.env.example
2 changes: 1 addition & 1 deletion packages/unmock-node/package.json
Expand Up @@ -16,7 +16,7 @@
"ini": "^1.3.5",
"js-yaml": "^3.13.1",
"mkdirp": "^0.5.1",
"unmock": "file:../unmock",
"unmock-core": "file:../unmock-core",
"winston": "^3.2.1"
}
}
4 changes: 2 additions & 2 deletions packages/unmock-node/src/backend/index.ts
Expand Up @@ -2,8 +2,8 @@ import fr from "follow-redirects";
import http, { ClientRequest, IncomingMessage, RequestOptions } from "http";
import https from "https";
import { URL } from "url";
import { IBackend, IUnmockInternalOptions } from "unmock";
import { util } from "unmock";
import { IBackend, IUnmockInternalOptions } from "unmock-core";
import { util } from "unmock-core";

const {
buildPath,
Expand Down
2 changes: 1 addition & 1 deletion packages/unmock-node/src/index.ts
Expand Up @@ -5,7 +5,7 @@ import {
IUnmockInternalOptions,
kcomnu as _kcomnu,
unmock as _unmock,
} from "unmock";
} from "unmock-core";
import NodeBackend from "./backend";
import WinstonLogger from "./logger/winston-logger";
import FSPersistence from "./persistence/fs-persistence";
Expand Down
2 changes: 1 addition & 1 deletion packages/unmock-node/src/logger/winston-logger.ts
@@ -1,5 +1,5 @@
import winston from "winston";
import { ILogger } from "unmock";
import { ILogger } from "unmock-core";

const logger = winston.createLogger({
levels: { unmock: 2 },
Expand Down
2 changes: 1 addition & 1 deletion packages/unmock-node/src/persistence/fs-persistence.ts
Expand Up @@ -4,7 +4,7 @@ import * as yml from "js-yaml";
import * as mkdirp from "mkdirp";
import * as os from "os";
import * as path from "path";
import { IPersistableData, IPersistence } from "unmock";
import { IPersistableData, IPersistence } from "unmock-core";

const UNMOCK_DIR = ".unmock";
const TOKEN_FILE = ".token";
Expand Down
2 changes: 1 addition & 1 deletion packages/unmock-node/tsconfig.json
Expand Up @@ -7,6 +7,6 @@
"include": ["src/**/*"],
"exclude": ["**/__tests__"],
"references": [
{ "path": "../unmock" }
{ "path": "../unmock-core" }
]
}
5 changes: 0 additions & 5 deletions packages/unmock/.npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion tsconfig.build.json
Expand Up @@ -5,7 +5,7 @@
"files": [],
"include": [],
"references": [
{ "path": "./packages/unmock" },
{ "path": "./packages/unmock-core" },
{ "path": "./packages/unmock-cli" },
{ "path": "./packages/unmock-jsdom" },
{ "path": "./packages/unmock-node" }
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.test.json
Expand Up @@ -5,7 +5,7 @@
"files": [],
"include": [],
"references": [
{ "path": "./packages/unmock/src/__tests__" },
{ "path": "./packages/unmock-core/src/__tests__" },
{ "path": "./packages/unmock-cli/src/__tests__" },
{ "path": "./packages/unmock-jsdom/src/__tests__" },
{ "path": "./packages/unmock-node/src/__tests__" }
Expand Down

0 comments on commit cb7ff68

Please sign in to comment.