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

@enhance/arc-plugin-styles

Package Overview
Dependencies
Maintainers
6
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@enhance/arc-plugin-styles - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

src/.DS_Store

13

package.json
{
"name": "@enhance/arc-plugin-styles",
"version": "1.0.0",
"version": "1.0.1",
"description": "Plugin for generating enhance CSS utility classes",

@@ -31,12 +31,11 @@ "main": "src/index.js",

"dependencies": {
"@architect/functions": "^5.2.1",
"@enhance/styles": "^2.0.2",
"esm": "^3.2.25"
"@architect/functions": "^5.2.3",
"@enhance/styles": "^2.0.2"
},
"devDependencies": {
"@architect/eslint-config": "^2.0.1",
"@architect/sandbox": "^5.3.1",
"eslint": "^8.20.0",
"@architect/sandbox": "^5.3.4",
"eslint": "^8.26.0",
"tap-arc": "^0.3.5",
"tape": "^5.5.3",
"tape": "^5.6.1",
"tiny-json-http": "^7.4.2"

@@ -43,0 +42,0 @@ },

@@ -1,13 +0,21 @@

// eslint-disable-next-line
require = require('esm')(module)
const { readFileSync, writeFileSync } = require('node:fs')
const path = require('node:path')
const { readFileSync, writeFileSync } = require('fs')
const path = require('path')
const enhanceStyles = require('@enhance/styles/index.mjs').default
const sandbox = {
start (params) {
verify(params)
generateAndSave(createConfig(params))
async start (params) {
if (verify(params)) {
const config = createConfig(params)
await generateAndSave(config)
}
},
async watcher (params) {
if (verify(params)) {
const { filename } = params
const config = createConfig(params)
if (filename === config.pathToConfig) {
await generateAndSave(config)
}
}
}
}

@@ -33,5 +41,9 @@

function verify ({ arc, inventory }) {
// TODO: helpful error if inventory doesn't have static or static.folder
// TODO: helpful error if @enhance-styles not set in arc
return inventory.inv.static?.folder && arc['enhance-styles']?.length > 0
const hasStatic = inventory.inv.static?.folder
const hasConfig = arc['enhance-styles']?.length > 0
if (!hasStatic) { console.warn(' Enhance Styles: Architect static must be enabled') }
if (!hasConfig) { console.warn(' Enhance Styles: @enhance-styles config required') }
return hasStatic && hasConfig
}

@@ -44,3 +56,3 @@

* @param {object} params.inventory
* @returns {{stylesConfig: string, path: string}}
* @returns {{stylesConfig: string, path: string, pathToConfig: null|string}}
*/

@@ -78,2 +90,3 @@ function createConfig ({ arc, inventory }) {

path: pathToStaticStyles,
pathToConfig,
}

@@ -88,3 +101,4 @@ }

*/
function generateAndSave ({ stylesConfig, path }) {
async function generateAndSave ({ stylesConfig, path }) {
const { default: enhanceStyles } = await import('@enhance/styles')
const styles = enhanceStyles(stylesConfig)

@@ -91,0 +105,0 @@ writeFileSync(path, styles)

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