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

@stylable/core-test-kit

Package Overview
Dependencies
Maintainers
6
Versions
188
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stylable/core-test-kit - npm Package Compare versions

Comparing version 6.0.0-rc.2 to 6.0.0-rc.3

4

dist/generate-test-util.js

@@ -70,3 +70,5 @@ "use strict";

function processSource(source, options = {}, resolveNamespace) {
return new index_internal_1.StylableProcessor(new core_1.Diagnostics(), resolveNamespace).process(postcss.parse(source, options));
return new index_internal_1.StylableProcessor(new core_1.Diagnostics(), resolveNamespace, {
...index_internal_1.defaultFeatureFlags,
}).process(postcss.parse(source, options));
}

@@ -73,0 +75,0 @@ exports.processSource = processSource;

import { Stylable, StylableConfig, StylableResults } from '@stylable/core';
import type { IDirectoryContents, IFileSystem } from '@file-services/types';
export interface TestOptions {
entries: string[];
entries: `/${string}`[];
stylableConfig: TestStylableConfig;

@@ -12,2 +12,4 @@ }

};
type AddLeadingSlash<T extends string> = T extends `/${infer U}` ? `/${U}` : `/${T}`;
type RemoveRelative<T extends string> = T extends `./${infer U}` ? U : T;
/**

@@ -20,4 +22,6 @@ * The test function takes in a single '/entry.st.css' stylesheet string

*/
export declare function testStylableCore(input: string | IDirectoryContents, options?: Partial<TestOptions>): {
sheets: Record<string, StylableResults>;
export declare function testStylableCore<const T extends string | IDirectoryContents, const O extends Partial<TestOptions>>(input: T, options?: O): {
sheets: Record<AddLeadingSlash<RemoveRelative<((O["stylableConfig"] extends {
filesystem: IFileSystem;
} ? true : false) extends true ? string : T extends string ? "/entry.st.css" : keyof T) & (O["entries"] extends string[] ? O["entries"][number] : string)>>, StylableResults>;
stylable: Stylable;

@@ -32,2 +36,3 @@ fs: IFileSystem;

export declare function createJavascriptRequireModule(fs: IFileSystem): (id: string) => any;
export {};
//# sourceMappingURL=test-stylable-core.d.ts.map

@@ -29,3 +29,2 @@ "use strict";

const entries = options.entries || allSheets;
// transform entries - run build in requested order
const sheets = {};

@@ -32,0 +31,0 @@ for (const path of entries) {

{
"name": "@stylable/core-test-kit",
"version": "6.0.0-rc.2",
"version": "6.0.0-rc.3",
"description": "Stylable core test-kit",

@@ -10,7 +10,7 @@ "main": "dist/index.js",

"dependencies": {
"@file-services/memory": "^8.3.2",
"@stylable/core": "^6.0.0-rc.2",
"@file-services/memory": "^8.3.3",
"@stylable/core": "^6.0.0-rc.3",
"chai": "^4.3.10",
"flat": "^5.0.2",
"postcss": "^8.4.31"
"postcss": "^8.4.33"
},

@@ -17,0 +17,0 @@ "files": [

@@ -18,2 +18,3 @@ import {

replaceValueHook,
defaultFeatureFlags,
} from '@stylable/core/dist/index-internal';

@@ -112,5 +113,5 @@ import { isAbsolute } from 'path';

) {
return new StylableProcessor(new Diagnostics(), resolveNamespace).process(
postcss.parse(source, options)
);
return new StylableProcessor(new Diagnostics(), resolveNamespace, {
...defaultFeatureFlags,
}).process(postcss.parse(source, options));
}

@@ -117,0 +118,0 @@

@@ -8,3 +8,3 @@ import { testInlineExpects } from './inline-expectation';

export interface TestOptions {
entries: string[];
entries: `/${string}`[];
stylableConfig: TestStylableConfig;

@@ -22,2 +22,5 @@ }

type AddLeadingSlash<T extends string> = T extends `/${infer U}` ? `/${U}` : `/${T}`;
type RemoveRelative<T extends string> = T extends `./${infer U}` ? U : T;
/**

@@ -30,6 +33,6 @@ * The test function takes in a single '/entry.st.css' stylesheet string

*/
export function testStylableCore(
input: string | IDirectoryContents,
options: Partial<TestOptions> = {}
) {
export function testStylableCore<
const T extends string | IDirectoryContents,
const O extends Partial<TestOptions>
>(input: T, options: O = {} as O) {
// infra

@@ -52,3 +55,8 @@ const fs =

// transform entries - run build in requested order
const sheets: Record<string, StylableResults> = {};
type Entries = O['entries'] extends string[] ? O['entries'][number] : string;
type HasExternalFS = O['stylableConfig'] extends { filesystem: IFileSystem } ? true : false;
type InputFsKeys = T extends string ? '/entry.st.css' : keyof T;
type Keys = HasExternalFS extends true ? string : InputFsKeys;
type Sheets = Record<AddLeadingSlash<RemoveRelative<Keys & Entries>>, StylableResults>;
const sheets = {} as Sheets;
for (const path of entries) {

@@ -60,3 +68,3 @@ if (!isAbsolute(path || '')) {

const { exports } = stylable.transform(meta);
sheets[path] = { meta, exports };
sheets[path as keyof Sheets] = { meta, exports };
}

@@ -63,0 +71,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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