New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

create-widget-test-12

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-widget-test-12

WidgetTemplate

  • 1.0.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

create-widget-app

Template app that creates a widget & react iframe.

Code organization:

dir / pathdescription
ui-src/This is where the iframe code lives
ui-src/index.htmlMain entry point for the iframe code
ui-src/tsconfig.jsontsconfig for the iframe code
code.tsxThis is the widget code
tsconfig.jsontsconfig for the widget code
dist/Built output goes here
  • The widget code just uses tsc directly like most of our plugin/widget samples
  • The iframe code uses a tool called vite to bundle everything into a single html file

Getting started

one-time setup

  1. Make a copy of this folder
  2. Update manifest.json, package.json and package-lock.json where it says WidgetTemplate
  3. Install the required dependencies npm ci

importing your widget

  1. "Import widget from manifest"
  2. Build code npm run build
  3. Choose your manifest

iframe development

Often the code in the iframe can get pretty complex, if helpful, you can also do

npm run dev:ui
  • This command starts a development server that will serve the iframe code at http://localhost:3000
  • The development server will also hot reload any changes to your iframe code

Scripts

scriptdescription
npm run buildone-off full build of both the iframe and widget
npm run build:mainone-off build of the widget code
npm run build:uione-off build of the iframe code
npm run build:main:watchwatch-mode build of the widget code. rebuilds if when you save changes.
npm run build:ui:watchwatch-mode build of the iframe code. rebuilds if when you save changes.

FAQs

Package last updated on 17 Nov 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc