npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

vue-to-dm

v0.1.2

Published

Transform Vue SFC to PwC's Digital Maker compatible format

Downloads

12

Readme

Vue to DM

Vue to DM CI Coverage Status

This utility helps to transform Vue SFC files to PwC Digital Maker compatible SFC format:

  • Removing all imports from <script /> blocks.
  • Removing components property from exported default objects.
  • Renaming names of components based on their filenames in underlined_lowercased_style. Usages in templates will also be transformed automatically. These names will be used as registered components in Digital Maker.
  • Combining all style blocks into a single app.css file.

DISCLAMER

  • This utility is NOT a compiler or bundler. Please use Vue CLI, Vite or any other tools to build your project first to make sure everything works. Then use vue-to-dm to transform Vue SFC files.
  • Currently DM uses Vue 2.x, and vue-to-dm doesn't transform any API level source code.
  • vue-to-dm only supports JavaScript as <script /> blocks and CSS as <style /> blocks, TypeScript, SCSS are not supported yet.
  • External libraries, scripts, stylesheets are not bundled.
  • JavaScript is a flexible language, the sample code below might work with vue compiler, but vue-to-dm is a limited utility, please avoid such usage.
import components from "@/components.js";

export default {
  components: {
    ...components,
  }
};

Usage

Install:

npm i vue-to-dm -D

Create your build script:

const { build } = require("./dist/index.js");

build([`/path/to/folders/of/src`], {
	dist_dir: `/path/to/dist/dir`,
});

API:

export const build = (dirs: string[], options: BuildOptions = {}): void;
  • dirs: an array of folders containing SFC files to be transformed.
  • options:
    • dist_dir: target directory which will contain app.css and components directory after build().
    • prettier: options to format output files with Prettier.