diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 000000000..cb0f4177d --- /dev/null +++ b/.browserslistrc @@ -0,0 +1 @@ +Electron 9.4.4 diff --git a/.sass-lint.yml b/.sass-lint.yml deleted file mode 100644 index 35fd95b02..000000000 --- a/.sass-lint.yml +++ /dev/null @@ -1,97 +0,0 @@ -options: - formatter: stylish -files: - include: 'src/styles/**/*.s+(a|c)ss' -rules: - # Extends - extends-before-mixins: 1 - extends-before-declarations: 1 - placeholder-in-extend: 1 - - # Mixins - mixins-before-declarations: 1 - - # Line Spacing - one-declaration-per-line: 1 - empty-line-between-blocks: 1 - single-line-per-selector: 1 - - # Disallows - no-attribute-selectors: 0 - no-color-hex: 0 - no-color-keywords: 1 - no-color-literals: 1 - no-combinators: 0 - no-css-comments: 1 - no-debug: 1 - no-disallowed-properties: 0 - no-duplicate-properties: 1 - no-empty-rulesets: 1 - no-extends: 0 - no-ids: 1 - no-important: 1 - no-invalid-hex: 1 - no-mergeable-selectors: 1 - no-misspelled-properties: 1 - no-qualifying-elements: 1 - no-trailing-whitespace: 1 - no-trailing-zero: 1 - no-transition-all: 1 - no-universal-selectors: 0 - no-url-domains: 1 - no-url-protocols: 1 - no-vendor-prefixes: 0 - no-warn: 1 - property-units: 0 - - # Nesting - declarations-before-nesting: 1 - force-attribute-nesting: 1 - force-element-nesting: 1 - force-pseudo-nesting: 1 - - # Name Formats - class-name-format: - - enabled: 1 - - convention: hyphenatedbem - function-name-format: 1 - id-name-format: 0 - mixin-name-format: 1 - placeholder-name-format: 1 - variable-name-format: 1 - - # Style Guide - attribute-quotes: 1 - bem-depth: 0 - border-zero: 1 - brace-style: 1 - clean-import-paths: 1 - empty-args: 1 - hex-length: 1 - hex-notation: 1 - indentation: 1 - leading-zero: 1 - max-line-length: 0 - max-file-line-count: 0 - nesting-depth: 0 - property-sort-order: 0 - pseudo-element: 1 - quotes: 1 - shorthand-values: 1 - url-quotes: 1 - variable-for-property: 1 - zero-unit: 1 - - # Inner Spacing - space-after-comma: 1 - space-before-colon: 1 - space-after-colon: 1 - space-before-brace: 1 - space-before-bang: 1 - space-after-bang: 1 - space-between-parens: 1 - space-around-operator: 1 - - # Final Items - trailing-semicolon: 1 - final-newline: 1 diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 000000000..d75964a3f --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,8 @@ +{ + "extends": "stylelint-config-standard-scss", + "rules": { + "selector-class-pattern": null, + "custom-property-pattern": null, + "scss/at-extend-no-missing-placeholder": null + } +} diff --git a/config/webpack.config.js b/config/webpack.config.js index d1d261ca5..d9176e014 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -17,9 +17,6 @@ * - [output](https://webpack.js.org/configuration/output/) */ -const autoprefixer = require('autoprefixer'); -const postUrl = require('postcss-url'); -const fs = require('fs'); const path = require('path'); const webpack = require('webpack'); const HtmlWebpackPlugin = require('html-webpack-plugin'); @@ -39,90 +36,9 @@ const publicUrl = publicPath.slice(0, -1); // Get environment variables to inject into our app. const env = getClientEnvironment(publicUrl); -// style files regexes -const cssRegex = /\.css$/; -// const cssModuleRegex = /\.module\.css$/; -const sassRegex = /\.(scss|sass)$/; -// const sassModuleRegex = /\.module\.(scss|sass)$/; - const isProduction = env.stringified['process.env'].NODE_ENV === '"production"'; -const shouldUseSourceMap = isProduction && (process.env.GENERATE_SOURCEMAP !== 'false'); - const cssFilenameTemplate = 'static/css/[name].[contenthash:8].css'; -// common function to get style loaders -const getStyleLoaders = (preProcessor) => { - // importLoaders: See https://webpack.js.org/loaders/css-loader/#importloaders - let importLoaders = 1; // for postcss-loader - if (preProcessor) { - importLoaders += 1; // for preProcessor - } - - let inlineStyleLoader = require.resolve('style-loader'); - if (isProduction) { - // Output CSS files, and rewrite paths relative from CSS dir - const cssRelativePath = Array(cssFilenameTemplate.split('/').length).join('../'); - inlineStyleLoader = { - loader: MiniCssExtractPlugin.loader, - options: { publicPath: cssRelativePath }, - }; - } - - const loaders = [ - inlineStyleLoader, - { - loader: require.resolve('css-loader'), - options: { importLoaders }, - }, - { - // Options for PostCSS as we reference these options twice - // Adds vendor prefixing based on your specified browser support in - // package.json - loader: require.resolve('postcss-loader'), - options: { - postcssOptions: { - plugins: [ - [ - 'autoprefixer', - { - flexbox: 'no-2009', - }, - ], - [ - 'postcss-url', - { - url: ({ url }) => { - /** - * If file exists in the Network Canvas submodule, update path to - * resolve there relatively from Architect. - */ - const ncPath = path.resolve('src', 'network-canvas', 'src', 'styles', url); - const ncCSSPath = `../network-canvas/src/styles/${url}`; - - try { - fs.accessSync(ncPath, fs.constants.R_OK); - return ncCSSPath; - } catch (err) { - return url; - } - }, - }, - ], - ], - }, - sourceMap: shouldUseSourceMap, - }, - }, - ]; - if (preProcessor) { - loaders.push({ - loader: require.resolve(preProcessor), - }); - // loaders.push(require.resolve(preProcessor)); - } - return loaders; -}; - const loaderRules = Object.freeze([ // Disable require.ensure as it's not a standard language feature. { parser: { requireEnsure: false } }, @@ -198,25 +114,9 @@ const loaderRules = Object.freeze([ }, }], }, - // "postcss" loader applies autoprefixer to our CSS. - // "css" loader resolves paths in CSS and adds assets as dependencies. - // "style" loader turns CSS into JS modules that inject