
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@framerjs/component-importer
Advanced tools
The component-importer
is a command line tool that makes it easy to import TypeScript-based React design systems into Framer X. It analyzes your production design system's source code and generates readable React components that can be loaded by Framer X.
Let's take a quick look at the generated code.
import * as React from "react"
import * as BaseUi from "baseui/button"
import { addPropertyControls, ControlType } from "framer"
function Button(props) {
return <BaseUi.Button {...props} />
}
addPropertyControls(Button, { // <=== Inferred Property Controls
kind: {
type: ControlType.Enum,
defaultValue: "primary",
options: ["primary", "secondary"]
},
label: { type: ControlType.String },
isLoading: { type: ControlType.Boolean, defaultValue: false },
})
By analyzing the button component's TypeScript definitions, we can infer its property controls, similar to React Storybook's knobs. This means you can now drag your button to the Framer X canvas and modify it using a GUI that everyone can understand:
Design Systems lower engineering costs by keeping a single source of truth for your company's visual language. They have been successfully adopted by the industry's most sophisticated players like Google, Microsoft and Uber. Even the UK and US government have one!
There's still one big problem though: production design systems are typically only accesible to technical designers, comfortable enough with the command line and familiar with web development tooling like Webpack, TypeScript/Flow, React/Angular, etc. This means that designers often end up having to maintain their own copy which is expensive to keep in sync.
The component-importer
makes it possible to import your company's design system into Framer X so designers can start prototyping with components that behave just like they do in production.
As a design system maintainer, your design system's value is proportional to its adoption. To be successful you'll need to think beyond just developing components, but also about making sure that they are well documented and intuitive for everyone involved in the process - this can range from designers and engineers to product managers and content creators. The component-importer
tries to lower the barrier of adoption by making your production design system available for everyone.
To install run yarn global add @framerjs/component-importer
. This will globally install the component-importer
executable.
Let's go through the process of importing the Base Web design system from scratch.
Create a Framer X folder-backed project:
NOTE: .framerfx
projects are regular NPM projects. Go to your favorite text editor and try to open the folder we just created. The contents should look something like this:
build/
code/
design/
metadata/
node_modules/
package.json
README.md
tsconfig.json
yarn.lock
As you can see, it's a good ol' NPM package with its package.json
and node_modules
. It also has a tsconfig.json
file as Framer X supports TypeScript by default.
Before we import Base Web, we will first need to add it as a dependency:
# cd into the project created in the previous step.
cd ~/my-project.framerfx
# Base Web's npm package name is `baseui`
yarn add baseui
component-importer
In order to configure the component importer you will need to setup a configuration file, usually at the root of your project.
The component-importer init
command will help you setup the appropriate defaults for your project.
The general syntax is component importer init <packageName>
, an example being component-importer init @blueprintjs/core
which will attempt to import the @blueprintjs/core
package into your Framer X project.
Now you can run the following command for your design system of choice:
component-importer init baseui
Looking for projects using the component-importer
?
Looking to dive deeper into the component-importer
? These guides are here to help:
component-importer
s CLI.importer.config.json
.Want to learn more about design systems?
FAQs
```ts import * as React from "react" import * as Fabric from "office-ui-fabric-react" import { addPropertyControls, ControlType } from "framer"
The npm package @framerjs/component-importer receives a total of 0 weekly downloads. As such, @framerjs/component-importer popularity was classified as not popular.
We found that @framerjs/component-importer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 55 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.