Skip to content

Commit

Permalink
Refactor project
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 22, 2024
1 parent b5b0b3c commit 44758ad
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 116 deletions.
8 changes: 4 additions & 4 deletions .editorconfig
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
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: node
- run: npm install
- run: npm test
- uses: JamesIves/github-pages-deploy-action@releases/v4
with:
branch: gh-pages
commit-message: .
folder: dest
git-config-email: tituswormer@gmail.com
git-config-name: Titus Wormer
single-commit: true
name: main
on:
push:
branches:
- website
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.DS_Store
*.log
dest/
node_modules/
*.d.ts
*.log
*.map
*.tsbuildinfo
.DS_Store
yarn.lock
dest/
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ignore-scripts=true
package-lock=false
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dest/
*.html
*.md
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

117 changes: 62 additions & 55 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,39 @@
{
"name": "www-retext-smartypants",
"private": true,
"license": "MIT",
"repository": "retextjs/retext-smartypants",
"bugs": "https://github.com/retextjs/retext-smartypants/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"devDependencies": {
"browserify": "^16.0.0",
"cssnano": "^4.0.0",
"postcss-cli": "^6.0.0",
"postcss-preset-env": "^6.0.0",
"prettier": "^1.0.0",
"rehype-cli": "^8.0.0",
"rehype-preset-minify": "^4.0.0",
"rehype-prevent-favicon-request": "^2.0.0",
"remark-cli": "^7.0.0",
"remark-preset-wooorm": "^6.0.0",
"retext-english": "^3.0.0",
"retext-smartypants": "^3.0.0",
"retext-stringify": "^2.0.0",
"stylelint": "^11.0.0",
"stylelint-config-standard": "^19.0.0",
"tinyify": "^2.0.0",
"unified": "^8.0.0",
"xo": "^0.25.0"
},
"scripts": {
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix && stylelint src/index.css --fix",
"build:js": "browserify src -p tinyify -o dest/index.js",
"build:css": "postcss src/index.css -o 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 format && npm run build"
},
"prettier": {
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"bracketSpacing": false,
"semi": false,
"trailingComma": "none"
},
"xo": {
"prettier": true,
"esnext": false,
"rules": {
"unicorn/prefer-node-append": "off"
}
},
"stylelint": {
"extends": "stylelint-config-standard"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
],
"bugs": "https://github.com/retextjs/retext-smartypants/issues",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
],
"devDependencies": {
"@types/nlcst": "^2.0.0",
"cssnano": "^7.0.0",
"devlop": "^1.0.0",
"esbuild": "^0.24.0",
"postcss-cli": "^11.0.0",
"postcss-preset-env": "^10.0.0",
"prettier": "^3.0.0",
"rehype-cli": "^12.0.0",
"rehype-preset-minify": "^7.0.0",
"rehype-prevent-favicon-request": "^4.0.0",
"remark-cli": "^12.0.0",
"remark-preset-wooorm": "^10.0.0",
"retext-english": "^5.0.0",
"retext-smartypants": "^6.0.0",
"retext-stringify": "^4.0.0",
"stylelint": "^16.0.0",
"stylelint-config-standard": "^36.0.0",
"type-coverage": "^2.0.0",
"typescript": "^5.0.0",
"unified": "^11.0.0",
"xo": "^0.59.0"
},
"license": "MIT",
"name": "www-retext-smartypants",
"postcss": {
"plugins": {
"postcss-preset-env": {},
Expand All @@ -67,9 +42,41 @@
}
}
},
"prettier": {
"bracketSpacing": false,
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "none",
"useTabs": false
},
"private": true,
"remarkConfig": {
"plugins": [
"preset-wooorm"
"remark-preset-wooorm"
]
},
"repository": "retextjs/retext-smartypants",
"typeCoverage": {
"atLeast": 100,
"strict": true
},
"type": "module",
"scripts": {
"build": "tsc --build --clean && tsc --build && type-coverage",
"format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo && stylelint src/index.css --fix",
"generate:css": "postcss --output dest/index.css -- src/index.css",
"generate:html": "rehype --output dest/ --use rehype-preset-minify --use rehype-prevent-favicon-request -- src/",
"generate:js:module": "esbuild src/index.js --bundle --conditions=browser,production --define:process.env.NODE_ENV=\\\"production\\\" --format=esm --loader:.js=jsx --log-level=warning --minify --outfile=dest/index.module.js --target=es2020",
"generate:js:nomodule": "esbuild src/index.js --bundle --conditions=browser,production --define:process.env.NODE_ENV=\\\"production\\\" --loader:.js=jsx --log-level=warning --minify --outfile=dest/index.nomodule.js --target=es6",
"generate:js": "npm run generate:js:module && npm run generate:js:nomodule",
"generate": "npm run generate:css && npm run generate:html && npm run generate:js",
"test": "npm run build && npm run format && npm run generate"
},
"stylelint": {
"extends": "stylelint-config-standard"
},
"xo": {
"prettier": true
}
}
7 changes: 3 additions & 4 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

:root {
color-scheme: light dark;
background-color: hsl(0, 0%, 90%);
}

body {
Expand Down Expand Up @@ -53,8 +52,8 @@ output {
}

@media (prefers-color-scheme: dark) {
:root {
background-color: hsl(214, 13%, 10%);
color: hsl(214, 13%, 90%);
html {
background-color: hsl(214deg 13% 7.5%);
color: hsl(214deg 13% 95%);
}
}
19 changes: 10 additions & 9 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!doctype html>
<meta charset=utf8>
<meta content=width=device-width,initial-scale=1 name=viewport>
<meta content=initial-scale=1,width=device-width name=viewport>
<title>retext-smartypants</title>
<link rel=stylesheet href=index.css>
<link href=index.css rel=stylesheet>
<h1>retext-smartypants</h1>
<p>A quick demo of <a href=https://github.com/retextjs/retext-smartypants>retext-smartypants</a>. Please raise any issues on <a href=https://github.com/retextjs/retext-smartypants/issues>GitHub</a>.
<form>
<fieldset>
<legend>Options</legend>
<label>Quotes? <input name=quotes type=checkbox checked></label>
<label>Ellipses? <input name=ellipses type=checkbox checked></label>
<label>Quotes? <input checked name=quotes type=checkbox></label>
<label>Ellipses? <input checked name=ellipses type=checkbox></label>
<label>
Backticks?
<select name=backticks>
<option value=all>All
<option value=true selected>Yes
<option selected value=true>Yes
<option value=false>No
</select>
<small><b>Note</b>! Backticks: all does not work together with Quotes: true.</small>
Expand All @@ -24,13 +24,13 @@ <h1>retext-smartypants</h1>
<select name=dashes>
<option value=oldschool>Old school
<option value=inverted>Inverted
<option value=true selected>Yes
<option selected value=true>Yes
<option value=false>No
</select>
</label>
</fieldset>
<p>
<textarea spellcheck=false rows=20 cols=80 autofocus>Enter some text here--A 'simple' english sentence. . . or something more sophisticated.
<textarea autofocus cols=80 rows=20 spellcheck=false>Enter some text here--A 'simple' english sentence. . . or something more sophisticated.

``a''
`a'
Expand All @@ -39,6 +39,7 @@ <h1>retext-smartypants</h1>
a--a a---a
a...a. . .a . . .a. . . a</textarea>
<p>
<textarea rows=20 cols=80 readonly></textarea>
<textarea cols=80 readonly rows=20></textarea>
</form>
<script src=index.js></script>
<script src=index.module.js type=module></script>
<script nomodule src=index.nomodule.js></script>
Loading

0 comments on commit 44758ad

Please sign in to comment.