Skip to content

Commit

Permalink
chore: deprecate lm command (#5975)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaelig authored Sep 1, 2023
1 parent 34e0faa commit 8441878
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 43 deletions.
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ See the [CLI command line reference](https://cli.netlify.com/commands/) to get s
- [functions](#functions)
- [init](#init)
- [link](#link)
- [lm](#lm)
- [login](#login)
- [open](#open)
- [recipes](#recipes)
Expand Down Expand Up @@ -170,17 +169,6 @@ Configure continuous deployment for a new or existing site. To create a new site

Link a local repo or project folder to an existing site on Netlify

### [lm](/docs/commands/lm.md)

Handle Netlify Large Media operations

| Subcommand | description |
|:--------------------------- |:-----|
| [`lm:info`](/docs/commands/lm.md#lminfo) | Show large media requirements information. |
| [`lm:install`](/docs/commands/lm.md#lminstall) | Configures your computer to use Netlify Large Media |
| [`lm:setup`](/docs/commands/lm.md#lmsetup) | Configures your site to use Netlify Large Media |


### [login](/docs/commands/login.md)

Login to your Netlify account
Expand Down
11 changes: 0 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,6 @@ Configure continuous deployment for a new or existing site. To create a new site

Link a local repo or project folder to an existing site on Netlify

### [lm](/docs/commands/lm.md)

Handle Netlify Large Media operations

| Subcommand | description |
|:--------------------------- |:-----|
| [`lm:info`](/docs/commands/lm.md#lminfo) | Show large media requirements information. |
| [`lm:install`](/docs/commands/lm.md#lminstall) | Configures your computer to use Netlify Large Media |
| [`lm:setup`](/docs/commands/lm.md#lmsetup) | Configures your site to use Netlify Large Media |


### [login](/docs/commands/login.md)

Login to your Netlify account
Expand Down
11 changes: 0 additions & 11 deletions docs/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,6 @@ Configure continuous deployment for a new or existing site. To create a new site

Link a local repo or project folder to an existing site on Netlify

### [lm](/docs/commands/lm.md)

Handle Netlify Large Media operations

| Subcommand | description |
|:--------------------------- |:-----|
| [`lm:info`](/docs/commands/lm.md#lminfo) | Show large media requirements information. |
| [`lm:install`](/docs/commands/lm.md#lminstall) | Configures your computer to use Netlify Large Media |
| [`lm:setup`](/docs/commands/lm.md#lmsetup) | Configures your site to use Netlify Large Media |


### [login](/docs/commands/login.md)

Login to your Netlify account
Expand Down
5 changes: 3 additions & 2 deletions docs/commands/lm.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ title: Netlify CLI lm command

## About

<!-- AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_DOCS) -->
> ⚠️ The Large Media feature was deprecated on September 1st, 2023 and will become unavailable in a future update. [Learn more and discover alternative solutions](https://answers.netlify.com/t/large-media-feature-deprecated-but-not-removed/100804)
Handle Netlify Large Media operations

The lm command will help you manage large media for a site

**Usage**
Expand Down Expand Up @@ -89,5 +91,4 @@ netlify lm:setup
- `debug` (*boolean*) - Print debugging information

---

<!-- AUTO-GENERATED-CONTENT:END -->
1 change: 1 addition & 0 deletions site/src/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const pageNames = {
'netlify-dev': 'Netlify Dev',
'functions-dev': 'Functions Development',
vscode: 'Run and debug with VSCode',
lm: 'lm (deprecated)',
}

const sortRoutes = (routes) =>
Expand Down
2 changes: 1 addition & 1 deletion src/commands/lm/lm-info.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ const lmInfo = async () => {
* @returns
*/
export const createLmInfoCommand = (program) =>
program.command('lm:info').description('Show large media requirements information.').action(lmInfo)
program.command('lm:info', { hidden: true }).description('Show large media requirements information.').action(lmInfo)
2 changes: 1 addition & 1 deletion src/commands/lm/lm-install.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const lmInstall = async ({ force }) => {
*/
export const createLmInstallCommand = (program) =>
program
.command('lm:install')
.command('lm:install', { hidden: true })
.alias('lm:init')
.description(
`Configures your computer to use Netlify Large Media
Expand Down
18 changes: 16 additions & 2 deletions src/commands/lm/lm-setup.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// @ts-check
import inquirer from 'inquirer'
import Listr from 'listr'

import { error } from '../../utils/command-helpers.mjs'
import { error, exit } from '../../utils/command-helpers.mjs'
import execa from '../../utils/execa.mjs'
import { installPlatform } from '../../utils/lm/install.mjs'
import { checkHelperVersion } from '../../utils/lm/requirements.mjs'
Expand Down Expand Up @@ -56,6 +57,19 @@ const configureLFSURL = async function (siteId, api) {
* @param {import('../base-command.mjs').default} command
*/
const lmSetup = async (options, command) => {
if (!options.force && !options.f) {
const { wantsToProceed } = await inquirer.prompt({
type: 'confirm',
name: 'wantsToProceed',
message:
'Large media is a deprecated feature and will be removed in a future version. Are you sure you want to continue? (to skip this prompt, pass a --force flag)',
default: false,
})
if (!wantsToProceed) {
exit()
}
}

await command.authenticate()

const { api, site } = command.netlify
Expand Down Expand Up @@ -97,7 +111,7 @@ const lmSetup = async (options, command) => {
*/
export const createLmSetupCommand = (program) =>
program
.command('lm:setup')
.command('lm:setup', { hidden: true })
.description('Configures your site to use Netlify Large Media')
.option('-s, --skip-install', 'Skip the credentials helper installation check')
.option('-f, --force-install', 'Force the credentials helper installation')
Expand Down
6 changes: 4 additions & 2 deletions src/commands/lm/lm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ export const createLmCommand = (program) => {
createLmUninstallCommand(program)

program
.command('lm')
.description('Handle Netlify Large Media operations\nThe lm command will help you manage large media for a site')
.command('lm', { hidden: true })
.description(
'[Deprecated and will be removed from future versions] Handle Netlify Large Media operations\nThe lm command will help you manage large media for a site',
)
.addExamples(['netlify lm:info', 'netlify lm:install', 'netlify lm:setup'])
.action(lm)
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ COMMANDS
sites:create\`
$ link Link a local repo or project folder to an existing site on
Netlify
$ lm Handle Netlify Large Media operations
$ login Login to your Netlify account
$ open Open settings for the site linked to the current folder
$ serve (Beta) Build the site for production and serve locally. This
Expand Down

3 comments on commit 8441878

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,331
  • Package size: 295 MB

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,331
  • Package size: 295 MB

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,331
  • Package size: 295 MB

Please sign in to comment.