Skip to content

Commit

Permalink
Convert create-blog-post to mjs too
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Jul 18, 2024
1 parent e216830 commit 4b79059
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
"build": "bundle exec jekyll build",
"fusv": "fusv _sass",
"stylelint": "stylelint \"**/*.{css,scss}\"",
"eslint": "eslint --report-unused-disable-directives .",
"eslint": "eslint --report-unused-disable-directives --ext js,.mjs .",
"markdownlint": "markdownlint-cli2 \"**/*.md\" \"!**/node_modules/**\" \"!**/vendor/**\"",
"lint": "npm-run-all --parallel --continue-on-error eslint stylelint fusv markdownlint vnu",
"vnu": "node ./scripts/vnu-jar.mjs",
"test": "npm run lint",
"serve": "bundle exec jekyll serve",
"svgo:base": "svgo --config=_svgo.config.js --recursive",
"svgo": "npm-run-all --parallel \"svgo:base -- --folder=_includes\" \"svgo:base -- --folder=assets/img\"",
"create-blog": "node scripts/create-blog-post.js"
"create-blog": "node scripts/create-blog-post.mjs"
},
"devDependencies": {
"autoprefixer": "^10.4.19",
Expand Down
6 changes: 5 additions & 1 deletion scripts/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
"es6": true,
"node": true
},
"extends": "../.eslintrc.json"
"extends": "../.eslintrc.json",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
}
}
7 changes: 5 additions & 2 deletions scripts/create-blog-post.js → scripts/create-blog-post.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@
* - The script assumes a Jekyll blog structure with a `_posts` directory.
*/

const fs = require('fs');
const path = require('path');
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url'

const __dirname = path.dirname(fileURLToPath(import.meta.url))

const createBlogPost = (title) => {
const date = new Date().toISOString().split('T')[0];
Expand Down
2 changes: 0 additions & 2 deletions scripts/vnu-jar.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

'use strict'

import { execFile, spawn } from 'node:child_process'
import vnu from 'vnu-jar'

Expand Down

0 comments on commit 4b79059

Please sign in to comment.