Skip to content

chore(plugin-assets): updates to @twilio/cli-core v7 #419

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

Merged
merged 5 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/plugin-assets/bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env node

const oclif = require('@oclif/core');

// In dev mode -> use ts-node and dev plugins
process.env.NODE_ENV = 'development';

// In dev mode, always show stack traces
oclif.settings.debug = true;

// Configure the Twilio CLI environment
require('@twilio/cli-core').configureEnv();

// Start the CLI
oclif.run().then(oclif.flush).catch(oclif.Errors.handle);
3 changes: 3 additions & 0 deletions packages/plugin-assets/bin/dev.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@echo off

node "%~dp0\dev" %*
11 changes: 7 additions & 4 deletions packages/plugin-assets/bin/run
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/usr/bin/env node
// Load up the command module *first* so that we're the parent rather than
// some other dependency.
const command = require('@oclif/command');

const oclif = require('@oclif/core');

require('@twilio/cli-core').configureEnv();
command.run()
.then(require('@oclif/command/flush'))
.catch(require('@oclif/errors/handle'));

oclif
.run()
.then(require('@oclif/core/flush'))
.catch(require('@oclif/core/handle'));
Empty file modified packages/plugin-assets/bin/run.cmd
100644 → 100755
Empty file.
11 changes: 5 additions & 6 deletions packages/plugin-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,24 @@
"contributors": [
"Phil Nash <[email protected]>"
],
"main": "src/index.js",
"dependencies": {
"@oclif/command": "^1.5.19",
"@oclif/config": "^1.13.3",
"@oclif/core": "^1.14.2",
"@twilio-labs/serverless-api": "^5.4.4",
"@twilio/cli-core": "^6.0.0",
"@twilio/cli-core": "^7.0.0",
"inquirer": "^8.0.0",
"ora": "^5.4.0",
"project-name-generator": "^2.1.9"
},
"devDependencies": {
"@oclif/dev-cli": "^1.22.2",
"@oclif/plugin-help": "^2.2.1",
"@oclif/plugin-help": "^5.1.12",
"@oclif/test": "^1.2.5",
"@twilio/cli-test": "^2.1.1",
"jest": "^26.6.3",
"rimraf": "^3.0.2"
},
"engines": {
"node": ">=10"
"node": ">=14"
},
"files": [
"/oclif.manifest.json",
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-assets/src/commands/assets/init.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { flags } = require('@oclif/command');
const { Flags } = require('@oclif/core');
const { TwilioClientCommand } = require('@twilio/cli-core').baseCommands;
const { getPluginConfig } = require('../../pluginConfig');
const generateProjectName = require('project-name-generator');
Expand Down Expand Up @@ -28,11 +28,11 @@ class InitCommand extends TwilioClientCommand {
}

InitCommand.flags = {
'service-name': flags.string({
'service-name': Flags.string({
description:
'A unique name for your asset service. May only contain alphanumeric characters and hyphens.',
}),
properties: flags.string({
properties: Flags.string({
default: 'service_sid, sid, domain_name',
description:
'The asset service environment properties you would like to display (JSON output always shows all properties).',
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-assets/src/commands/assets/list.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { flags } = require('@oclif/command');
const { Flags } = require('@oclif/core');
const { TwilioClientCommand } = require('@twilio/cli-core').baseCommands;
const { getPluginConfig } = require('../../pluginConfig');
const { list } = require('../../list');
Expand All @@ -25,7 +25,7 @@ class ListCommand extends TwilioClientCommand {
ListCommand.description = 'List all the assets in the service';

ListCommand.flags = {
properties: flags.string({
properties: Flags.string({
default: 'sid, path, url, visibility',
description:
'The asset properties you would like to display (JSON output always shows all properties).',
Expand Down
6 changes: 3 additions & 3 deletions packages/plugin-assets/src/commands/assets/upload.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { flags } = require('@oclif/command');
const { Flags } = require('@oclif/core');
const { TwilioClientCommand } = require('@twilio/cli-core').baseCommands;
const { getPluginConfig } = require('../../pluginConfig');
const { upload } = require('../../upload');
Expand Down Expand Up @@ -37,11 +37,11 @@ UploadCommand.args = [
];

UploadCommand.flags = {
protected: flags.boolean({
protected: Flags.boolean({
default: false,
description: "Sets the uploaded asset's visibility to 'protected'",
}),
properties: flags.string({
properties: Flags.string({
default: 'sid, path, url, visibility',
description:
'The asset properties you would like to display (JSON output always shows all properties).',
Expand Down
2 changes: 2 additions & 0 deletions packages/plugin-assets/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const { run } = require('@oclif/core');
module.exports = run;