Skip to content

Commit f967ef4

Browse files
committed
Switch to type: module.
1 parent 52b351d commit f967ef4

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

.eleventy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const drafts = [
1212
'latest'
1313
];
1414

15-
module.exports = function(eleventyConfig) {
15+
export default async function(eleventyConfig) {
1616
eleventyConfig.addPassthroughCopy('404.html');
1717
eleventyConfig.addPassthroughCopy('.htaccess');
1818
eleventyConfig.addPassthroughCopy('LICENSE.md');

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "json-ld.org",
33
"private": true,
44
"description": "json-ld.org homepage",
5+
"type": "module",
56
"scripts": {
67
"build": "eleventy",
78
"pages": "wrangler pages dev _site/",

requirements/index.11tydata.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
const fs = require('node:fs/promises');
2-
const path = require('node:path');
1+
import { fileURLToPath } from 'url';
2+
import fs from 'node:fs/promises';
3+
import path from 'node:path';
4+
5+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
36

47
const specStatuses = ['ED'];
58

@@ -35,7 +38,7 @@ const specs = [
3538
'requirements'
3639
];
3740

38-
module.exports = async function() {
41+
export default async function() {
3942
return {
4043
specs: Object.fromEntries(await Promise.all(specs.map(async spec => {
4144
return [spec, await getDrafts(spec)];

spec/index.11tydata.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
const fs = require('node:fs/promises');
2-
const path = require('node:path');
1+
import { fileURLToPath } from 'url';
2+
import fs from 'node:fs/promises';
3+
import path from 'node:path';
4+
5+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
36

47
const specStatuses = ['ED', 'FCGS', 'WD', 'CR', 'PR', 'REC'/*, 'CG-FINAL'*/];
58

@@ -33,14 +36,14 @@ async function getDrafts(spec) {
3336

3437
const specs = [
3538
'json-ld',
36-
'json-ld-syntax',
37-
'json-ld-api',
38-
'json-ld-api-best-practices',
39-
'json-ld-framing',
39+
'json-ld-syntax',
40+
'json-ld-api',
41+
'json-ld-api-best-practices',
42+
'json-ld-framing',
4043
'json-ld-rdf'
4144
];
4245

43-
module.exports = async function() {
46+
export default async function() {
4447
return {
4548
specs: Object.fromEntries(await Promise.all(specs.map(async spec => {
4649
return [spec, await getDrafts(spec)];

0 commit comments

Comments
 (0)