-
Notifications
You must be signed in to change notification settings - Fork 141
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
feat(cli): ENG-5881 dynamic cli options #2773
feat(cli): ENG-5881 dynamic cli options #2773
Conversation
ec5e995
to
3eeabf2
Compare
314b661
to
c191bce
Compare
4717ca8
to
462b75f
Compare
462b75f
to
33b3a97
Compare
"example": "--app-env-initial development" | ||
}, | ||
{ | ||
"flags": "--app-env-dir <value>", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We technically could aggregate this with babel traversal and looking at imports etc.
packages/cli/src/lib/commands.ts
Outdated
/** | ||
* The name of a global function to parse the input value. | ||
*/ | ||
parse?: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove - decided not to use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
packages/cli/src/lib/commands.ts
Outdated
const aggregatedOptions: CommandOption[] = []; | ||
|
||
if (configFiles.length === 0) { | ||
console.warn(`No ${CONFIG_FILE_NAME} files found.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this need to be warning? can't we just have plugins without custom options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah true - I will remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
@@ -8,7 +8,8 @@ import { | |||
} from '@brandingbrand/code-cli-kit'; | |||
import type {XcodeProject, PBXFile} from 'xcode'; | |||
|
|||
import {Transforms, defineTransformer} from '@/lib'; | |||
import {FSAPP_DEPENDENCY, Transforms, defineTransformer} from '@/lib'; | |||
import {hasDependency, matchesFilePatterns} from '@/lib/dependencies'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
matchesFilePatterns unused
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's used in the fileFilter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing fileFilter in this file either
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh was looking at wrong file - good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
if (!options.appEnvDir) { | ||
throw new MissingOptionError('appEnvDir'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably also need to verify that these folders exist and the initial environment exists in the app environment directory. currently it seems like it works fine if I input invalid values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah we could add additional validation of the directory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
76cda37
into
brandingbrand:feature/app-router
Describe your changes
This PR enhances Flagship Code by introducing dynamic environment configuration and validation, along with improvements to iOS and Android plugins. The changes streamline the handling of environment-specific builds and improve the flexibility of CLI commands.
Key Changes
Dynamic Environment Configuration:
.flagshipappenvrc
file.singleEnv
flag to enforce single environment selection during release builds.Plugin Enhancements:
MissingOptionError
) for missing plugin options.validateOptions
andwriteEnvConfig
helper functions for managing environment configurations in iOS and Android plugins.New CLI Command Options:
--app-env-initial
,--app-env-dir
, and--app-env-hide
flags to customize environment settings dynamically.flagship-code.commands.json
to ensure CLI options conform to a standard structure.Dependency Checks:
@brandingbrand/fsapp
dependency.hasDependency
andmatchesFilePatterns
for dependency-based filtering.Testing and Configuration:
project-pbxproj
tests.find-node-modules
,glob
,ajv
) for improved file and schema handling.Issue ticket number and link
Type of change
Test Plan
Checklist before requesting a review