Skip to content

Commit

Permalink
refactor: better export path
Browse files Browse the repository at this point in the history
  • Loading branch information
agerard-godaddy committed Nov 12, 2024
1 parent 3017938 commit 68986b3
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion packages/gasket-core/lib/gasket.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable no-console, no-process-env */

import { GasketEngine, lifecycleMethods } from './engine.js';
import { applyConfigOverrides } from '@gasket/utils/apply-config-overrides';
import { applyConfigOverrides } from '@gasket/utils/config';
import { makeTraceBranch } from './trace.js';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/gasket-plugin-data/lib/configure.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { applyConfigOverrides } = require('@gasket/utils/apply-config-overrides');
const { applyConfigOverrides } = require('@gasket/utils/config');
const { baseDataMap } = require('./actions');

/**
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const debug = require('diagnostics')('gasket:utils');
/**
* Normalize the config by applying any overrides for environments, commands,
* or local-only config file.
* @type {import('./apply-config-overrides').applyConfigOverrides}
* @type {import('./config').applyConfigOverrides}
*/
function applyConfigOverrides(
function config(
config,
{ env = '', commandId }
) {
Expand All @@ -21,7 +21,7 @@ function applyConfigOverrides(

/**
* Generator function to yield potential configurations
* @type {import('./apply-config-overrides').getPotentialConfigs}
* @type {import('./config').getPotentialConfigs}
*/
function *getPotentialConfigs(config, { env, commandId }) {
// Separate environment-specific config from another config
Expand All @@ -36,7 +36,7 @@ function *getPotentialConfigs(config, { env, commandId }) {

/**
* Generator function to yield command overrides
* @type {import('./apply-config-overrides').getCommandOverrides}
* @type {import('./config').getCommandOverrides}
*/
function *getCommandOverrides(commands, commandId) {
const commandOverrides = commandId && commands[commandId];
Expand All @@ -48,7 +48,7 @@ function *getCommandOverrides(commands, commandId) {

/**
* Generator function to yield sub-environment overrides
* @type {import('./apply-config-overrides').getSubEnvironmentOverrides}
* @type {import('./config').getSubEnvironmentOverrides}
*/
function *getSubEnvironmentOverrides(env, environments) {
const envParts = env.split('.');
Expand All @@ -67,7 +67,7 @@ function *getSubEnvironmentOverrides(env, environments) {

/**
* Generator function to yield development overrides
* @type {import('./apply-config-overrides').getDevOverrides}
* @type {import('./config').getDevOverrides}
*/
function *getDevOverrides(isLocalEnv, environments) {
// Special case for the local environment, which inherits from the
Expand All @@ -82,5 +82,5 @@ function *getDevOverrides(isLocalEnv, environments) {
}

module.exports = {
applyConfigOverrides
applyConfigOverrides: config
};
2 changes: 1 addition & 1 deletion packages/gasket-utils/lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { MaybeAsync } from '@gasket/core';

export { applyConfigOverrides } from './apply-config-overrides';
export { applyConfigOverrides } from './config';

export interface PackageManagerOptions {
/** Name of manager, either `npm` (default) or `yarn` */
Expand Down
2 changes: 1 addition & 1 deletion packages/gasket-utils/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { applyConfigOverrides } = require('./apply-config-overrides');
const { applyConfigOverrides } = require('./config');
const runShellCommand = require('./run-shell-command');
const PackageManager = require('./package-manager');
const warnIfOutdated = require('./warn-if-outdated');
Expand Down
6 changes: 3 additions & 3 deletions packages/gasket-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
},
"./apply-config-overrides": {
"types": "./lib/apply-config-overrides.d.ts",
"default": "./lib/apply-config-overrides.js"
"./config": {
"types": "./lib/config.d.ts",
"default": "./lib/config.js"
},
"./package.json": "./package.json"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { applyConfigOverrides } = require('../lib/apply-config-overrides');
const { applyConfigOverrides } = require('../lib/config');

describe('applyConfigOverrides', () => {
let results, mockContext, mockConfig;
Expand Down

0 comments on commit 68986b3

Please sign in to comment.