secptrum-ui
Advanced tools
Comparing version 1.1.33-beta.1 to 1.1.33-beta.1.0
{ | ||
"name": "secptrum-ui", | ||
"version": "1.1.33-beta.1", | ||
"version": "1.1.33-beta.1.0", | ||
"description": "**SecptrumUI** A React component library with adaptable, responsive designs using `styled-chroma`", | ||
@@ -13,11 +13,23 @@ "homepage": "https://secptrumui.vercel.app", | ||
}, | ||
"main": "dist/secptrum-ui.cjs.js", | ||
"module": "dist/secptrum-ui.es.js", | ||
"unpkg": "dist/secptrum-ui.umd.js", | ||
"types": "dist/types/index.d.ts", | ||
"main": "dist/react/secptrum-ui.cjs.js", | ||
"module": "dist/react/secptrum-ui.es.js", | ||
"unpkg": "dist/react/secptrum-ui.umd.js", | ||
"types": "dist/react/index.d.ts", | ||
"mainNext": "dist/nextjs/secptrum-ui.cjs.js", | ||
"moduleNext": "dist/nextjs/secptrum-ui.es.js", | ||
"exports": { | ||
".": { | ||
"import": "./dist/secptrum-ui.es.js", | ||
"require": "./dist/secptrum-ui.cjs.js", | ||
"types": "./dist/index.d.ts" | ||
"import": "./dist/react/secptrum-ui.es.js", | ||
"require": "./dist/react/secptrum-ui.cjs.js", | ||
"types": "./dist/react/index.d.ts" | ||
}, | ||
"./react": { | ||
"import": "./dist/react/secptrum-ui.es.js", | ||
"require": "./dist/react/secptrum-ui.cjs.js", | ||
"types": "./dist/react/index.d.ts" | ||
}, | ||
"./nextjs": { | ||
"import": "./dist/nextjs/secptrum-ui.es.js", | ||
"require": "./dist/nextjs/secptrum-ui.cjs.js", | ||
"types": "./dist/nextjs/index.d.ts" | ||
} | ||
@@ -27,3 +39,4 @@ }, | ||
"dist", | ||
"dist/types", | ||
"dist/react", | ||
"dist/nextjs", | ||
"scripts" | ||
@@ -34,3 +47,5 @@ ], | ||
"insert-client": "node scripts/insertUseClient.js", | ||
"postbuild": "copyfiles -u 1 src/types/**/* dist/", | ||
"copy-react": "copyfiles -u 1 src/types/**/* dist/react/", | ||
"copy-nextjs": "copyfiles -u 1 src/types/**/* dist/nextjs/", | ||
"postbuild": "npm run copy-react && npm run copy-nextjs && npm run insert-client", | ||
"prerelease": "npx tsc --noEmit", | ||
@@ -37,0 +52,0 @@ "release": "npm version patch && git push origin master --follow-tags", |
@@ -6,40 +6,32 @@ #!/usr/bin/env node | ||
// Ensure the path to the dist directory is correct | ||
const distDir = path.join(__dirname, '../dist'); | ||
// Add "use client" to all files in the Next.js build | ||
const nextJsDir = path.join(__dirname, '../dist/nextjs'); | ||
// Check if the directory exists | ||
if (fs.existsSync(distDir)) { | ||
// Recursively add 'use client' directive to all relevant files in 'dist' | ||
function addUseClientToFiles(dir) { | ||
const files = fs.readdirSync(dir); | ||
function addUseClientToFiles(dir) { | ||
const files = fs.readdirSync(dir); | ||
files.forEach((file) => { | ||
const fullPath = path.join(dir, file); | ||
const stat = fs.statSync(fullPath); | ||
files.forEach((file) => { | ||
const fullPath = path.join(dir, file); | ||
const stat = fs.statSync(fullPath); | ||
if (stat.isDirectory()) { | ||
// Recursively check subdirectories | ||
addUseClientToFiles(fullPath); | ||
} else if (file.endsWith('.js') || file.endsWith('.ts')) { | ||
// Read the file | ||
const content = fs.readFileSync(fullPath, 'utf8'); | ||
if (stat.isDirectory()) { | ||
addUseClientToFiles(fullPath); // Recursively process subdirectories | ||
} else if (file.endsWith('.js') || file.endsWith('.ts')) { | ||
const content = fs.readFileSync(fullPath, 'utf8'); | ||
// Check if 'use client' is already present | ||
if (!content.startsWith('"use client";')) { | ||
// Add 'use client' at the top | ||
const newContent = `"use client";\n${content}`; | ||
// Write the file back with 'use client' at the top | ||
fs.writeFileSync(fullPath, newContent, 'utf8'); | ||
console.log(`Added 'use client' to: ${fullPath}`); | ||
} | ||
if (!content.startsWith('"use client";')) { | ||
const newContent = `"use client";\n${content}`; | ||
fs.writeFileSync(fullPath, newContent, 'utf8'); | ||
console.log(`Added 'use client' to: ${fullPath}`); | ||
} | ||
}); | ||
} | ||
} | ||
}); | ||
} | ||
addUseClientToFiles(distDir); | ||
// Only apply this to the Next.js folder | ||
if (fs.existsSync(nextJsDir)) { | ||
addUseClientToFiles(nextJsDir); | ||
console.log('Next.js build modified with "use client".'); | ||
} else { | ||
console.error( | ||
`Directory ${distDir} does not exist. Make sure Rollup build was successful.` | ||
); | ||
console.error(`Directory ${nextJsDir} does not exist.`); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32889177
113
261
10670
50
4
7
1