Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Big v3.0.0 Project Slipstream Changes #3074

Merged
merged 42 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
01fa28b
Removes pug, hbs, mustache, ejs, and haml from core. Removes Edge and…
zachleat Jul 17, 2023
a878c79
Update deps, remove vue plugin from tests
zachleat Jul 17, 2023
883d6b6
Bump to Node 16+ for 3.x
zachleat Jul 17, 2023
d3796c5
Remove Node 14 from CI
zachleat Jul 17, 2023
578f420
Consume ESM in Data Files.
zachleat Aug 11, 2023
0f518a3
Code style
zachleat Aug 11, 2023
ca7ad77
Code simplification
zachleat Aug 11, 2023
a401347
Windows fix.
zachleat Aug 12, 2023
e5b3a4c
Remove unused feature
zachleat Aug 18, 2023
4118b55
Don’t swallow errors!
zachleat Aug 18, 2023
ac122e2
Update dep
zachleat Aug 25, 2023
f35cb18
Don’t swallow errors
zachleat Aug 25, 2023
47ba827
Allow dependency resolution of ESM on --watch/--serve
zachleat Aug 25, 2023
37a3f56
Add .mjs to default extensions for data files.
zachleat Aug 25, 2023
eb68916
Add support for named exports in ESM data files
zachleat Sep 22, 2023
fbc7501
console sneak
zachleat Sep 22, 2023
35a175a
Use import for everything, per ESM
zachleat Sep 22, 2023
4041cce
Fix for CJS -> CJS import (was still being added to require.cache)
zachleat Oct 6, 2023
9dd25c5
Adding .mjs support
zachleat Oct 6, 2023
071c0cc
Test fix for .mjs support.
zachleat Oct 6, 2023
b5f5671
Convert to ESM in code base (export/import) (status commit)
zachleat Oct 6, 2023
864b316
In progress async changes
zachleat Oct 9, 2023
b968d34
It’s working.
zachleat Oct 9, 2023
2e995ca
Add async support for server init
zachleat Oct 9, 2023
163aa4c
Fix for duplicate config init
zachleat Oct 9, 2023
d6adaf5
Status update on fixing unit tests
zachleat Oct 14, 2023
683f173
Status commit (304 failures left)
zachleat Oct 14, 2023
a5a0ec8
Status commit (222 failures left)
zachleat Oct 15, 2023
7a11b4b
135 failing tests left
zachleat Oct 15, 2023
b02d4b0
Status commit (141 failures left)
zachleat Oct 15, 2023
36d71b5
Status commit (81 failures left)
zachleat Oct 15, 2023
607dfce
Status commit (59 failures left)
zachleat Oct 15, 2023
348bc29
Status commit (2 failures left)
zachleat Oct 19, 2023
d327c95
0 failures remaining.
zachleat Oct 20, 2023
03c048c
Windows fixes.
zachleat Oct 20, 2023
073fe3f
Better approach to cross platform paths
zachleat Oct 20, 2023
1921a3c
More places that `fileURLToPath` improves things.
zachleat Oct 20, 2023
2f91de1
3.0 breaking change: remove EOL Node 16
zachleat Oct 20, 2023
5277d55
Use `node:` prefix for Node builtins
zachleat Oct 20, 2023
db37e6c
Updates all frozen pre-ESM dependencies 🏆🏆🏆
zachleat Oct 20, 2023
7f0ada8
Output the version in this error message too, why not?
zachleat Oct 20, 2023
70b2d1d
Make addPlugin async-friendly, fixes #2675
zachleat Oct 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
node: ["14", "16", "18", "20"]
node: ["18", "20"]
name: Node.js ${{ matrix.node }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A simpler static site generator. An alternative to Jekyll. Written in JavaScript. Transforms a directory of templates (of varying types) into HTML.

Works with HTML, Markdown, JavaScript, Liquid, Nunjucks, Handlebars, Mustache, EJS, Haml, Pug, with addons for WebC, Sass, Vue, Svelte, JSX, and many others!
Works with HTML, Markdown, JavaScript, Liquid, Nunjucks, with addons for WebC, Sass, Vue, Svelte, JSX, and many others!

## ➡ [Documentation](https://www.11ty.dev/docs/)

Expand Down
143 changes: 143 additions & 0 deletions cmd.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#!/usr/bin/env node

// This file intentionally uses older code conventions to be as friendly
// as possible with error messaging to folks on older runtimes.

const pkg = require("./package.json");
require("please-upgrade-node")(pkg, {
message: function (requiredVersion) {
return (
"Eleventy " + pkg.version + " requires Node " +
requiredVersion +
". You will need to upgrade Node to use Eleventy!"
);
},
});

const debug = require("debug")("Eleventy:cmd");

(async function() {
const { default: EleventyErrorHandler } = await import("./src/EleventyErrorHandler.js");
const { default: EleventyBaseError } = await import("./src/EleventyBaseError.js");

class EleventyCommandCheckError extends EleventyBaseError {}

try {
let errorHandler = new EleventyErrorHandler();
const argv = require("minimist")(process.argv.slice(2), {
string: ["input", "output", "formats", "config", "pathprefix", "port", "to"],
boolean: [
"quiet",
"version",
"watch",
"dryrun",
"help",
"serve",
"incremental",
"ignore-initial",
],
default: {
quiet: null,
"ignore-initial": false,
},
unknown: function (unknownArgument) {
throw new EleventyCommandCheckError(
`We don’t know what '${unknownArgument}' is. Use --help to see the list of supported commands.`
);
},
});

debug("command: eleventy %o", argv);
const { Eleventy } = await import("./src/Eleventy.js");

process.on("unhandledRejection", (error, promise) => {
errorHandler.fatal(error, "Unhandled rejection in promise");
});
process.on("uncaughtException", (error) => {
errorHandler.fatal(error, "Uncaught exception");
});
process.on("rejectionHandled", (promise) => {
errorHandler.warn(promise, "A promise rejection was handled asynchronously");
});

if (argv.version) {
console.log(Eleventy.getVersion());
} else if (argv.help) {
console.log(Eleventy.getHelp());
} else {
let elev = new Eleventy(argv.input, argv.output, {
source: "cli",
// --quiet and --quiet=true both resolve to true
quietMode: argv.quiet,
configPath: argv.config,
pathPrefix: argv.pathprefix,
runMode: argv.serve ? "serve" : argv.watch ? "watch" : "build",
dryRun: argv.dryrun,
});

// reuse ErrorHandler instance in Eleventy
errorHandler = elev.errorHandler;

// careful, we can’t use async/await here to error properly
// with old node versions in `please-upgrade-node` above.
elev
.init()
.then(function () {
if (argv.to === "json" || argv.to === "ndjson") {
// override logging output
elev.setIsVerbose(false);
}

elev.setIgnoreInitial(argv["ignore-initial"]);
elev.setIncrementalBuild(argv.incremental);
elev.setFormats(argv.formats);

try {
if (argv.serve) {
let shouldStartServer = true;
elev
.watch()
.catch((e) => {
// Build failed but error message already displayed.
shouldStartServer = false;
// A build error occurred and we aren’t going to --serve
errorHandler.fatal(e, "Eleventy CLI Error");
})
.then(function () {
if (shouldStartServer) {
elev.serve(argv.port);
}
});
} else if (argv.watch) {
elev.watch().catch((e) => {
// A build error occurred and we aren’t going to --watch
errorHandler.fatal(e, "Eleventy CLI Error");
});
} else {
if (argv.to === "json") {
elev.toJSON().then(function (result) {
console.log(JSON.stringify(result, null, 2));
});
} else if (argv.to === "ndjson") {
elev.toNDJSON().then(function (stream) {
stream.pipe(process.stdout);
});
} else if (!argv.to || argv.to === "fs") {
elev.write();
} else {
throw new EleventyCommandCheckError(
`Invalid --to value: ${argv.to}. Supported values: \`fs\` (default), \`json\`, and \`ndjson\`.`
);
}
}
} catch (e) {
errorHandler.fatal(e, "Eleventy CLI Error");
}
})
.catch(errorHandler.fatal.bind(errorHandler));
}
} catch (e) {
let errorHandler = new EleventyErrorHandler();
errorHandler.fatal(e, "Eleventy CLI Fatal Error");
}
})();
132 changes: 0 additions & 132 deletions cmd.js

This file was deleted.

7 changes: 1 addition & 6 deletions docs/release-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +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

# Release Procedure

1. (Optional) Update minor dependencies in package.json
Expand All @@ -18,6 +12,7 @@
- 0.12.x+ requires Node 10+
- 1.x+ requires Node 12+
- 2.x+ requires Node 14+
- 3.x+ requires Node 18+
1. `rm -rf node_modules && rm -f package-lock.json && npm install`
1. `npm audit`
1. Make sure `npx ava` runs okay
Expand Down