Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@patternfly/create-element

Package Overview
Dependencies
Maintainers
16
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@patternfly/create-element - npm Package Compare versions

Comparing version 1.0.0-next.8 to 1.0.0-next.9

22

generator/element.js

@@ -50,2 +50,12 @@ import Case from "case";

};
function isMonorepoFileKey(key) {
switch (key) {
case "package" /* package */:
case "cemConfig" /* cemConfig */:
case "tsconfig" /* tsconfig */:
return true;
default:
return false;
}
}
const getFilePathsRelativeToPackageDir = memoize((options) => ({

@@ -106,2 +116,5 @@ cemConfig: "custom-elements-manifest.config.js",

async function writeComponentFile(key, options) {
if (!options.monorepo && isMonorepoFileKey(key)) {
return;
}
const PATH = getOutputFilePath(key, options);

@@ -140,3 +153,4 @@ const TEMPLATE = await getTemplate(key);

}
const { stderr, stdout } = await execa("npm", ["run", "analyze", "--prefix", getComponentAbsPath(options)], {
const monorepoArgs = !options.monorepo ? [] : ["--prefix", getComponentAbsPath(options)];
const { stderr, stdout } = await execa("npm", ["run", "analyze", ...monorepoArgs], {
all: true,

@@ -174,5 +188,7 @@ cwd: options.directory

await analyzeElement(options);
await updateTsconfig(options);
await execaCommand("npm install");
if (options.monorepo) {
await updateTsconfig(options);
await execaCommand("npm install");
}
}
}

@@ -5,2 +5,3 @@ export interface BaseOptions {

overwrite: boolean;
monorepo: boolean;
}

@@ -7,0 +8,0 @@ export interface AppOptions extends BaseOptions {

@@ -5,4 +5,10 @@ import { generateElement } from "./generator/element.js";

import prompts from "prompts";
import { readJson } from "./generator/files.js";
import { join } from "node:path";
const ERR_BAD_CE_TAG_NAME = "Custom element tag names must contain a hyphen (-)";
const b = Chalk.cyanBright;
async function isMonorepo() {
const { workspaces } = await readJson(join(process.cwd(), "package.json"));
return !!workspaces;
}
function banner() {

@@ -46,3 +52,3 @@ console.log(`${Chalk.cyan(`

}, {
type: () => !options?.scope && "text",
type: () => !options?.scope && options?.monorepo ? "text" : false,
name: "scope",

@@ -76,2 +82,6 @@ message: "What is the package's NPM scope?",

description: "Overwrite files without prompting"
}).option("monorepo", {
type: "boolean",
default: await isMonorepo(),
description: "Generate an npm package for the element"
}).help().check(({ name }) => {

@@ -78,0 +88,0 @@ if (typeof name === "string" && !name.includes("-")) {

2

package.json
{
"name": "@patternfly/create-element",
"version": "1.0.0-next.8",
"version": "1.0.0-next.9",
"description": "Scaffold web components monorepos based on PatternFly Elements",

@@ -5,0 +5,0 @@ "author": "Benny Powers <bennyp@redhat.com>",

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