Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
d56cf86
Remove language specific features from core and into runtime plugin
benbrown Jun 22, 2020
0009789
slight refactor of azurefunctionspublish to use new runtime config
benbrown Jun 23, 2020
86782e8
cleanup a bit of the azurepublish plugin for readability
benbrown Jun 23, 2020
4a6d454
move some code, add some comments
benbrown Jun 23, 2020
fdf56c6
Merge branch 'wenyluo/jsRuntime' of github.com:microsoft/BotFramework…
benbrown Jun 24, 2020
f8d759f
refactor bot project deploy and split into several sub-classes. move …
benbrown Jun 24, 2020
0f7016c
remove bot-deploy package
benbrown Jun 24, 2020
0fdc2b7
remove azureFunctionsPublish (replaced by azureFunctions)
benbrown Jun 24, 2020
8862a62
fix to node runtime
benbrown Jun 25, 2020
68a5f92
allow start bot button to be async
benbrown Jun 26, 2020
894f882
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown Jun 26, 2020
f33013c
clean up dependencies, paths
benbrown Jun 26, 2020
d3fc07c
remove rimraf yarn.lock in package.json and catch error during setBot
VanyLaw Jun 28, 2020
2a7a536
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown Jun 29, 2020
72e3d10
Merge branch 'benbrown/pluginapis' of github.com:microsoft/BotFramewo…
benbrown Jun 29, 2020
0ebc0aa
merge settings and write once inside the runtime plugin
benbrown Jun 30, 2020
6c879fd
make sure to use exec instead of execSync
benbrown Jun 30, 2020
70e06fc
make sure everything happens in the right order
benbrown Jun 30, 2020
e052ed5
identify runtime by name field
benbrown Jun 30, 2020
90a7b34
merge master and fix conflict
VanyLaw Jul 1, 2020
7152620
update luis package in azurePublish plugin and fix getRuntimeByProject
VanyLaw Jul 1, 2020
5dfccde
remove lib folder in azurePublish
VanyLaw Jul 1, 2020
923f3c0
handle merge conflict
VanyLaw Jul 1, 2020
805c71b
test: increase 'adaptive-flow' test coverage to 77% (#3530)
yeze322 Jul 1, 2020
ab5dc06
update a test case (#3531)
liweitian Jul 1, 2020
4242f7c
fix lgWorker test failure (#3529)
zhixzhan Jul 1, 2020
6da544b
chore: adds webpack bundle analyzer (#3542)
hatpick Jul 1, 2020
1c4e41c
refactor: split some actions off setSettings (#3525)
beyackle Jul 2, 2020
a2dcf99
fix: Dialog validate throw error when delete an action (#3537)
lei9444 Jul 2, 2020
317dac2
Merge branch 'master' of github.com:microsoft/BotFramework-Composer i…
benbrown Jul 2, 2020
bcc24fa
use const instead of raw http status values
benbrown Jul 2, 2020
c807ff3
rename js runtime to node-azurewebapp
benbrown Jul 2, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,18 @@
"port": 9228,
"sourceMaps": true
}
{
"type": "node",
"request": "launch",
"name": "Electron Main Process",
"runtimeExecutable": "${workspaceRoot}/Composer/node_modules/.bin/electron",
"args": [
"${workspaceRoot}/Composer/packages/electron-server",
],
"env": {
"NODE_ENV": "development",
},
"outputCapture": "std"
}
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
{
"files.trimTrailingWhitespace": true,
"files.associations": {
"*.dialog": "json",
"*.botproj": "json",
"*.schema": "json"
},
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/node_modules": true,
"**/build": true
},
"eslint.enable": true,
"eslint.packageManager": "yarn",
"eslint.validate": [
Expand All @@ -14,6 +21,7 @@
],
"eslint.workingDirectories": ["./Composer"],
"typescript.tsdk": "./Composer/node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
Expand Down
10 changes: 10 additions & 0 deletions Composer/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ module.exports = {
yoda: 'error',
'no-bitwise': 'error',
// eqeqeq: 'error',
'no-underscore-dangle': [
'error',
{
// add special window.__foo__ names as exceptions here
allow: ['__nonce__', '__IS_ELECTRON__'],
// allow this._name so custom getters and setters can be written gracefully
allowAfterThis: true,
enforceInMethodNames: true,
},
],

// plugin: import
'import/first': 'error',
Expand Down
3 changes: 3 additions & 0 deletions Composer/cypress/integration/LGPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ context('LG Page', () => {
// back to table view
cy.get('@switchButton').click();

// click the logo to clear any stray navigation
cy.findByAltText('Composer Logo').click();

// nav to Main dialog
cy.findByTestId('ProjectTree').within(() => {
cy.findByText('__TestTodoSample').click();
Expand Down
3 changes: 3 additions & 0 deletions Composer/cypress/integration/NotificationPage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ context('Notification Page', () => {
it('can show dialog expression error ', () => {
cy.visitPage('Design');

// click the logo to clear any stray tooltips from page navigation
cy.findByAltText('Composer Logo').click();

cy.findByTestId('ProjectTree').within(() => {
cy.findByText('WelcomeUser').click();
});
Expand Down
15 changes: 9 additions & 6 deletions Composer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"serialize-javascript": "^3.1.0",
"lodash": "^4.17.12",
"set-value": "^3.0.2",
"kind-of": "^6.0.3"
"kind-of": "^6.0.3",
"elliptic": "^6.5.3"
},
"engines": {
"node": ">=12"
Expand All @@ -26,9 +27,7 @@
"packages/tools",
"packages/tools/language-servers",
"packages/tools/language-servers/*",
"packages/ui-plugins/*",
"packages/plugins",
"packages/plugins/*"
"packages/ui-plugins/*"
],
"scripts": {
"build": "node scripts/begin.js && yarn build:prod && yarn build:plugins",
Expand All @@ -41,7 +40,11 @@
"build:server": "yarn workspace @bfc/server build",
"build:client": "yarn workspace @bfc/client build",
"build:tools": "yarn workspace @bfc/tools build:all",
"build:plugins": "wsrun -lt -p @bfc/plugin-samples @bfc/plugin-azure-publish @bfc/plugin-azure-functions-publish @bfc/plugin-localpublish -c build",
"build:plugins": "yarn build:plugins:localpublish && yarn build:plugins:samples && yarn build:plugins:azurePublish && yarn build:plugins:runtimes",
"build:plugins:localpublish": "cd plugins/localPublish && yarn install && yarn build",
"build:plugins:samples": "cd plugins/samples && yarn install && yarn build",
"build:plugins:azurePublish": "cd plugins/azurePublish && yarn install && yarn build",
"build:plugins:runtimes": "cd plugins/runtimes && yarn install && yarn build",
"start": "cross-env NODE_ENV=production PORT=3000 yarn start:server",
"startall": "yarn start",
"start:dev": "concurrently \"npm:start:client\" \"npm:start:server:dev\"",
Expand Down Expand Up @@ -117,4 +120,4 @@
"dependencies": {
"cross-env": "^6.0.3"
}
}
}
2 changes: 1 addition & 1 deletion Composer/packages/client/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function getClientEnvironment(publicUrl) {
SDK_PACKAGE_VERSION: '4.9.3', // TODO: change this when Composer supports custom schema/custom runtime
COMPOSER_VERSION: '1.0.1',
LOCAL_PUBLISH_PATH:
process.env.LOCAL_PUBLISH_PATH || path.resolve(process.cwd(), '../plugins/localPublish/hostedBots'),
process.env.LOCAL_PUBLISH_PATH || path.resolve(process.cwd(), '../../plugins/localPublish/hostedBots'),
}
);
// Stringify all values so we can feed into Webpack DefinePlugin
Expand Down
1 change: 1 addition & 0 deletions Composer/packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@types/reach__router": "^1.2.4",
"@types/react": "16.9.23",
"@types/react-dom": "16.9.5",
"@types/webpack-env": "^1.15.2",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.1.0",
"babel-loader": "8.0.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type SortState = {
descending: boolean;
};

const _renderIcon = (file: File) => {
const renderIcon = (file: File) => {
const iconName = getFileIconName(file);
if (iconName === FileTypes.FOLDER) {
return <Icon iconName="OpenFolderHorizontal" style={{ fontSize: '16px' }} />;
Expand All @@ -60,7 +60,7 @@ const _renderIcon = (file: File) => {
return <img alt={`${iconName} file icon`} className={detailListClass.fileIconImg} src={url} />;
};

const _renderNameColumn = (onFileChosen: (file: File) => void) => (file: File) => {
const renderNameColumn = (onFileChosen: (file: File) => void) => (file: File) => {
const iconName = getFileIconName(file);
return (
<div data-is-focusable css={tableCell}>
Expand Down Expand Up @@ -105,7 +105,7 @@ export const FileSelector: React.FC<FileSelectorProps> = (props) => {
fieldName: 'name',
minWidth: 16,
maxWidth: 16,
onRender: _renderIcon,
onRender: renderIcon,
},
{
key: 'name',
Expand All @@ -118,7 +118,7 @@ export const FileSelector: React.FC<FileSelectorProps> = (props) => {
sortAscendingAriaLabel: formatMessage('Sorted A to Z'),
sortDescendingAriaLabel: formatMessage('Sorted Z to A'),
data: 'string',
onRender: _renderNameColumn(onFileChosen),
onRender: renderNameColumn(onFileChosen),
isPadded: true,
},
{
Expand Down
6 changes: 3 additions & 3 deletions Composer/packages/client/src/components/ErrorPopup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type ErrorPopupProps = {
export const ErrorPopup = (props: ErrorPopupProps) => {
const [hidden, setHidden] = useState(props.error ? false : true);

const _closeDialog = () => {
const closeDialog = () => {
setHidden(true);
props.onDismiss();
};
Expand All @@ -35,11 +35,11 @@ export const ErrorPopup = (props: ErrorPopupProps) => {
isBlocking: false,
styles: { main: { maxWidth: 450 } },
}}
onDismiss={_closeDialog}
onDismiss={closeDialog}
>
<div css={consoleStyle}>{props.error}</div>
<DialogFooter>
<PrimaryButton text="Ok" onClick={_closeDialog} />
<PrimaryButton text="Ok" onClick={closeDialog} />
</DialogFooter>
</Dialog>
);
Expand Down
24 changes: 23 additions & 1 deletion Composer/packages/client/src/components/TestController/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ export const TestController: React.FC = () => {
const botActionRef = useRef(null);
const notifications = useNotifications();
const { botEndpoints, botName, botStatus, dialogs, luFiles, settings, projectId, botLoadErrorMsg } = state;
const { publishToTarget, onboardingAddCoachMarkRef, publishLuis, getPublishStatus, setBotStatus } = actions;
const {
publishToTarget,
onboardingAddCoachMarkRef,
publishLuis,
getPublishStatus,
setBotStatus,
startPollingRuntime,
stopPollingRuntime,
} = actions;
const connected = botStatus === BotStatus.connected;
const publishing = botStatus === BotStatus.publishing;
const reloading = botStatus === BotStatus.reloading;
Expand All @@ -48,12 +56,26 @@ export const TestController: React.FC = () => {
switch (botStatus) {
case BotStatus.failed:
openCallout();
stopPollingRuntime();
setBotStatus(BotStatus.pending);
break;
case BotStatus.published:
stopPollingRuntime();
handleLoadBot();
break;
case BotStatus.reloading:
startPollingRuntime();
break;
default:
case BotStatus.connected:
stopPollingRuntime();
break;
}
// return the stoppolling function so the component will clean up
return () => {
stopPollingRuntime();
return;
};
}, [botStatus]);

function dismissDialog() {
Expand Down
3 changes: 2 additions & 1 deletion Composer/packages/client/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export enum ActionTypes {
REMOVE_SKILL_MANIFEST = 'REMOVE_SKILL_MANIFEST',
DISPLAY_SKILL_MANIFEST_MODAL = 'DISPLAY_SKILL_MANIFEST_MODAL',
DISMISS_SKILL_MANIFEST_MODAL = 'DISMISS_SKILL_MANIFEST_MODAL',
RUNTIME_POLLING_UPDATE = 'RUNTIME_POLLING_UPDATE',
}

export const Tips = {
Expand Down Expand Up @@ -251,7 +252,7 @@ export enum AppUpdaterStatus {

export const DefaultPublishConfig = {
name: 'default',
type: '@bfc/plugin-localpublish',
type: 'localpublish',
};

export const EmptyBotTemplateId = 'EmptyBot';
Expand Down
36 changes: 28 additions & 8 deletions Composer/packages/client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import './index.css';
import { App } from './App';
import { StoreProvider } from './store';

const appHostElm = document.getElementById('root');

formatMessage.setup({
missingTranslation: 'ignore',
});
Expand All @@ -20,11 +22,29 @@ const emotionCache = createCache({
nonce: window.__nonce__,
});

ReactDOM.render(
<CacheProvider value={emotionCache}>
<StoreProvider>
<App />
</StoreProvider>
</CacheProvider>,
document.getElementById('root')
);
/**
* Renders the React App module.
*/
const renderApp = (AppComponent: typeof App) => {
ReactDOM.render(
<CacheProvider value={emotionCache}>
<StoreProvider>
<AppComponent />
</StoreProvider>
</CacheProvider>,
appHostElm
);
};

// Rendering the App for the first time.
renderApp(App);

/**
* Re-render updated App Module when hot module notifies a change.
*/
if (module.hot) {
module.hot.accept('./App', () => {
const NextApp = require<{ App: typeof App }>('./App').App;
renderApp(NextApp);
});
}
2 changes: 2 additions & 0 deletions Composer/packages/client/src/pages/design/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ const DesignPage: React.FC<RouteComponentProps<{ dialogId: string; projectId: st
onBreadcrumbItemClick: handleBreadcrumbItemClick,
promptTab: getTabFromFragment(),
});
/* eslint-disable no-underscore-dangle */
// @ts-ignore
globalHistory._onTransitionComplete();
/* eslint-enable */
} else {
//leave design page should clear the history
clearUndoHistory();
Expand Down
5 changes: 3 additions & 2 deletions Composer/packages/client/src/pages/home/ExampleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const resolveIcon = (exampleId: string): string => {
export const ExampleList: React.FC<ExampleListProps> = (props) => {
const { onClick, examples } = props;

function _onRenderCell(item?: ProjectTemplate): React.ReactNode {
function onRenderCell(item?: ProjectTemplate): React.ReactNode {
if (!item) {
return;
}
Expand All @@ -46,6 +46,7 @@ export const ExampleList: React.FC<ExampleListProps> = (props) => {
data-is-focusable
aria-label={item.name + '; ' + item.description}
css={exampleListCell}
role="button"
tabIndex={0}
onClick={() => onClick(item.id)}
onKeyDown={(ev) => {
Expand All @@ -66,7 +67,7 @@ export const ExampleList: React.FC<ExampleListProps> = (props) => {
return (
<div css={exampleListContainer} data-is-scrollable="true">
<ScrollablePane scrollbarVisibility={ScrollbarVisibility.auto}>
<List items={examples} onRenderCell={_onRenderCell} />
<List items={examples} onRenderCell={onRenderCell} />
</ScrollablePane>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const CodeEditor: React.FC<CodeEditorProps> = (props) => {
[file, projectId]
);

const _onChange = useCallback(
const onChange = useCallback(
(value) => {
if (!file) return;
if (inlineMode) {
Expand Down Expand Up @@ -142,7 +142,7 @@ const CodeEditor: React.FC<CodeEditorProps> = (props) => {
}}
lgOption={lgOption}
value={content}
onChange={_onChange}
onChange={onChange}
onChangeSettings={handleSettingsChange}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const CodeEditor: React.FC<CodeEditorProps> = (props) => {
[file, projectId]
);

const _onChange = useCallback(
const onChange = useCallback(
(value) => {
setContent(value);
if (!file) return;
Expand Down Expand Up @@ -134,7 +134,7 @@ const CodeEditor: React.FC<CodeEditorProps> = (props) => {
}}
luOption={luOption}
value={content}
onChange={_onChange}
onChange={onChange}
onChangeSettings={handleSettingsChange}
/>
);
Expand Down
Loading