-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove tunnel flags #694
Remove tunnel flags #694
Conversation
IN-712 Remove tunnel flags from CLI
The following flags are related to the tunnel service and are no longer needed in the CLI. These should all be removed.
In addition, the |
0b27cfb
to
148989f
Compare
@ghengeveld @tmeasday Can one of you smoke test these changes locally? |
const diagnostics = getInput('diagnostics'); | ||
const debug = getInput('debug'); | ||
const storybookPort = getInput('storybookPort'); | ||
const storybookUrl = getInput('storybookUrl'); |
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 may want to reintroduce storybookUrl
at some point (not using the tunnel) because it's quite useful for quickly testing a random Storybook published somewhere (even if not on Chromatic).
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.
Nice!
action.yml
Outdated
required: false | ||
storybookPort: | ||
description: 'What port is your Storybook running on (auto detected from -s, if set)' | ||
required: false | ||
storybookUrl: | ||
description: 'Storybook is already running at (external) url (implies -S)' | ||
required: false |
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 think you missed storybookUrl
here.
bin-src/lib/getOptions.ts
Outdated
// TurboSnap requires a static build with a webpack stats file. | ||
if (options.onlyChanged) throw new Error(invalidOnlyChanged()); | ||
|
||
// Start Storybook on localhost and generate the URL to it | ||
if (!storybookUrl) { | ||
if (exec && !port) { | ||
throw new Error(missingStorybookPort()); | ||
} | ||
|
||
if (!exec && (!port || !noStart)) { | ||
// If you don't provide a port or we need to start the command, let's look up the script for it | ||
scriptName = scriptName || 'storybook'; | ||
const storybookScript = packageJson.scripts && packageJson.scripts[scriptName]; | ||
|
||
if (!storybookScript) { | ||
throw new Error(missingScriptName(scriptName)); | ||
} | ||
|
||
options.https = | ||
options.https || | ||
(getStorybookConfiguration(storybookScript, '--https') && { | ||
cert: resolveHomeDir(getStorybookConfiguration(storybookScript, '--ssl-cert')), | ||
key: resolveHomeDir(getStorybookConfiguration(storybookScript, '--ssl-key')), | ||
ca: resolveHomeDir(getStorybookConfiguration(storybookScript, '--ssl-ca')), | ||
}); | ||
|
||
port = port || getStorybookConfiguration(storybookScript, '-p', '--port'); | ||
if (!port) { | ||
throw new Error(unknownStorybookPort(scriptName)); | ||
} | ||
|
||
if (log) log.info('', inferredOptions({ scriptName, port })); | ||
} | ||
|
||
storybookUrl = `${options.https ? 'https' : 'http'}://localhost:${port}`; | ||
} | ||
|
||
return { | ||
...options, | ||
noStart, | ||
useTunnel: true, | ||
url: storybookUrl, | ||
scriptName, | ||
}; | ||
return 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.
These lines are unreachable after the throw
above.
The check for onlyChanged
was there because it's incompatible with starting Storybook rather than using a built Storybook. We can remove this check because we already check for the existence of the stats file and will just bail with missingStatsFile
if it doesn't exist, and continue running the build regardless.
bin-src/lib/getOptions.ts
Outdated
// Build Storybook | ||
if (storybookBuildDir) { | ||
return { ...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.
// Build Storybook | |
if (storybookBuildDir) { | |
return { ...options }; | |
} | |
// Use prebuilt Storybook | |
if (storybookBuildDir) { | |
return options; | |
} | |
// Look for a build-storybook script to build Storybook ourselves |
bin-src/tasks/index.ts
Outdated
export const runPatchBuild = (runBuild: typeof runUploadBuild) => [ | ||
prepareWorkspace, | ||
...runBuild, | ||
restoreWorkspace, | ||
]; |
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.
export const runPatchBuild = (runBuild: typeof runUploadBuild) => [ | |
prepareWorkspace, | |
...runBuild, | |
restoreWorkspace, | |
]; | |
export const runPatchBuild = [ | |
prepareWorkspace, | |
...runUploadBuild, | |
restoreWorkspace, | |
]; |
bin-src/tasks/index.ts
Outdated
const tasks = | ||
options.patchHeadRef && options.patchBaseRef ? runPatchBuild(runUploadBuild) : runUploadBuild; |
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.
const tasks = | |
options.patchHeadRef && options.patchBaseRef ? runPatchBuild(runUploadBuild) : runUploadBuild; | |
const tasks = | |
options.patchHeadRef && options.patchBaseRef ? runPatchBuild : runUploadBuild; |
d1f5e57
to
e20fc18
Compare
@ghengeveld Thanks for the suggestions! All updates completed. |
This includes related flags: - --storybook-cert - --storybook-key - --storybook-ca
e20fc18
to
50932b8
Compare
🚀 |
This cleans out all the deprecated flags related to tunnel builds.
Fixes IN-712