Giter VIP home page Giter VIP logo

dependency_install_swapper's Introduction

dependency_install_swapper's People

Contributors

craigwh10 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dependency_install_swapper's Issues

increase specificity of CSR observer for yarnpkg

const availableDOM = document.querySelectorAll('main');

currently, this listens to changes to the main of the yarnpkg.com/packages/* site, including its subtrees, content, and attributes.

this isn't optimal, but it works effectively - some work needs to be done to find a more reliable point to observe from which captures when the DOM has finished changing, as with CSR the DOM modifies many times before it is "done".

how to reproduce:

  • build application in test mode (logging enabled)
  • go to https://yarnpkg.com/package/jest
  • open devtools console
  • look at frequency of mutation changes from observed node

definition of done:

  • quality gate passes
  • frequency of logs reduced
  • manual tests and approver tests by looking at the content logs
  • you can still switch between packages through search and observe command changes after timeout

Make default value come from store or from aligned with the page it's on

<select
name="preferred-package-manager"
autocomplete="off"
aria-label="select your preferred package manager"
title="select your preferred package manager"
>
<option
value="yarn"
aria-describedby="select your preferred package manager as yarn"
>
Yarn
</option>
<option
value="npm"
selected="selected"
aria-describedby="select your preferred package manager as npm"
>
NPM
</option>
<option
value="pnpm"
aria-describedby="select your preferred package manager as pnpm"
>
PNPM
</option>
<option
value="bower"
aria-describedby="select your preferred package manager as bower"
>
Bower
</option>
</select>

Current behaviour

  • Shows an empty dropdown when you first install the application

Desired behaviour

  • If on npmjs.org for first time after installing (or not selecting anything)
    • Should show NPM as selected option
  • If on yarnpkg.org for first time after installing (or not selecting anything)
    • Should show Yarn as selected option

This could possibly show as a placeholder, some behaviour to be wary of is if it selects npm if you go npm for first time, then if you go to yarn it should not transform it to npm, but be yarn

automation coverage of chrome extension with puppeteer

I have made an initial attempt on https://github.com/craigwh10/dependency_install_swapper/pull/18/files

I'll be bringing more attention to this on the weekend but the questions are currently:

Open questions:

  • How do I trigger select changes from within the package
  • How can I possibly open the popup from the browser functions where extensions live

Resolved

  • Loading the extension in via puppeteer works and is shown in PR

Notes

  • Cypress isn't suitable for this, nor is WDIO/playwright as they don't support content scripts for extensions.
  • Is using manifest v3, so background_page isn't relevant.
  • We have:
    • a service_worker, which is a type available in puppeteer tags
    • a content_script which on tab change, it triggers the command amendment handler
    • a popup_script which sends messages including changed value payload to content_script to trigger handler with change

automate axe checks

Would be nice to have https://www.npmjs.com/package/axe-core or similar running inside one of the git jobs in the case of changing any of the HTML/CSS.

Currently, this is only done manually, assumedly this would require some functional script writing which falls back onto the issue of using Puppeteer, so minimally the linting rules would be good for this.

resolve service_worker target not showing with current ci

We have:

  • a service_worker, which is a type available in puppeteer tags
  • a content_script which on tab change, it triggers the command amendment handler
  • a popup_script which sends messages including changed value payload to content_script to trigger handler with change

# @TODO: Manual for now, this can potentially come back when
# resolving why service_worker won't show in github action.
# - name: Setup Chrome
# uses: browser-actions/[email protected]
# with:
# chrome-version: stable
- name: Installing dependencies
run: yarn
- name: Making sure things aren't broken (unit/int)
run: yarn test:chrome
# @TODO: Manual for now, this can potentially come back when
# resolving why service_worker won't show in github action.
# - name: Making sure things definitely aren't broken (e2e)
# env:
# CHROME_PATH: $(which chrome)
# run: CHROME_PATH=$(which chrome) yarn run:chrome aut:ci

Shows the commented out jobs, the first uses a shared job to install chrome - which shows to be visible inside the tests.

Currently, the only targets that are being picked up are page and browser, and the tests hang waiting for target.

Have tried increasing timeouts.

https://github.com/marketplace/actions/puppeteer-headful is an option I've tried without much success but is still a viable option

Useful resouce

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.