Skip to content
Open
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
48 changes: 24 additions & 24 deletions .github/workflows/pr_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,32 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }}

e2e-test:
needs: [ get-version, release-alpha-version ]
uses: ./.github/workflows/~reusable_e2e_all_OS.yaml
if: ${{ always() && ((github.event.label.name == vars.E2E_LABEL) || (github.event.label.name == vars.PUBLISH_AND_E2E_LABEL)) }}
with:
BRANCH: ${{ needs.get-version.outputs.branch }}
NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }}
PACKAGE_VERSION: ${{ github.event.label.name == vars.E2E_LABEL && 'latest' || needs.get-version.outputs.version }}
FLEX_UI_VERSION: latest
SEND_NOTIFICATION: false
secrets:
CONSOLE_EMAIL: ${{ secrets.CONSOLE_EMAIL }}
CONSOLE_PASSWORD: ${{ secrets.CONSOLE_PASSWORD }}
CONSOLE_EMAIL_linux: ${{ secrets.CONSOLE_EMAIL_linux }}
TWILIO_ACCOUNT_SID_linux: ${{ secrets.TWILIO_ACCOUNT_SID_linux }}
TWILIO_AUTH_TOKEN_linux: ${{ secrets.TWILIO_AUTH_TOKEN_linux }}
CONSOLE_EMAIL_win32: ${{ secrets.CONSOLE_EMAIL_win32 }}
TWILIO_ACCOUNT_SID_win32: ${{ secrets.TWILIO_ACCOUNT_SID_win32 }}
TWILIO_AUTH_TOKEN_win32: ${{ secrets.TWILIO_AUTH_TOKEN_win32 }}
CONSOLE_EMAIL_darwin: ${{ secrets.CONSOLE_EMAIL_darwin }}
TWILIO_ACCOUNT_SID_darwin: ${{ secrets.TWILIO_ACCOUNT_SID_darwin }}
TWILIO_AUTH_TOKEN_darwin: ${{ secrets.TWILIO_AUTH_TOKEN_darwin }}
SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }}
# e2e-test:
# needs: [ get-version, release-alpha-version ]
# uses: ./.github/workflows/~reusable_e2e_all_OS.yaml
# if: ${{ always() && ((github.event.label.name == vars.E2E_LABEL) || (github.event.label.name == vars.PUBLISH_AND_E2E_LABEL)) }}
# with:
# BRANCH: ${{ needs.get-version.outputs.branch }}
# NPM_IGNORE_PREFIX: ${{ vars.NPM_IGNORE_PREFIX }}
# PACKAGE_VERSION: ${{ github.event.label.name == vars.E2E_LABEL && 'latest' || needs.get-version.outputs.version }}
# FLEX_UI_VERSION: latest
# SEND_NOTIFICATION: false
# secrets:
# CONSOLE_EMAIL: ${{ secrets.CONSOLE_EMAIL }}
# CONSOLE_PASSWORD: ${{ secrets.CONSOLE_PASSWORD }}
# CONSOLE_EMAIL_linux: ${{ secrets.CONSOLE_EMAIL_linux }}
# TWILIO_ACCOUNT_SID_linux: ${{ secrets.TWILIO_ACCOUNT_SID_linux }}
# TWILIO_AUTH_TOKEN_linux: ${{ secrets.TWILIO_AUTH_TOKEN_linux }}
# CONSOLE_EMAIL_win32: ${{ secrets.CONSOLE_EMAIL_win32 }}
# TWILIO_ACCOUNT_SID_win32: ${{ secrets.TWILIO_ACCOUNT_SID_win32 }}
# TWILIO_AUTH_TOKEN_win32: ${{ secrets.TWILIO_AUTH_TOKEN_win32 }}
# CONSOLE_EMAIL_darwin: ${{ secrets.CONSOLE_EMAIL_darwin }}
# TWILIO_ACCOUNT_SID_darwin: ${{ secrets.TWILIO_ACCOUNT_SID_darwin }}
# TWILIO_AUTH_TOKEN_darwin: ${{ secrets.TWILIO_AUTH_TOKEN_darwin }}
# SLACK_WEB_HOOK: ${{ secrets.SLACK_WEB_HOOK }}

remove-label-on-failure:
needs: e2e-test
needs: release-alpha-version
if: always()
runs-on: ubuntu-22.04
steps:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/~reusable_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ jobs:
for i in 1 2 3; do # Retry logic, retry 3 times
timeout 10m npm ci --verbose && break || echo "npm ci failed, retrying ($i/3)..."
done
- name: Test npm auth
run: |
echo "Testing npm authentication..."
npm whoami
echo "Checking access to @twilio/flex-plugin..."
npm access ls-collaborators @twilio/flex-plugin || echo "Failed to check @twilio scope"
echo "Checking access to @twilio-labs/plugin-flex..."
npm access ls-collaborators @twilio-labs/plugin-flex || echo "Failed to check @twilio-labs scope"
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: Publish Version
run: npm run publish:${{ inputs.TAG }} ${{ inputs.VERSION }}
env:
Expand Down
2 changes: 2 additions & 0 deletions bin/publish
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@ npm run build

if [ "${tag}" == "public" ] ; then
./node_modules/.bin/lerna publish \
--loglevel verbose \
--force-publish="*" \
--no-push \
--exact \
--yes \
"${bump}"
else
./node_modules/.bin/lerna publish \
--loglevel verbose \
--force-publish="*" \
--preid "${tag}" \
--pre-dist-tag "${tag}" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ describe('create-flex-plugin', () => {
const mockTimeTaken = 123;
const mockConfig = {
accountSid: 'AC123456789',
pluginScriptsVersion: '1.0.0',
name: 'TestPlugin',
flexSdkVersion: '1.24.0',
typescript: true,
Expand Down
1 change: 0 additions & 1 deletion packages/create-flex-plugin/src/lib/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export const setupConfiguration = async (config: FlexPluginArguments): Promise<F
config.runtimeUrl = config.runtimeUrl || 'http://localhost:3000';
config.targetDirectory = resolveCwd(name);
config.flexSdkVersion = await packages.getLatestFlexUIVersion(2);
config.pluginScriptsVersion = pkg.devDependencies['@twilio/flex-plugin-scripts'];
config.flexPluginVersion = pkg.devDependencies['@twilio/flex-plugin'];
config.flexui2 = config.flexui2 || true;
config.flexui1 = config.flexui1 || false;
Expand Down
3 changes: 1 addition & 2 deletions packages/create-flex-plugin/src/lib/create-flex-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export interface FlexPluginArguments extends CLIArguments {
name: string;
targetDirectory: string;
flexSdkVersion: string;
pluginScriptsVersion: string;
flexPluginVersion: string;
pluginClassName: string;
pluginNamespace: string;
Expand Down Expand Up @@ -110,7 +109,7 @@ export const track = (timeTaken: number, config: FlexPluginArguments): void => {
const telemetry = new Telemetry();
const accountSid: string = String(config.accountSid);
const properties = {
cliVersion: config.pluginScriptsVersion,
cliVersion: config.flexPluginVersion,
command: 'create',
xtime: Math.round(timeTaken),
pluginName: config.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ describe('finalMessage', () => {
name: 'plugin-final-message',
targetDirectory: '/target/directory',
flexSdkVersion: '1.2.3-flex-sdk',
pluginScriptsVersion: '1.2.3-plugin-script',
flexPluginVersion: '1.2.3-plugin-flex',
pluginClassName: 'PluginFinalMessage',
pluginNamespace: 'PluginFinalMessage',
Expand Down
1 change: 0 additions & 1 deletion packages/create-flex-plugin/templates/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"react-emotion": "9.2.12"
},
"devDependencies": {
"@twilio/flex-plugin-scripts": "{{pluginScriptsVersion}}",
"@twilio/flex-ui": "{{flexSdkVersion}}",
"react-test-renderer": "16.5.2"
}
Expand Down
1 change: 0 additions & 1 deletion packages/create-flex-plugin/templates/js2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@twilio-paste/icons": "^9.2.0"
},
"devDependencies": {
"@twilio/flex-plugin-scripts": "{{pluginScriptsVersion}}",
"@twilio/flex-ui": "{{flexSdkVersion}}",
"react-test-renderer": "17.0.2"
}
Expand Down
1 change: 0 additions & 1 deletion packages/create-flex-plugin/templates/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"react-emotion": "9.2.12"
},
"devDependencies": {
"@twilio/flex-plugin-scripts": "{{pluginScriptsVersion}}",
"@twilio/flex-ui": "{{flexSdkVersion}}",
"react-test-renderer": "16.5.2",
"typescript": "^4"
Expand Down
1 change: 0 additions & 1 deletion packages/create-flex-plugin/templates/ts2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"@twilio-paste/icons": "^9.2.0"
},
"devDependencies": {
"@twilio/flex-plugin-scripts": "{{pluginScriptsVersion}}",
"@twilio/flex-ui": "{{flexSdkVersion}}",
"react-test-renderer": "17.0.2",
"typescript": "^4"
Expand Down
2 changes: 0 additions & 2 deletions packages/flex-dev-utils/src/__tests__/fs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,9 +877,8 @@
'@twilio/flex-plugin': '',
},
devDependencies: {
'@twilio/flex-plugin-scripts': '',
'not-a-valid-package': '',
} as any,

Check warning on line 881 in packages/flex-dev-utils/src/__tests__/fs.test.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected any. Specify a different type
});
expect(fs.isPluginFolder()).toBe(false);
expect(packageJson).toHaveBeenCalledTimes(1);
Expand All @@ -894,9 +893,8 @@
'@twilio/flex-plugin': '',
},
devDependencies: {
'@twilio/flex-plugin-scripts': '',
'@twilio/flex-ui': '^1',
} as any,

Check warning on line 897 in packages/flex-dev-utils/src/__tests__/fs.test.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected any. Specify a different type
});
expect(fs.isPluginFolder()).toBe(true);
});
Expand Down Expand Up @@ -961,13 +959,13 @@
addLocalFile: addLocalFileFn,
addLocalFolder: addLocalFolderFn,
writeZip: writeZipFn,
} as any);

Check warning on line 962 in packages/flex-dev-utils/src/__tests__/fs.test.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected any. Specify a different type

const statsSpy = jest.spyOn(fs.default, 'statSync');

const pathParseSpy = jest.spyOn(path, 'parse').mockReturnValue({
name: 'one',
} as any);

Check warning on line 968 in packages/flex-dev-utils/src/__tests__/fs.test.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected any. Specify a different type

const pathJoinSpy = jest.spyOn(path, 'join').mockReturnValue('/plugin/one');

Expand All @@ -975,13 +973,13 @@
isDirectory() {
return true;
},
} as any);

Check warning on line 976 in packages/flex-dev-utils/src/__tests__/fs.test.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected any. Specify a different type

statsSpy.mockReturnValueOnce({
isDirectory() {
return false;
},
} as any);

Check warning on line 982 in packages/flex-dev-utils/src/__tests__/fs.test.ts

View workflow job for this annotation

GitHub Actions / build-and-test

Unexpected any. Specify a different type

fs.zipPluginFiles(location, zipPath, ...files);

Expand Down
2 changes: 1 addition & 1 deletion packages/flex-dev-utils/src/errors/lib/FlexPluginError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class FlexPluginError extends TwilioError {
const { headline } = logger.coloredStrings;
if (this.pkg) {
const allDeps = { ...this.pkg.dependencies, ...this.pkg.devDependencies };
const names = ['@twilio/flex-plugin', '@twilio/flex-plugin-scripts'];
const names = ['@twilio/flex-plugin'];

logger.newline();
logger.info(`Your plugin ${this.pkg.name} is using the following versions:`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,13 @@ describe('FlexPluginError', () => {
dependencies: {
'@twilio/flex-plugin': '2.0.0',
},
devDependencies: {
'@twilio/flex-plugin-scripts': '3.0.0',
},
devDependencies: {},
});

const err = new FlexPluginError();

err.details();
expect(logger.info).toHaveBeenCalledTimes(3);
expect(logger.info).toHaveBeenCalledTimes(2);
});

it('should not print any details if pkg is not found', () => {
Expand Down
3 changes: 0 additions & 3 deletions packages/flex-dev-utils/src/fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import AdmZip from 'adm-zip';

import { confirm } from './questions';
import { logger } from './logger';

Check warning on line 15 in packages/flex-dev-utils/src/fs.ts

View workflow job for this annotation

GitHub Actions / build-and-test

'logger' is defined but never used

const flexUI = '@twilio/flex-ui';
const react = 'react';
Expand All @@ -30,9 +30,6 @@
dependencies: {
'@twilio/flex-plugin': string;
};
devDependencies: {
'@twilio/flex-plugin-scripts': string;
};
}

export interface FlexConfigurationPlugin {
Expand Down
2 changes: 1 addition & 1 deletion packages/flex-plugin-e2e-tests/src/tests/step002.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const testSuite: TestSuite = async ({ scenario, config }: TestParams): Promise<v
// Assert package.json
assertion.jsonFileContains(
[plugin1.dir, 'package.json'],
"devDependencies['@twilio/flex-plugin-scripts']",
"dependencies['@twilio/flex-plugin']",
scenario.packageVersion,
);
assertion.jsonFileContains([plugin1.dir, 'package.json'], "dependencies['react']", `17.0.2`);
Expand Down
4 changes: 2 additions & 2 deletions packages/flex-plugin-e2e-tests/src/tests/step003.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ const testSuite: TestSuite = async ({ scenario }: TestParams): Promise<void> =>
// await spawn('npm', ['i'], { cwd: plugin.dir });

assertion.fileExists([plugin.dir, 'node_modules']);
assertion.fileExists([plugin.dir, 'node_modules', '@twilio/flex-plugin-scripts']);
assertion.fileExists([plugin.dir, 'node_modules', '@twilio/flex-plugin']);
assertion.jsonFileContains(
[plugin.dir, 'node_modules', '@twilio/flex-plugin-scripts', 'package.json'],
[plugin.dir, 'node_modules', '@twilio/flex-plugin', 'package.json'],
'version',
scenario.packageVersion,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ describe('WebpackConfiguration', () => {

describe('_getBasePlugins', () => {
const depVersions = {
'@twilio/flex-plugin-scripts': '1.0.0',
'@twilio/flex-plugin': '1.1.0',
'@twilio/flex-ui': '1.2.0',
react: '1.3.0',
Expand All @@ -196,7 +195,6 @@ describe('WebpackConfiguration', () => {
expect.objectContaining({
__FPB_PLUGIN_UNIQUE_NAME: `'${paths.app.name}'`,
__FPB_PLUGIN_VERSION: `'${paths.app.version}'`,
__FPB_FLEX_PLUGIN_SCRIPTS_VERSION: `'${depVersions['@twilio/flex-plugin-scripts']}'`,
__FPB_FLEX_PLUGIN_VERSION: `'${depVersions['@twilio/flex-plugin']}'`,
__FPB_FLEX_UI_VERSION: `'${depVersions['@twilio/flex-ui']}'`,
__FPB_REACT_VERSION: `'${depVersions.react}'`,
Expand Down
2 changes: 1 addition & 1 deletion packages/flex-plugin-webpack/src/webpack/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ export const _getBasePlugins = (environment: Environment): Plugin[] => {
const defined = {
__FPB_PLUGIN_UNIQUE_NAME: `'${getPaths().app.name}'`,
__FPB_PLUGIN_VERSION: `'${getPaths().app.version}'`,
__FPB_FLEX_PLUGIN_SCRIPTS_VERSION: `'${getDependencyVersion('@twilio/flex-plugin-scripts')}'`,
__FPB_FLEX_PLUGIN_VERSION: `'${getDependencyVersion('@twilio/flex-plugin')}'`,
__FPB_FLEX_UI_VERSION: `'${flexUIVersion}'`,
__FPB_REACT_VERSION: `'${reactVersion}'`,
Expand Down Expand Up @@ -325,6 +324,7 @@ export const _getJSPlugins = (environment: Environment): Plugin[] => {
tsconfig: getPaths().app.tsConfigPath,
reportFiles: [
'**',
'!**/node_modules/**',
'!**/__tests__/**',
'!**/__mocks__/**',
'!**/?(*.)(spec|test).*',
Expand Down
3 changes: 0 additions & 3 deletions packages/flex-plugin/src/lib/__tests__/flex-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
const PLUGIN_NAME = 'Test Plugin';
const PLUGIN_VERSION = '1.0.0';
const UNIQUE_NAME = 'plugin-identifier';
const FLEX_PLUGIN_SCRIPTS_VERSION = '2.0.0';

Check warning on line 18 in packages/flex-plugin/src/lib/__tests__/flex-plugin.test.ts

View workflow job for this annotation

GitHub Actions / build-and-test

'FLEX_PLUGIN_SCRIPTS_VERSION' is assigned a value but never used
const FLEX_PLUGIN_VERSION = '2.1.0';
const FLEX_UI_VERSION = '2.3.0';
const REACT_VERSION = '2.4.0';
Expand All @@ -25,8 +25,6 @@
// @ts-ignore
global.__FPB_PLUGIN_VERSION = PLUGIN_VERSION;
// @ts-ignore
global.__FPB_FLEX_PLUGIN_SCRIPTS_VERSION = FLEX_PLUGIN_SCRIPTS_VERSION;
// @ts-ignore
global.__FPB_FLEX_PLUGIN_VERSION = FLEX_PLUGIN_VERSION;
// @ts-ignore
global.__FPB_FLEX_UI_VERSION = FLEX_UI_VERSION;
Expand Down Expand Up @@ -67,7 +65,6 @@
expect(plugin.name).toEqual(PLUGIN_NAME);
expect(plugin.version).toEqual(PLUGIN_VERSION);
expect(plugin.uniqueName).toEqual(UNIQUE_NAME);
expect(plugin.dependencies['@twilio/flex-plugin-scripts']).toEqual(FLEX_PLUGIN_SCRIPTS_VERSION);
expect(plugin.dependencies['@twilio/flex-plugin']).toEqual(FLEX_PLUGIN_VERSION);
expect(plugin.dependencies['flex-ui']).toEqual(FLEX_UI_VERSION);
expect(plugin.dependencies.react).toEqual(REACT_VERSION);
Expand Down
1 change: 0 additions & 1 deletion packages/flex-plugin/src/lib/flex-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export abstract class FlexPlugin implements IFlexPlugin {
public version: string = __FPB_PLUGIN_VERSION;

public dependencies: Record<string, string> = {
'@twilio/flex-plugin-scripts': __FPB_FLEX_PLUGIN_SCRIPTS_VERSION,
'@twilio/flex-plugin': __FPB_FLEX_PLUGIN_VERSION,
'flex-ui': __FPB_FLEX_UI_VERSION,
react: __FPB_REACT_VERSION,
Expand Down
1 change: 0 additions & 1 deletion packages/flex-plugin/src/module.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ declare const Twilio: {

declare const __FPB_PLUGIN_UNIQUE_NAME: string;
declare const __FPB_PLUGIN_VERSION: string;
declare const __FPB_FLEX_PLUGIN_SCRIPTS_VERSION: string;
declare const __FPB_FLEX_PLUGIN_VERSION: string;
declare const __FPB_FLEX_UI_VERSION: string;
declare const __FPB_REACT_VERSION: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Commands/FlexPluginsStart', () => {
const pkg = {
name: pluginNameOne,
dependencies: {
'@twilio/flex-plugin-scripts': '4.0.0',
'@twilio/flex-plugin': '4.0.0',
},
};
const badVersionPkg = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,22 @@ describe('Commands/FlexPluginsStart', () => {
expect(cmd.getTopicName()).toContain(FlexPluginsUpgradePlugin.topicName);
});

it('should should return then version of @twilio/flex-plugin-scripts from dependencies', async () => {
it('should should return then version of @twilio/flex-plugin from dependencies', async () => {
const cmd = await createCommand();

mockGetPkg(cmd, {
dependencies: { '@twilio/flex-plugin-scripts': '3.0.0' },
dependencies: { '@twilio/flex-plugin': '3.0.0' },
devDependencies: {},
});
expect(cmd.pkgVersion).toEqual(3);
});

it('should should return the version of @twilio/flex-plugin-scripts from devDependencies', async () => {
it('should should return the version of @twilio/flex-plugin from devDependencies', async () => {
const cmd = await createCommand();

mockGetPkg(cmd, {
dependencies: {},
devDependencies: { '@twilio/flex-plugin-scripts': '4.0.0' },
devDependencies: { '@twilio/flex-plugin': '4.0.0' },
});

expect(cmd.pkgVersion).toEqual(4);
Expand Down Expand Up @@ -738,7 +738,6 @@ describe('Commands/FlexPluginsStart', () => {
devDependencies: {
'@twilio/flex-ui': '^1',
'react-test-renderer': '16.0.0',
'@twilio/flex-plugin-scripts': '4.1.3',
},
dependencies: {
react: '15.0.2',
Expand All @@ -754,7 +753,6 @@ describe('Commands/FlexPluginsStart', () => {
'react-dom': 'react || 16.5.2',
},
devDeps: {
'@twilio/flex-plugin-scripts': '*',
'@twilio/flex-ui': '^1',
'react-test-renderer': 'react || 16.5.2',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ describe('SubCommands/FlexPlugin', () => {
jest.spyOn(fs, 'readJsonFile').mockReturnValue({
devDependencies: {},
dependencies: {
'@twilio/flex-plugin-scripts': '1.2.3',
'@twilio/flex-plugin': '1.2.3',
},
});

Expand All @@ -258,7 +258,7 @@ describe('SubCommands/FlexPlugin', () => {

jest.spyOn(fs, 'readJsonFile').mockReturnValue({
devDependencies: {
'@twilio/flex-plugin-scripts': '^2.3.4-beta.0',
'@twilio/flex-plugin': '^2.3.4-beta.0',
},
dependencies: {},
});
Expand All @@ -271,7 +271,7 @@ describe('SubCommands/FlexPlugin', () => {

jest.spyOn(fs, 'readJsonFile').mockReturnValue({
devDependencies: {
'@twilio/flex-plugin-scripts': 'not-a-semver',
'@twilio/flex-plugin': 'not-a-semver',
},
dependencies: {},
});
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-flex/src/commands/flex/plugins/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ export default class FlexPluginsStart extends FlexPlugin {
// Verify plugin's flex-plugin-scripts is v4
const pkgDir = `${plugin.dir}/package.json`;
const pkg = readJsonFile<Pkg>(pkgDir);
let scriptVersion = semver.coerce(pkg.dependencies['@twilio/flex-plugin-scripts']);
let scriptVersion = semver.coerce(pkg.dependencies['@twilio/flex-plugin']);
if (!scriptVersion) {
scriptVersion = semver.coerce(pkg.devDependencies['@twilio/flex-plugin-scripts']);
scriptVersion = semver.coerce(pkg.devDependencies['@twilio/flex-plugin']);
}
}

Expand Down
Loading
Loading