Socket
Socket
Sign inDemoInstall

@doors/codemods

Package Overview
Dependencies
303
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.3 to 0.0.4

7

bin/run.update-imports.js
#! /usr/bin/env node
const path = require("path")
const { program } = require("commander")
const execa = require("execa")
const jscodeshiftExecutable = require.resolve(".bin/jscodeshift")
const { spawn } = require("child_process")
const transformerDirectory = path.join(__dirname, "../", "transforms")
console.log(transformerDirectory)
program

@@ -23,3 +21,3 @@ .argument("<migrationFiles>", "Path of files to transform.")

}
spawn(
execa(
jscodeshiftExecutable,

@@ -34,2 +32,3 @@ [

stdio: "inherit",
stripEof: false,
}

@@ -36,0 +35,0 @@ )

# @doors/codemods
## 0.0.4
### Patch Changes
- Update import transforms
## 0.0.3

@@ -4,0 +10,0 @@

{
"name": "@doors/codemods",
"version": "0.0.3",
"version": "0.0.4",
"publishConfig": {

@@ -14,7 +14,6 @@ "access": "public"

"license": "ISC",
"bin": {
"migrate-imports": "./bin/run.update-imports.js"
},
"bin": "./bin/run.update-imports.js",
"dependencies": {
"commander": "^9.0.0",
"execa": "^6.1.0",
"jscodeshift": "^0.13.1"

@@ -21,0 +20,0 @@ },

@@ -1,3 +0,5 @@

import { Box } from "@rent_avail/core"
import { Input } from "@rent_avail/controls"
import Avatar, { AvatarGroup } from "@rent_avail/avatar"
import React from "react";
import { Box } from "@rent_avail/core";
import { Input } from "@rent_avail/controls";
import Radio, { RadioGroup } from "@rent_avail/elements/radio";
import Avatar, { AvatarGroup as Thing } from "@rent_avail/avatar";

@@ -0,3 +1,5 @@

import React from "react";
import { Box } from "@doors/core";
import { Input } from "@doors/controls";
import { Avatar, AvatarGroup } from "@doors/display";
import { Radio, RadioGroup } from "@doors/controls";
import { Avatar, AvatarGroup as Thing } from "@doors/display";

@@ -38,3 +38,4 @@ function changePackage(source) {

["card", "@doors/core"],
["constants", "@doors/core"],
// Don't do anything with constants, too complicated.
["constants", "@rent_avail/elements/constants"],
["button", "@doors/controls"],

@@ -63,5 +64,7 @@ ["toggle", "@doors/controls"],

importDeclarations.forEach((path) => {
// Need to check for constants package and delete call expressions.
const source = path.node.source.value
const specifiers = path.node.specifiers.map((path) => {
if (path.imported && path.imported.name !== path.local.name) {
return j.importSpecifier(path.imported, path.local)
}
return j.importSpecifier(path.local, path.local)

@@ -68,0 +71,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc