New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

css-module-flow-loader

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-module-flow-loader - npm Package Compare versions

Comparing version
0.0.5
to
0.0.6
+21
test/fixture/fixture.scss
/* stylelint-disable block-no-empty */
.inner_usual_class {
display: block;
}
.usual_class {
display: block;
.inner_usual_class {
display: block;
}
.inner_empty_class {
}
}
.empty_class {
}
import assert from 'assert';
import fileSystem from 'fs';
import {describe, it} from 'mocha';
describe('css-module-flow-loader test', () => {
it('Main test', () => {
// eslint-disable-next-line no-sync
const actualResult = fileSystem.readFileSync('./test/fixture/fixture.scss.flow').toString();
const expectedResult = `// @flow strict
/* This file is automatically generated by css-module-flow-loader */
declare module.exports: {|
+'inner_usual_class': string;
+'usual_class': string;
|};
`;
assert(actualResult === expectedResult);
});
});
+4
-8
{
"name": "css-module-flow-loader",
"version": "0.0.5",
"version": "0.0.6",
"description": "css module flow loader",

@@ -31,7 +31,3 @@ "keywords": [

"scripts": {
"__start-demo": "cross-env BUILD_TYPE=site webpack-dev-server --progress --no-inline",
"__start-demo:hot": "cross-env BUILD_TYPE=site webpack-dev-server --progress --hot",
"__build-demo": "cross-env NODE_ENV=production BUILD_TYPE=site webpack --mode=production --progress",
"__build": "cross-env NODE_ENV=production BUILD_TYPE=lib webpack --mode=production --progress",
"build": "flow-remove-types src/css-module-flow-loader.js > dist/index.js",
"build": "rm -rf ./dist/* && flow-remove-types src/css-module-flow-loader.js > ./dist/index.js",
"remove-extra": "rm -rf ./coverage && rm -rf ./.nyc_output",

@@ -52,3 +48,4 @@ "check": "npm run remove-extra; npm run eslint; npm run stylelint; npm run flow;",

"pre-commit-hook": "npm run eslint && npm run stylelint && npm run flow",
"test": "babel-node node_modules/.bin/_mocha ./test/",
"build-test": "rm -f ./test/fixture/fixture.scss.flow && cross-env webpack --mode=development --progress",
"test": "npm run build && npm run build-test && babel-node node_modules/.bin/_mocha ./test/",
"__test-coverage": "nyc --reporter=html --reporter=text --reporter=lcov babel-node node_modules/.bin/_mocha ./test/",

@@ -87,3 +84,2 @@ "__coveralls": "npm run test-coverage && cat ./coverage/lcov.info | coveralls"

"css-loader": "^3.6.0",
"css-modules-flow-types-loader": "^1.3.0",
"duplicate-package-checker-webpack-plugin": "^3.0.0",

@@ -90,0 +86,0 @@ "eslint": "^7.6.0",

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

isBuildServer,
isBuildLib,
isBuildSite,
} = require('./webpack/config');
const webpackConfig = {
entry: isBuildLib ? ['./src/css-module-flow-loader.js'] : ['./www/root.scss', './www/root.js'],
entry: './test/fixture/fixture.scss',
output: {

@@ -35,8 +33,4 @@ path: path.join(cwd, pathToDist),

if (isProduction && isBuildLib) {
webpackConfig.output.libraryTarget = 'commonjs2';
}
// webpackConfig.plugins.push(new BundleAnalyzerPlugin());
module.exports = webpackConfig;

@@ -8,7 +8,3 @@ /* global process */

const buildTypeLibrary = 'lib';
const buildTypeSite = 'site';
const nodeEnvironment = process.env.NODE_ENV || modeDevelopmentName;
const buildType = process.env.BUILD_TYPE || buildTypeLibrary;

@@ -20,4 +16,2 @@ // module.exports.NODE_ENV = process.env.NODE_ENV || DEVELOPMENT;

module.exports.isProduction = nodeEnvironment === modeProductionName;
module.exports.isBuildLib = buildType === buildTypeLibrary;
module.exports.isBuildSite = buildType === buildTypeSite;

@@ -28,3 +22,3 @@ module.exports.cwd = process.cwd();

module.exports.pathToDist = '/dist';
module.exports.pathToDist = '/dist-test';

@@ -31,0 +25,0 @@ module.exports.pathToStaticFileFolder = '/static';

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

const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

@@ -64,3 +66,3 @@

cssLoader,
'css-modules-flow-types-loader',
path.resolve('./dist/index.js'),
{

@@ -84,3 +86,3 @@ loader: 'css-loader',

cssLoader,
'css-modules-flow-types-loader',
path.resolve('./dist/index.js'),
{

@@ -87,0 +89,0 @@ loader: 'css-loader',

@@ -11,3 +11,3 @@ const webpack = require('webpack');

const {isProduction, isDevelopment, isBuildLib, isBuildSite} = require('./../config');
const {isProduction, isDevelopment} = require('./../config');

@@ -25,16 +25,2 @@ // const date = new Date();

const staticFilesLibraryList = [
{
from: '@types/index.d.ts',
to: './index.d.ts',
},
];
const staticFilesSiteList = [
{
from: './www/favicon.ico',
to: './favicon.ico',
},
];
const pluginList = [

@@ -63,29 +49,2 @@ new CircularDependencyPlugin({

if (isBuildLib) {
pluginList.push(
new CopyWebpackPlugin({
patterns: staticFilesLibraryList,
})
);
}
if (isBuildSite) {
pluginList.push(
new HtmlWebpackPlugin({
template: './www/index.html',
minify: {
collapseWhitespace: isProduction,
removeComments: isProduction,
minifyCSS: isProduction,
minifyJS: isProduction,
},
hash: true,
filename: './index.html',
}),
new CopyWebpackPlugin({
patterns: staticFilesSiteList,
})
);
}
module.exports.plugins = pluginList;

Sorry, the diff of this file is not supported yet