Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove preventCicrularDepPropertyWarning util #141

Merged
merged 1 commit into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions configure-inquirer-stub.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const sinon = require('sinon');
const preventCircularDepPropertyWarning = require('./prevent-circular-dep-property-warning');

const validatedTypes = new Set(['input', 'password']);

Expand Down Expand Up @@ -31,7 +30,6 @@ module.exports = (inquirer, config) => {
if (inquirer.prompt.restore) inquirer.prompt.restore();
if (inquirer.createPromptModule.restore) inquirer.createPromptModule.restore();

const { restore: restoreProcessWarnings } = preventCircularDepPropertyWarning();
sinon.stub(inquirer, 'prompt').callsFake((promptConfig) => {
if (!Array.isArray(promptConfig)) return resolveAnswer(promptConfig);
const result = {};
Expand All @@ -46,6 +44,5 @@ module.exports = (inquirer, config) => {
});

sinon.stub(inquirer, 'createPromptModule').callsFake(() => inquirer.prompt);
restoreProcessWarnings();
return inquirer;
};
19 changes: 0 additions & 19 deletions docs/prevent-circular-dep-property-warning.md

This file was deleted.

28 changes: 0 additions & 28 deletions prevent-circular-dep-property-warning.js

This file was deleted.

3 changes: 0 additions & 3 deletions run-serverless.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ const observeOutput = require('./observe-output');
const disableServerlessStatsRequests = require('./disable-serverless-stats-requests');
const provisionTmpDir = require('./provision-tmp-dir');
const configureAwsRequestStub = require('./configure-aws-request-stub');
const preventCircularDepPropertyWarning = require('./prevent-circular-dep-property-warning');

const resolveServerless = async (serverlessPath, modulesCacheStub, callback) => {
if (!modulesCacheStub) {
disableServerlessStatsRequests(serverlessPath);
return callback(require(serverlessPath));
}

const { restore: restoreProcessWarnings } = preventCircularDepPropertyWarning();
const originalCache = Object.assign({}, require.cache);
for (const key of Object.keys(require.cache)) delete require.cache[key];
disableServerlessStatsRequests(serverlessPath);
Expand All @@ -40,7 +38,6 @@ const resolveServerless = async (serverlessPath, modulesCacheStub, callback) =>
const restore = () => {
for (const key of Object.keys(require.cache)) delete require.cache[key];
Object.assign(require.cache, originalCache);
restoreProcessWarnings();
};
try {
return await callback(require(serverlessPath));
Expand Down