-
-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
90 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
name: main | ||
on: | ||
push: | ||
branches: | ||
- website | ||
schedule: | ||
- cron: '45 7 2 * *' | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
- uses: dcodeIO/setup-node-nvm@master | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: node | ||
- run: npm install | ||
- run: npm test | ||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
- uses: JamesIves/github-pages-deploy-action@releases/v4 | ||
with: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
BRANCH: gh-pages | ||
FOLDER: dest | ||
SINGLE_COMMIT: true | ||
COMMIT_MESSAGE: . | ||
GIT_CONFIG_NAME: Titus Wormer | ||
GIT_CONFIG_EMAIL: [email protected] | ||
branch: gh-pages | ||
commit-message: . | ||
folder: dest | ||
git-config-email: [email protected] | ||
git-config-name: Titus Wormer | ||
single-commit: true | ||
name: main | ||
on: | ||
push: | ||
branches: | ||
- website |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
.DS_Store | ||
*.log | ||
.DS_Store | ||
dest/ | ||
node_modules/ | ||
src/fixtures.js | ||
src/to-name.js | ||
dest/ | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
ignore-scripts=true | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
dest/ | ||
*.html | ||
*.md | ||
dest/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import fs from 'node:fs/promises' | ||
import {iso6393} from 'iso-639-3' | ||
import {fetch} from 'undici' | ||
|
||
const iso6393ToName = {} | ||
|
||
let index = -1 | ||
|
||
while (++index < iso6393.length) { | ||
const language = iso6393[index] | ||
iso6393ToName[language.iso6393] = language.name | ||
} | ||
|
||
const response = await fetch( | ||
'https://raw.githubusercontent.com/wooorm/franc/main/test/fixtures.js' | ||
) | ||
const body = await response.text() | ||
|
||
await fs.writeFile(new URL('src/fixtures.js', import.meta.url), body) | ||
|
||
await fs.writeFile( | ||
new URL('src/to-name.js', import.meta.url), | ||
'export const toName = ' + JSON.stringify(iso6393ToName, undefined, 2) + '\n' | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,10 @@ | ||
{ | ||
"name": "franc-www", | ||
"private": true, | ||
"license": "MIT", | ||
"repository": "wooorm/franc", | ||
"bugs": "https://github.com/wooorm/franc/issues", | ||
"author": "Titus Wormer <[email protected]> (http://wooorm.com)", | ||
"bugs": "https://github.com/wooorm/franc/issues", | ||
"contributors": [ | ||
"Titus Wormer <[email protected]> (http://wooorm.com)" | ||
], | ||
"type": "module", | ||
"devDependencies": { | ||
"bail": "^2.0.0", | ||
"cssnano": "^6.0.0", | ||
"debounce": "^2.0.0", | ||
"esbuild": "^0.19.0", | ||
|
@@ -26,48 +20,54 @@ | |
"stylelint": "^14.0.0", | ||
"stylelint-config-prettier": "^9.0.0", | ||
"stylelint-config-standard": "^28.0.0", | ||
"undici": "^6.0.0", | ||
"xo": "^0.56.0" | ||
}, | ||
"license": "MIT", | ||
"name": "franc-www", | ||
"postcss": { | ||
"plugins": { | ||
"cssnano": { | ||
"preset": "default" | ||
} | ||
} | ||
}, | ||
"prettier": { | ||
"bracketSpacing": false, | ||
"semi": false, | ||
"singleQuote": true, | ||
"tabWidth": 2, | ||
"trailingComma": "none", | ||
"useTabs": false | ||
}, | ||
"private": true, | ||
"remarkConfig": { | ||
"plugins": [ | ||
"remark-preset-wooorm" | ||
] | ||
}, | ||
"repository": "wooorm/franc", | ||
"scripts": { | ||
"generate": "node build", | ||
"format": "remark . -qfo && prettier . -w --log-level warn && xo --fix && stylelint src/index.css --fix", | ||
"build:js": "esbuild src/index.js --bundle --minify --target=es6 --outfile=dest/index.nomodule.js && esbuild src/index.js --bundle --minify --target=es2020 --format=esm --outfile=dest/index.module.js", | ||
"build:css": "postcss src/index.css > dest/index.css", | ||
"build:html": "rehype -u preset-minify -u prevent-favicon-request src -o dest", | ||
"build": "npm run build:js && npm run build:css && npm run build:html", | ||
"test": "npm run generate && npm run format && npm run build" | ||
"crawl": "node --conditions development crawl.js", | ||
"format": "remark --frail --output --quiet -- . && prettier . --log-level warn --write && xo --fix && stylelint src/index.css --fix", | ||
"generate:script": "esbuild src/index.js --bundle --minify --outfile=dest/index.nomodule.js --target=es6 && esbuild src/index.js --bundle --format=esm --minify --outfile=dest/index.module.js --target=es2020", | ||
"generate:structure": "rehype -u rehype-preset-minify -u rehype-prevent-favicon-request src -o dest", | ||
"generate:style": "postcss src/index.css > dest/index.css", | ||
"generate": "npm run generate:script && npm run generate:style && npm run generate:structure", | ||
"test": "npm run crawl && npm run format && npm run generate" | ||
}, | ||
"stylelint": { | ||
"extends": [ | ||
"stylelint-config-standard", | ||
"stylelint-config-prettier" | ||
"stylelint-config-prettier", | ||
"stylelint-config-standard" | ||
] | ||
}, | ||
"prettier": { | ||
"tabWidth": 2, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"bracketSpacing": false, | ||
"semi": false, | ||
"trailingComma": "none" | ||
}, | ||
"type": "module", | ||
"xo": { | ||
"prettier": true, | ||
"ignore": [ | ||
"src/fixtures.js", | ||
"src/to-name.js" | ||
] | ||
}, | ||
"postcss": { | ||
"plugins": { | ||
"cssnano": { | ||
"preset": "default" | ||
} | ||
} | ||
}, | ||
"remarkConfig": { | ||
"plugins": [ | ||
"preset-wooorm" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters