Skip to content

Commit

Permalink
Updates all frozen pre-ESM dependencies 🏆🏆🏆
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Oct 20, 2023
1 parent 5277d55 commit db37e6c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 26 deletions.
7 changes: 0 additions & 7 deletions docs/release-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@

- `@iarna/toml` has a 3.0 that we have never been on but it was released the same day as the last 2.x https://github.com/BinaryMuse/toml-node/commits/master (needs more investigation)

## List of dependencies that went ESM

- `@sindresorhus/slugify` ESM at 2.x
- `multimatch` is ESM at 6
- `bcp-47-normalize` at 1.x
- `prettier` at 3.x

# Release Procedure

1. (Optional) Update minor dependencies in package.json
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
],
"scripts": {
"default": "npm run test",
"format": "prettier src/ --write",
"format": "prettier . --write",
"test": "npx ava --verbose",
"lint-staged": "lint-staged",
"coverage": "npx nyc ava && npx nyc report --reporter=json-summary && cp coverage/coverage-summary.json docs-src/_data/coverage.json && node cmd.cjs --config=docs-src/.eleventy.docs.js",
Expand Down Expand Up @@ -82,9 +82,9 @@
"js-yaml": "^4.1.0",
"lint-staged": "^13.2.3",
"markdown-it-emoji": "^2.0.2",
"marked": "^5.1.1",
"marked": "^9.1.2",
"nyc": "^15.1.0",
"prettier": "^2.8.8",
"prettier": "^3.0.3",
"pretty": "^2.0.0",
"rimraf": "^5.0.1",
"sass": "^1.63.6",
Expand All @@ -96,8 +96,8 @@
"@11ty/eleventy-dev-server": "^1.0.4",
"@11ty/eleventy-utils": "^1.0.1",
"@11ty/lodash-custom": "^4.17.21",
"@sindresorhus/slugify": "^1.1.2",
"bcp-47-normalize": "^1.1.1",
"@sindresorhus/slugify": "^2.2.1",
"bcp-47-normalize": "^2.3.0",
"chokidar": "^3.5.3",
"cross-spawn": "^7.0.3",
"debug": "^4.3.4",
Expand All @@ -114,7 +114,7 @@
"micromatch": "^4.0.5",
"minimist": "^1.2.8",
"moo": "^0.5.2",
"multimatch": "^5.0.0",
"multimatch": "^6.0.0",
"normalize-path": "^3.0.0",
"nunjucks": "^3.2.4",
"please-upgrade-node": "^3.2.0",
Expand Down
12 changes: 6 additions & 6 deletions src/Plugins/I18nPlugin.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import bcp47Normalize from "bcp-47-normalize";
import { bcp47Normalize } from "bcp-47-normalize";
import iso639 from "iso-639-1";

import { DeepCopy } from "../Util/Merge.js";
Expand Down Expand Up @@ -189,12 +189,12 @@ function EleventyPlugin(eleventyConfig, opts = {}) {
},
errorMode: "strict", // allow-fallback, never
},
opts
opts,
);

if (!options.defaultLanguage) {
throw new Error(
"You must specify a `defaultLanguage` in Eleventy’s Internationalization (I18N) plugin."
"You must specify a `defaultLanguage` in Eleventy’s Internationalization (I18N) plugin.",
);
}

Expand Down Expand Up @@ -262,13 +262,13 @@ function EleventyPlugin(eleventyConfig, opts = {}) {
// this is not a localized file (independent of a language code)
if (options.errorMode === "strict") {
throw new Error(
`Localized file for URL ${prependedLangCodeUrl} was not found in your project. A non-localized version does exist—are you sure you meant to use the \`${options.filters.url}\` filter for this? You can bypass this error using the \`errorMode\` option in the I18N plugin (current value: "${options.errorMode}").`
`Localized file for URL ${prependedLangCodeUrl} was not found in your project. A non-localized version does exist—are you sure you meant to use the \`${options.filters.url}\` filter for this? You can bypass this error using the \`errorMode\` option in the I18N plugin (current value: "${options.errorMode}").`,
);
}
} else if (options.errorMode === "allow-fallback") {
// You’re linking to a localized file that doesn’t exist!
throw new Error(
`Localized file for URL ${prependedLangCodeUrl} was not found in your project! You will need to add it if you want to link to it using the \`${options.filters.url}\` filter. You can bypass this error using the \`errorMode\` option in the I18N plugin (current value: "${options.errorMode}").`
`Localized file for URL ${prependedLangCodeUrl} was not found in your project! You will need to add it if you want to link to it using the \`${options.filters.url}\` filter. You can bypass this error using the \`errorMode\` option in the I18N plugin (current value: "${options.errorMode}").`,
);
}

Expand Down Expand Up @@ -322,7 +322,7 @@ function EleventyPlugin(eleventyConfig, opts = {}) {
__locale_page_resolved: true,
};
return result;
}
},
);
}

Expand Down
14 changes: 7 additions & 7 deletions test/TemplateRenderCustomTest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import test from "ava";
import { createSSRApp } from "vue";
import { renderToString } from "@vue/server-renderer";
import sass from "sass";
import * as sass from "sass";

import TemplateRender from "../src/TemplateRender.js";
import EleventyExtensionMap from "../src/EleventyExtensionMap.js";
Expand Down Expand Up @@ -158,7 +158,7 @@ test("Custom Sass Render", async (t) => {
} else {
resolve(result.css.toString("utf8"));
}
}
},
);
});
};
Expand All @@ -173,7 +173,7 @@ test("Custom Sass Render", async (t) => {
(await fn({})).trim(),
`p {
color: blue;
}`
}`,
);
});

Expand Down Expand Up @@ -220,7 +220,7 @@ test("JavaScript functions should not be mutable but not *that* mutable", async
"dist",
null,
null,
eleventyConfig
eleventyConfig,
);
let data = await tmpl.getData();
t.is(await tmpl.render(data), "<p>Paragraph</p>");
Expand Down Expand Up @@ -302,7 +302,7 @@ test.skip("Breaking Change (3.0): Two simple aliases to JavaScript Render", asyn
"./test/stubs/string.11ty.possum",
null,
eleventyConfig,
map
map,
);
let fn2 = await tr2.getCompiledTemplate();
t.is(await fn2({}), "<p>Possum</p>");
Expand All @@ -327,13 +327,13 @@ test("Double override (not aliases) throws an error", async (t) => {
"./test/stubs/string.11ty.custom",
null,
eleventyConfig,
map
map,
);
await tr.getCompiledTemplate();
},
{
message:
'An attempt was made to override the *already* overridden "11ty.js" template syntax via the `addExtension` configuration API. A maximum of one override is currently supported. If you’re trying to add an alias to an existing syntax, make sure only the `key` property is present in the addExtension options object.',
}
},
);
});

0 comments on commit db37e6c

Please sign in to comment.