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

@shopify/slate-config

Package Overview
Dependencies
Maintainers
8
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/slate-config - npm Package Compare versions

Comparing version 1.0.0-alpha.19 to 1.0.0-alpha.20

__tests__/fixtures/slate.config.js

12

__tests__/index.test.js

@@ -1,5 +0,3 @@

const fs = require('fs');
const slateConfig = require('../index');
const schema = require('./fixtures/schema');
const slaterc = require('./fixtures/slaterc.json');

@@ -18,16 +16,10 @@ describe('.generate()', () => {

test('with slaterc overrides', () => {
const oldReadFileSync = fs.readFileSync;
const mockSlateRc = require('./fixtures/slate.config.js');
fs.readFileSync = jest.fn(() => {
return slaterc;
});
expect(slateConfig.generate(schema)).toHaveProperty(
expect(slateConfig.generate(schema, mockSlateRc)).toHaveProperty(
schema.items[0].id,
'override-value',
);
fs.readFileSync = oldReadFileSync;
});
});
});

@@ -8,6 +8,6 @@ const path = require('path');

function getSlateRc(slatePath) {
function getSlateConfig() {
try {
const json = fs.readFileSync(slatePath, 'utf8');
return typeof json === 'object' ? json : JSON.parse(json);
const slateRcPath = resolveTheme('slate.config.js');
return require(slateRcPath);
} catch (error) {

@@ -18,5 +18,3 @@ return {};

function generate(schema) {
const slateRcPath = resolveTheme('.slaterc');
const slaterc = getSlateRc(slateRcPath);
function generate(schema, slaterc = getSlateConfig()) {
const items = schema.items || [];

@@ -57,3 +55,3 @@ const config = {};

resolveTheme,
getSlateRc,
getSlateConfig,
};
{
"name": "@shopify/slate-config",
"version": "1.0.0-alpha.19",
"description": "Generate Slate config files",
"version": "1.0.0-alpha.20",
"description": "Generate configurations for Slate packages by applying values from slate.config.js to override default values",
"main": "index.js",
"scripts": {
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/shopify/slate.git"
},
"repository": "https://github.com/Shopify/slate/tree/1.x/packages/slate-config",
"author": "Shopify Inc.",

@@ -18,3 +12,3 @@ "license": "MIT",

},
"homepage": "https://github.com/shopify/slate#readme"
"homepage": "https://github.com/shopify/slate"
}
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