Skip to content
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

[SECOND] Bump bf-dljs and forked cldr-data, cldr-data-downloader #3998

Merged
merged 34 commits into from
Aug 11, 2021

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Jul 21, 2021

This is a branch based from #3996. Do not review until #3996 is merged.

Changelog Entry

Changed

  • Forked cldr-data and cldr-data-downloader, in PR #3998
    • Moved source code to under ./src folder
    • Moved to fs.readFileSync() from require() when reading JSON files
    • Moved to node:fs.mkdir() and removed mkdirp
    • Moved tests from node:assert to Jest
    • Updated Unicode CLDR download folder to /dist/ folder from project root
    • Moved from Grunt/JSHint to eslint
    • Upgraded from CommonJS to ES Module
    • Use read-pkg-up to determines parent package.json
      • In Web Chat, since we use lerna to run the install script, we need to relax how cldr-data read from parent package.json

Description

cldr-data-downloader has vulnerability and unlikely to be fixed in short term of time.

To improve our code hygiene, we are forking cldr-data-downloader and its dependent cldr-data.

Also bumped botframework-directlinejs to 0.15.0.

Design

cldr-data*

Both cldr-data and cldr-data-downloader have MIT license. We forked the code and upgraded the codebase.

ESLint ecmaVersion as 2020

Instead of moving ecmaVersion to latest, I am keeping it as 2020 while I am understanding why setting it to latest would trigger the following error:

/home/johndoe/repos/BotFramework-WebChat/packages/api/src/hooks/useRenderAttachment.js
  3:16  error  Unexpected function declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable  no-implicit-globals

And the code for useRenderAttachment.js:

import useWebChatAPIContext from './internal/useWebChatAPIContext';

export default function useRenderAttachment() {
  const { attachmentRenderer } = useWebChatAPIContext();

  return attachmentRenderer;
}

Specific Changes

  • Forked cldr-data and cldr-data-downloader to under /packages/support/
  • Updated both packages for better hygiene but minimal logic changes
    • Please see CHANGELOG for details
  • Added /*.tgz to all .gitignore files
  • Transpile additional packages on-the-fly: botframework-streaming and buffer (used by botframework-directlinejs)
  • Downgrade strip-ansi because it is ESM-only and Jest is not ESM ready
  • Added new host.upload() function to test harness
    • In dev mode (npm run browser), it will upload from <project-root>/__tests__/html/assets/uploads/
    • In prod mode (npm test with Docker), it will upload from /home/seluser/Downloads, which we will prepopulate the folder during Docker build
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim changed the title [DRAFT] Fork cldr-data and cldr-data-downloader [DRAFT] Bump bf-dljs and forked cldr-data, cldr-data-downloader Jul 29, 2021
@compulim compulim changed the title [DRAFT] Bump bf-dljs and forked cldr-data, cldr-data-downloader [SECOND] Bump bf-dljs and forked cldr-data, cldr-data-downloader Jul 30, 2021
@compulim compulim marked this pull request as ready for review July 30, 2021 07:43
@compulim compulim merged commit b37c1f6 into microsoft:main Aug 11, 2021
@compulim compulim deleted the bump-cldr-data branch August 11, 2021 22:17
@compulim compulim mentioned this pull request Sep 2, 2021
11 tasks
@compulim compulim mentioned this pull request Mar 28, 2022
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants