Skip to content

Commit

Permalink
Merge pull request sass#66 from oddbird/address-review
Browse files Browse the repository at this point in the history
Address review feedback from sass#737
  • Loading branch information
jgerigmeyer committed Jun 22, 2023
2 parents 5bb7f5d + 5b8d9e2 commit 06abd86
Show file tree
Hide file tree
Showing 150 changed files with 20,268 additions and 16,779 deletions.
3 changes: 2 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@
"assets/dist/": true,
"yarn-debug.log": true,
"yarn-error.log": true,
"yarn.lock": true
"yarn.lock": true,
"package-lock.json": true
}
}
}
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
/source/documentation/js-api
coverage/
node_modules/
package-lock.json

!/source/assets/js/vendor/index.js
54 changes: 0 additions & 54 deletions .eslintrc.js

This file was deleted.

10 changes: 9 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
{
"extends": "./node_modules/gts/"
"extends": "./node_modules/gts/",
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2021
},
"rules": {
"node/no-unpublished-import": "off",
"node/no-unpublished-require": "off"
}
}
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: 'weekly'
ignore:
- dependency-name: '@types/node'
update-types: ['version-update:semver-major']
# Major version bumps for the following dependencies require pure ESM,
# which 11ty does not yet support.
# See: https://github.com/11ty/eleventy/issues/836
- dependency-name: '@sindresorhus/slugify'
update-types: ['version-update:semver-major']
10 changes: 5 additions & 5 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
cache: npm
- name: Install dependencies
run: yarn install --immutable
run: npm ci
- name: Build site
run: yarn build-prod
run: npm run build-prod
- name: Check for broken internal links
run: yarn checklinks:internal
run: npm run checklinks:internal
- name: Check for broken external links
run: yarn checklinks:external
run: npm run checklinks:external
6 changes: 3 additions & 3 deletions .github/workflows/shadow-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn install
- run: yarn build-prod
cache: npm
- run: npm ci
- run: npm run build-prod
- name: Clone shadow repo
uses: actions/checkout@v3
with:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
cache: npm
- name: Install & build
run: |
yarn install --immutable
yarn build-prod
npm ci
npm run build-prod
- name: Check links
run: yarn checklinks:internal
run: npm run checklinks:internal

lint:
name: Lint
Expand All @@ -34,8 +34,8 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
cache: npm
- name: Install dependencies
run: yarn install --immutable
run: npm ci
- name: Lint
run: yarn lint:ci
run: npm run lint:ci
4 changes: 1 addition & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
!.*
.git/
.vscode/
.yarn/
.yarnrc
.yarnrc.yml
/**/*.md
/.language/
/_site/
Expand All @@ -14,5 +11,6 @@
/source/documentation/js-api
coverage/
node_modules/
package-lock.json

!/source/assets/js/vendor/index.ts
2 changes: 0 additions & 2 deletions .prettierrc

This file was deleted.

17 changes: 0 additions & 17 deletions .stylelintignore
Original file line number Diff line number Diff line change
@@ -1,18 +1 @@
!.*
.git/
.vscode/
.yarn/
.yarnrc
.yarnrc.yml
/.language/
/_site/
/source/_data/versionCache.json
/source/assets/dist/
/source/assets/js/vendor/**
/source/assets/sass/vendor/
/source/blog/*.md
/source/documentation/js-api
coverage/
node_modules/

!/source/assets/js/vendor/index.ts
874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.0.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions .yarnrc.yml

This file was deleted.

25 changes: 9 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@ following:

## Running Locally

### Install Node and Yarn
### Install Node

We recommend using [nvm](https://github.com/nvm-sh/nvm) for node version
management. [Install it](https://github.com/nvm-sh/nvm#installation-and-update)
if necessary, then run `nvm install` (once per active shell) to use the correct
version of node for development.

The correct [Yarn](https://yarnpkg.com/) version is included in the repo, and
will be used automatically for any `yarn` command.

To upgrade the node version used by the Sass website, update the version number
in these places and then run `nvm install` to upgrade:

Expand All @@ -33,14 +30,10 @@ in these places and then run `nvm install` to upgrade:
- `netlify.toml`
- `Dockerfile`

To upgrade the yarn version, run `yarn set version latest`, then update the
version number in `netlify.toml` and `package.json` (`engines.yarn` field) if
necessary.

### Install dependencies

```
yarn
npm install
```

### Development tasks
Expand All @@ -49,7 +42,7 @@ Compile and run [Eleventy](https://www.11ty.dev/) server, with a watcher for
file changes:

```
yarn serve
npm run serve
```

The site will be compiled into `_site/` and available at http://localhost:8080.
Expand All @@ -58,10 +51,10 @@ You can also run individual commands:

```
# build the static site for development
yarn build
npm run build
# format and lint all files
yarn lint
npm run lint
```

## Templates
Expand All @@ -85,10 +78,10 @@ yarn lint
while `render` always parses the partial as a LiquidJS template.
- `.md` files are parsed both as Markdown _and_ as LiquidJS templates.
- When using Markdown, remember that _indentation and whitespace (e.g newlines)
matter_. Use Markdown selectively, especially in files that include other
non-Markdown partials.
- For example, the `{% codeExample %}` tag renders whitespace that results
in unwanted `<p>` tags when parsed as Markdown.
matter_. Custom tags attempt to strip leading whitespace from text contents
(based on the whitespace of the first line of text) to allow for more readable
indentation between tags -- see the `stripIndent` function in
`source/helpers/type.ts` for details.

## Deploying

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ FROM node:16
WORKDIR /app

COPY . /app
RUN yarn install
RUN npm install

CMD yarn serve
CMD npm run serve
19 changes: 10 additions & 9 deletions eleventy.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { EleventyRenderPlugin } = require('@11ty/eleventy');
const {EleventyRenderPlugin} = require('@11ty/eleventy');
const {
absoluteUrl,
convertHtmlToAbsoluteUrls,
Expand All @@ -13,13 +13,13 @@ const yaml = require('js-yaml');
const componentsPlugin =
require('./source/helpers/components/index.ts').default;
const datesPlugin = require('./source/helpers/dates.ts').default;
const { liquidEngine, markdownEngine } = require('./source/helpers/engines.ts');
const {liquidEngine, markdownEngine} = require('./source/helpers/engines.ts');
const pagesPlugin = require('./source/helpers/pages.ts').default;
const typePlugin = require('./source/helpers/type.ts').default;
const functionPlugin = require('./source/helpers/function.ts').default;

/** @param {import('@11ty/eleventy').UserConfig} eleventyConfig */
module.exports = (eleventyConfig) => {
module.exports = eleventyConfig => {
eleventyConfig.addPassthroughCopy('source/assets/dist');
eleventyConfig.addPassthroughCopy('source/assets/img');
eleventyConfig.addPassthroughCopy('source/favicon.ico');
Expand All @@ -34,10 +34,11 @@ module.exports = (eleventyConfig) => {

eleventyConfig.setLibrary('liquid', liquidEngine);
eleventyConfig.setLibrary('md', markdownEngine);
eleventyConfig.addDataExtension('yml, yaml', (contents) =>
yaml.load(contents),
);
eleventyConfig.addDataExtension('ts', (_, filepath) => require(filepath));
eleventyConfig.addDataExtension('yml, yaml', contents => yaml.load(contents));
eleventyConfig.addDataExtension('ts', {
parser: filepath => require(filepath),
read: false,
});

// register filters and shortcodes
eleventyConfig.addPlugin(componentsPlugin);
Expand All @@ -50,12 +51,12 @@ module.exports = (eleventyConfig) => {
eleventyConfig.addLiquidFilter('absoluteUrl', absoluteUrl);
eleventyConfig.addLiquidFilter(
'getNewestCollectionItemDate',
getNewestCollectionItemDate,
getNewestCollectionItemDate
);
eleventyConfig.addLiquidFilter('dateToRfc3339', dateToRfc3339);
eleventyConfig.addLiquidFilter(
'htmlToAbsoluteUrls',
convertHtmlToAbsoluteUrls,
convertHtmlToAbsoluteUrls
);

// other plugins
Expand Down
2 changes: 0 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
[build.environment]
NODE_VERSION = "16"
YARN_VERSION = "3.6.0"
YARN_CACHE_FOLDER = "/opt/buildhome/.yarn_cache"

[[plugins]]
package = "netlify-plugin-11ty"
Expand Down
Loading

0 comments on commit 06abd86

Please sign in to comment.