generated from anolilab/monorepo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(packem): major codebase restructuring and improvements
- refactor(cli): move CLI-related files to dedicated cli/ directory - refactor(config): reorganize configuration-related files into config/ directory - Move preset and utils from hooks/ to config/ - Add new config utilities for TypeScript and Packem config loading - Improve file name handling with path normalization - feat(types): update type definitions and normalize package.json types - chore(deps): update package dependencies and configurations - test: update test files to reflect new directory structure
- Loading branch information
Showing
27 changed files
with
369 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/packem/__tests__/unit/utils/overwrite-with-publish-config.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...ges/packem/src/utils/load-package-json.ts → ...kem/src/config/utils/load-package-json.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import findPackemFile from "./find-packem-file"; | ||
import type { BuildConfigFunction, BuildConfig, Environment, Mode } from "../../types"; | ||
import type { Jiti } from "jiti"; | ||
|
||
const loadPackemConfig = async (jiti: Jiti, rootDirectory: string, environment: Environment, mode: Mode, configPath?: string): Promise<{ | ||
config: BuildConfig; | ||
path: string; | ||
}> => { | ||
const packemConfigFilePath = await findPackemFile(rootDirectory, configPath); | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition | ||
let buildConfig = ((await jiti.import(packemConfigFilePath, { default: true, try: true })) || {}) as BuildConfig | BuildConfigFunction; | ||
|
||
if (typeof buildConfig === "function") { | ||
buildConfig = await buildConfig(environment, mode); | ||
} | ||
|
||
return { | ||
config: buildConfig, | ||
path: packemConfigFilePath, | ||
}; | ||
}; | ||
|
||
export default loadPackemConfig; |
Oops, something went wrong.