Skip to content

Commit

Permalink
Use sass NodePackageImporter
Browse files Browse the repository at this point in the history
  • Loading branch information
jgerigmeyer committed Feb 21, 2024
1 parent 3edb82e commit d65fb50
Show file tree
Hide file tree
Showing 45 changed files with 1,064 additions and 2,548 deletions.
1 change: 0 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ settings:
sassjson: 'sass-json-loader'
import/external-module-folders:
- 'node_modules'
- '.yarn'
extends:
- eslint:recommended
- plugin:import/recommended
Expand Down
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ updates:
update-types:
- 'minor'
- 'patch'
ignore:
- dependency-name: 'chalk'
update-types:
- 'version-update:semver-major'
- dependency-name: 'del'
update-types:
- 'version-update:semver-major'
- dependency-name: 'strip-indent'
update-types:
- 'version-update:semver-major'
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
2 changes: 1 addition & 1 deletion assets/js/base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sassConfig from '!json-loader!sassjson!sass-loader!../../scss/json.scss';
import sassConfig from '../../scss/json.scss';

export const initializeToggles = () => {
const body = $('body');
Expand Down
4 changes: 2 additions & 2 deletions lib/annotations/example.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
'use strict';

const beautify = require('html').prettyPrint;
const { NodePackageImporter } = require('sass');
const stripIndent = require('strip-indent');

const renderIframe = require('../renderIframe');
const getCustomNunjucksEnv = require('../utils/getCustomNunjucksEnv');
const sassImporter = require('../utils/sassImporter');

const beautifyOpts = {
indent_size: 2,
Expand Down Expand Up @@ -75,7 +75,7 @@ module.exports = (env) => {
}
}
let sassData = exampleItem.code;
let sassOptions = { importers: [sassImporter] };
let sassOptions = { importers: [new NodePackageImporter()] };
/* istanbul ignore else */
if (env.herman && env.herman.sass) {
if (env.herman.sass.includes) {
Expand Down
59 changes: 0 additions & 59 deletions lib/utils/sassImporter.js

This file was deleted.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
"test:js:src:ci": "nyc mocha -t 5000 -R dot -R mocha-junit-reporter test/js",
"test:js:watch": "yarn test:js:client --watchAll",
"test:sass": "mocha -R dot test/sass/test_sass.js",
"postinstall": "yarn husky install",
"prepack": "yarn pinst --disable && yarn build",
"postpack": "yarn pinst --enable"
"postinstall": "husky",
"prepack": "pinst --disable && yarn build",
"postpack": "pinst --enable"
},
"dependencies": {
"cheerio": "1.0.0-rc.12",
Expand All @@ -70,7 +70,7 @@
"nunjucks": "^3.2.4",
"readable-stream": "^4.5.2",
"sassdoc-extras": "^3.0.0",
"strip-indent": "^4.0.0",
"strip-indent": "^3.0.0",
"typogr": "^0.6.8",
"unixify": "^1.0.0",
"vinyl-fs": "^4.0.0"
Expand All @@ -83,17 +83,16 @@
"@babel/preset-env": "^7.23.9",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^6.4.2",
"@yarnpkg/sdks": "^3.1.0",
"accoutrement": "^4.0.4",
"autoprefixer": "^10.4.17",
"babel-jest": "^29.7.0",
"babel-loader": "^9.1.3",
"chalk": "^5.3.0",
"chalk": "^4.1.2",
"core-js": "^3.36.0",
"css-loader": "^6.10.0",
"css-minimizer-webpack-plugin": "^6.0.0",
"cssremedy": "^0.1.0-beta.2",
"del": "^7.1.0",
"del": "^6.1.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-node": "^0.3.9",
Expand Down Expand Up @@ -143,15 +142,16 @@
"cdocparser": "^0.15.0"
},
"lint-staged": {
"*.js": [
"prettier --write",
"eslint --fix"
"*.{js,cjs,ts,md}": [
"eslint --fix",
"prettier --write --ignore-unknown"
],
"*.scss": [
"stylelint --fix"
"stylelint --fix --allow-empty-input",
"prettier --write --ignore-unknown"
],
"*.{json,yml}": [
"prettier --write"
"prettier --write --ignore-unknown"
]
},
"packageManager": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion scss/component/_breadcrumb.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// So you always know where you are…
/// @group component-breadcrumb

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

// Breadcrumb
// ----------
Expand Down
2 changes: 1 addition & 1 deletion scss/component/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/// </span>
/// </aside>

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';
@use '../config';

/// Layout for the footer credit.
Expand Down
2 changes: 1 addition & 1 deletion scss/component/_item.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Item Styles
// ===========

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

.item {
margin-bottom: tools.size('spacer');
Expand Down
2 changes: 1 addition & 1 deletion scss/component/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// # Herman Navigation Components
/// @group component-nav

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';
@use '../config';

// Nav Lists
Expand Down
2 changes: 1 addition & 1 deletion scss/component/_project-meta.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Project Meta Styles
// ===================

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';
@use '../config';

.project-links {
Expand Down
2 changes: 1 addition & 1 deletion scss/component/_search.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Search
// ======

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

.search-heading {
font-size: tools.size('h1');
Expand Down
2 changes: 1 addition & 1 deletion scss/config/_abstracts.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use 'sass:list';
@use 'sass:meta';
@use '../utilities';
@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

// Accoutrement Utils
// ==================
Expand Down
2 changes: 1 addition & 1 deletion scss/config/_banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Styles related to the top banner in generated Herman docs.
/// @group style-banner

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

// Banner Arrow
// ------------
Expand Down
2 changes: 1 addition & 1 deletion scss/config/_index.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '~accoutrement/sass/tools' with (
@use 'pkg:accoutrement/sass/tools' with (
$color-var-prefix: 'herman-'
);

Expand Down
2 changes: 1 addition & 1 deletion scss/config/_type.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Typography Config
// =================

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

/// ## macro `link_if()`
/// This Nunjucks utility macro returns either
Expand Down
2 changes: 1 addition & 1 deletion scss/config/_z-index.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Z-Index
// =======

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

/// List of named z-index layers for Herman's layout.
/// The order they are defined
Expand Down
2 changes: 1 addition & 1 deletion scss/iframes/_base.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

:root {
line-height: tools.ratio('line-height');
Expand Down
2 changes: 1 addition & 1 deletion scss/iframes/_color.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Preview Layouts
// ===============

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

// Color Preview
// -------------
Expand Down
2 changes: 1 addition & 1 deletion scss/iframes/_font.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

[data-herman-preview='font'] {
--herman-label-color: #{tools.color('slight')};
Expand Down
2 changes: 1 addition & 1 deletion scss/iframes/_size.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

[data-herman-size='overflow'] {
max-width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion scss/initial/_icons.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Icons
// =====

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

/// # Herman Icons
/// Herman doesn't use very many icons internally…
Expand Down
2 changes: 1 addition & 1 deletion scss/initial/_root.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Root Typography
// ===============

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';
@use '../config';

/// # Herman Typography
Expand Down
4 changes: 2 additions & 2 deletions scss/initial/_sample-previews.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Sample Previews
// ===============

@use '~accoutrement/sass/tools';
@use 'samples/colors';
@use 'pkg:accoutrement/sass/tools';
@use '../samples/colors';

// Add color sample CSS custom properties
:root {
Expand Down
2 changes: 1 addition & 1 deletion scss/layout/_banner.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Banner Styles
// =============

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';
@use '../config';

// Banner Region
Expand Down
2 changes: 1 addition & 1 deletion scss/layout/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Styles related to the main content area in generated Herman docs.
/// @group style-main

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

// Main Region
// -----------
Expand Down
2 changes: 1 addition & 1 deletion scss/layout/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Styles related to the navigation sidebar in generated Herman docs.
/// @group style-nav

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';
@use '../config';

// Nav Region
Expand Down
2 changes: 1 addition & 1 deletion scss/layout/_regions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/// as well as the `app` and `container` wrapping regions.
/// @group style-regions

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

// General
// -------
Expand Down
2 changes: 1 addition & 1 deletion scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@use 'utilities';
@use 'config';
@use '~cssremedy/css/remedy';
@use 'pkg:cssremedy/css/remedy';
@use 'initial';
@use 'layout';
@use 'patterns';
Expand Down
2 changes: 1 addition & 1 deletion scss/patterns/_forms.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Forms
// =====

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';

::placeholder {
color: currentcolor;
Expand Down
2 changes: 1 addition & 1 deletion scss/patterns/_type.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Typography Patterns
// ===================

@use '~accoutrement/sass/tools';
@use 'pkg:accoutrement/sass/tools';
@use '../config';

// Text Blocks
Expand Down
Loading

0 comments on commit d65fb50

Please sign in to comment.