Skip to content

Commit

Permalink
Refactor build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 20, 2022
1 parent e6bf81d commit df38504
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"devDependencies": {
"@types/node": "^18.0.0",
"c8": "^7.0.0",
"gemoji": "^7.0.0",
"gemoji": "^8.0.0",
"markdown-table": "^3.0.0",
"prettier": "^2.0.0",
"remark-cli": "^11.0.0",
Expand Down
10 changes: 5 additions & 5 deletions script/build-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
* @property {Array<string>} emoticons
*/

import assert from 'node:assert'
import fs from 'node:fs'
import assert from 'node:assert/strict'
import fs from 'node:fs/promises'
import {gemoji} from 'gemoji'

/** @type {Record<string, Array<string>>} */
const schema = JSON.parse(String(fs.readFileSync('schema.json')))
const schema = JSON.parse(String(await fs.readFile('schema.json')))
/** @type {Record<string, string|Array<string>>} */
const alias = JSON.parse(String(fs.readFileSync('alias.json')))
const alias = JSON.parse(String(await fs.readFile('alias.json')))

const own = {}.hasOwnProperty

Expand Down Expand Up @@ -89,7 +89,7 @@ for (info of data) {
}

// Write.
fs.writeFileSync(
await fs.writeFile(
'index.js',
[
'/**',
Expand Down
4 changes: 2 additions & 2 deletions script/build-support.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'node:fs'
import fs from 'node:fs/promises'
import {markdownTable} from 'markdown-table'
import {emoticon} from '../index.js'

Expand All @@ -13,7 +13,7 @@ const data = [['Emoji', 'Name', 'Tags', 'Emoticons']].concat(
})
)

fs.writeFileSync(
await fs.writeFile(
'support.md',
[
'# Supported emoticons',
Expand Down

0 comments on commit df38504

Please sign in to comment.