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 0.0.2-next.2 to 0.0.2-next.3

6

CHANGELOG.md
# @patternfly/create-element
## 0.0.2-next.3
### Patch Changes
- 317115f8: Update generator config file templates
## 0.0.2-next.2

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

22

generator/element.ts

@@ -114,3 +114,3 @@ import type { GenerateElementOptions } from '../main';

const normalizeScope = (scope: string): string =>
scope ? `@${scope.replace(/^@(.*)\/$/, '$1')}/` : '';
scope ? `@${scope.replace(/^(@+)([-.\w]+)\/?$/, '$2')}/` : '';

@@ -223,9 +223,11 @@ /** Get template interpolation data from options */

const config = await readJson<Tsconfig>(configPath);
if (!config?.compilerOptions?.paths) {
return;
if (config?.compilerOptions?.paths) {
config.compilerOptions.paths[packageName] = [join(`./elements/${tagName}/${tagName}.ts`)];
}
config.compilerOptions.paths[packageName] = [join(`./elements/${tagName}/${tagName}.ts`)];
if (!config.references.some(x => x.path === `./elements/${tagName}`)) {
if (!config.references?.some(x => x.path === `./elements/${tagName}`)) {
config.references.push({ 'path': `./elements/${tagName}` });
}
await writeFile(configPath, JSON.stringify(config, null, 2), 'utf8');

@@ -235,2 +237,10 @@ await execaCommand(`npx eslint --fix ${configPath}`);

async function updateDocsBundle(options: GenerateElementOptions): Promise<void> {
const pathname = join(process.cwd(), 'docs', 'demo', 'bundle.ts');
const content = await readFile(pathname, 'utf8');
await writeFile(pathname, `${content}\nimport '@patternfly/${options.tagName}';`, 'utf8');
await execaCommand(`npx eslint --fix ${pathname}`);
}
/**

@@ -252,3 +262,5 @@ * Generate an Element

await updateTsconfig(options);
await updateDocsBundle(options);
await execaCommand('npm install');
}
}
{
"name": "@patternfly/create-element",
"version": "0.0.2-next.2",
"version": "0.0.2-next.3",
"description": "Scaffold web components monorepos based on PatternFly Elements",

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

@@ -1,20 +0,12 @@

import type { LitElement } from 'lit';
import { test } from '@playwright/test';
import { PfeDemoPage } from '@patternfly/pfe-tools/test/playwright/PfeDemoPage.js';
import { expect } from '@playwright/test';
import { test } from '@patternfly/pfe-tools/test/playwright/fixtures.js';
const tagName = '<%= tagName %>';
test.describe(tagName, () => {
test.beforeEach(async ({ page }) => {
await page.goto(`http://localhost:8080/demo/${tagName}/`);
await page.waitForLoadState('networkidle');
await page.waitForTimeout(100);
await page.evaluate(async x => customElements.whenDefined(x), tagName);
await page.$eval(tagName, async (el: LitElement) => el.updateComplete);
});
test('snapshot', async ({ page }) => {
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot(`${tagName}.png`);
const componentPage = new PfeDemoPage(page, tagName);
await componentPage.navigate();
await componentPage.snapshot();
});
});

Sorry, the diff of this file is not supported yet

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