Skip to content

Instantly share code, notes, and snippets.

@eddiecooro
eddiecooro / check-dependencies.js
Last active October 6, 2023 15:15
An script for updating every package of an ecosystem, while locking the main package to a specific version.
const pacote = require("pacote")
const semver = require("semver")
const mainPackageName = "Name of the main package. e.g. gatsby";
const mainPackageVersion = "The version of the main package to lock to. e.g. 3.0.0";
const packages = [
// List of the ecosystem packages to check for compatibality with the main package.
]
packages.forEach(package => {
@eddiecooro
eddiecooro / addTestIdToJSX.js
Created August 28, 2023 14:44
A codemod that adds a unique `data-testid` to a list of jsx components that are imported from a specific path
// addUuidToButton.js
const j = require("jscodeshift");
const crypto = require("crypto");
function generateUUID(filePath, position) {
const str = filePath + JSON.stringify(position);
return crypto.createHash("md5").update(str).digest("hex").substr(0, 5);
}
const importPaths = ["components"];
name: projectname
root: ~/Desktop/projectname/
on_project_first_start:
- cd crm-admin
- yarn
- cd ../design-system
- yarn
startup_window: user-scripts
windows:
- crm-admin:
@eddiecooro
eddiecooro / cloudSettings
Last active December 20, 2019 04:46
vscode settings
{"lastUpload":"2019-12-20T04:46:25.392Z","extensionVersion":"v3.4.3"}
render() {
return withPagination('users', 'followers', 'https://.../users')(UsersView)
}