-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: base environment.config + environment.options
- Loading branch information
Showing
8 changed files
with
108 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,20 @@ | ||
// We are using command: 'serve' | 'build' to aling with the command flag passed to hooks. | ||
// It would be better if we would use 'dev' here but can tackle that if we managed to modify | ||
// command at the hooks level. There could also be Preview environments later on. | ||
import type { Logger } from './logger' | ||
import type { ResolvedConfig, ResolvedEnvironmentOptions } from './config' | ||
|
||
export class Environment { | ||
name: string | ||
constructor(name: string) { | ||
config: ResolvedConfig | ||
options: ResolvedEnvironmentOptions | ||
get logger(): Logger { | ||
return this.config.logger | ||
} | ||
constructor( | ||
name: string, | ||
config: ResolvedConfig, | ||
options: ResolvedEnvironmentOptions, | ||
) { | ||
this.name = name | ||
this.config = config | ||
this.options = options | ||
} | ||
} |
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
Oops, something went wrong.