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

secptrum-ui

Package Overview
Dependencies
Maintainers
0
Versions
101
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

secptrum-ui - npm Package Compare versions

Comparing version 1.1.56 to 1.1.57

5

package.json
{
"name": "secptrum-ui",
"version": "1.1.56",
"version": "1.1.57",
"description": "**SecptrumUI** A comprehensive React component library",

@@ -36,2 +36,5 @@ "homepage": "https://secptrumui.vercel.app",

},
"bin": {
"init": "./scripts/next-setup.js"
},
"keywords": [

@@ -38,0 +41,0 @@ "react",

90

scripts/next-setup.js
#!/usr/bin/env node
const { Command } = require("commander");
const { existsSync, mkdirSync, writeFileSync } = require("fs-extra");
const { join } = require("path");
const { Command } = require('commander');
const { existsSync, mkdirSync, writeFileSync } = require('fs-extra');
const { join } = require('path');
const program = new Command();
program.version("1.0.0").description("Setup SecptrumUI for Next.js");
program.version('1.0.0').description('Setup SecptrumUI for Next.js');
program
.command("setup")
.description("Setup Next.js configuration for SecptrumUI")
.command('setup')
.description('Setup Next.js configuration for SecptrumUI')
.action(() => {
const isTypeScript = existsSync(join(process.cwd(), "tsconfig.json"));
const isTypeScript = existsSync(join(process.cwd(), 'tsconfig.json'));
const registryContentJs = `'use client';
import React, { useState } from 'react';
import { useServerInsertedHTML } from 'next/navigation';
import { ServerStyleSheet, StyleSheetManager } from 'styled-components';
import { useServerInsertedHTML } from "next/navigation";
import { renderStyles, StyleSheetManager } from "styled-chroma";
export default function StyledComponentsRegistry({ children }) {
const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());
const SecptrumUIRegistry = ({ children }) => {
useServerInsertedHTML(() => {
const styles = styledComponentsStyleSheet.getStyleElement();
styledComponentsStyleSheet.instance.clearTag();
return <>{styles}</>;
const styles = renderStyles();
StyleSheetManager.clearStyles();
return <style dangerouslySetInnerHTML={{ __html: styles }} />;
});
if (typeof window !== 'undefined') return <>{children}</>;
if (typeof window !== "undefined") return <>{children}</>;
return (
<StyleSheetManager sheet={styledComponentsStyleSheet.instance}>
{children}
</StyleSheetManager>
);
}
return <>{children}</>;
};
export default SecptrumUIRegistry;
SecptrumUIRegistry.displayName = "SecptrumUIRegistry";
`;

@@ -44,37 +40,29 @@

import React, { useState } from 'react';
import { useServerInsertedHTML } from 'next/navigation';
import { ServerStyleSheet, StyleSheetManager } from 'styled-components';
import { useServerInsertedHTML } from "next/navigation";
import { renderStyles, StyleSheetManager } from "styled-chroma";
export default function StyledComponentsRegistry({
children,
}: {
children: React.ReactNode;
}) {
const [styledComponentsStyleSheet] = useState(() => new ServerStyleSheet());
const SecptrumUIRegistry = ({ children }: { children: React.ReactNode }) => {
useServerInsertedHTML(() => {
const styles = styledComponentsStyleSheet.getStyleElement();
styledComponentsStyleSheet.instance.clearTag();
return <>{styles}</>;
const styles = renderStyles();
StyleSheetManager.clearStyles();
return <style dangerouslySetInnerHTML={{ __html: styles }} />;
});
if (typeof window !== 'undefined') return <>{children}</>;
if (typeof window !== "undefined") return <>{children}</>;
return (
<StyleSheetManager sheet={styledComponentsStyleSheet.instance}>
{children}
</StyleSheetManager>
);
}
return <>{children}</>;
};
export default SecptrumUIRegistry;
SecptrumUIRegistry.displayName = "SecptrumUIRegistry";
`;
// Determine paths
const srcPath = join(process.cwd(), "src");
const srcPath = join(process.cwd(), 'src');
const libPath = existsSync(srcPath)
? join(srcPath, "lib")
: join(process.cwd(), "lib");
? join(srcPath, 'lib')
: join(process.cwd(), 'lib');
const registryPath = join(
libPath,
isTypeScript ? "registry.tsx" : "registry.js"
isTypeScript ? 'registry.tsx' : 'registry.js'
);

@@ -95,7 +83,11 @@

console.log(
`Created ${isTypeScript ? "registry.tsx" : "registry.js"} in ${libPath}.`
`Created ${
isTypeScript ? 'registry.tsx' : 'registry.js'
} in ${libPath}.`
);
} else {
console.log(
`${isTypeScript ? "registry.tsx" : "registry.js"} already exists in ${libPath}, skipping.`
`${
isTypeScript ? 'registry.tsx' : 'registry.js'
} already exists in ${libPath}, skipping.`
);

@@ -102,0 +94,0 @@ }

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