This commit is contained in:
0x1eef 2024-08-22 15:39:55 -03:00
parent 3675b3b441
commit 65dbae91c3
11 changed files with 31 additions and 11 deletions

5
Rules
View file

@ -24,12 +24,13 @@ tdata = Ryo.from_json(path: File.join(dirs.content, "json", "t.json"))
surahs = Ryo.from_json(path: File.join(dirs.content, "json", "surahs.json")) surahs = Ryo.from_json(path: File.join(dirs.content, "json", "surahs.json"))
tidy = `which tidy || which tidy5`.chomp tidy = `which tidy || which tidy5`.chomp
buildenv = ENV["buildenv"] || "development" buildenv = ENV["buildenv"] || "development"
etcdir = File.join(__dir__, "etc")
## ##
# Plugins # Filters
Nanoc::Webpack Nanoc::Webpack
.default_argv .default_argv
.replace([*Nanoc::Webpack.default_argv, "--config", "webpack.#{buildenv}.js"].uniq) .replace([*Nanoc::Webpack.default_argv, "--config", File.join(etcdir, "webpack.#{buildenv}.js")].uniq)
Nanoc::Tidy Nanoc::Tidy
.default_argv .default_argv
.replace([*Nanoc::Tidy.default_argv, "-upper"].uniq) .replace([*Nanoc::Tidy.default_argv, "-upper"].uniq)

View file

@ -1,4 +1,6 @@
{ {
"include": ["../src/**/*.ts", "../src/**/*.tsx"],
"exclude": ["../node_modules"],
"compilerOptions": { "compilerOptions": {
"strict": true, "strict": true,
"module": "commonjs", "module": "commonjs",
@ -9,7 +11,7 @@
"jsx": "react", "jsx": "react",
"lib": [ "ES2020", "DOM" ], "lib": [ "ES2020", "DOM" ],
"baseUrl": "src/", "baseUrl": "../src/",
"paths": { "paths": {
"~/*": ["./js/*"], "~/*": ["./js/*"],
"@json/*": ["./json/*"] "@json/*": ["./json/*"]

View file

@ -2,11 +2,11 @@ const path = require("path");
module.exports = { module.exports = {
resolve: { resolve: {
modules: [path.resolve(__dirname, "node_modules")], modules: [path.resolve(__dirname, "..", "node_modules")],
alias: { alias: {
"@css": path.resolve(__dirname, "src/css"), "@css": path.resolve(__dirname, "..", "src", "css"),
"@json": path.resolve(__dirname, "src/json"), "@json": path.resolve(__dirname, "..", "src", "json"),
"~": path.resolve(__dirname, "src/js"), "~": path.resolve(__dirname, "..", "src", "js"),
}, },
extensions: [".js", ".ts", ".tsx", ".json", ".css", ".scss"], extensions: [".js", ".ts", ".tsx", ".json", ".css", ".scss"],
}, },

View file

@ -4,8 +4,9 @@
"./packages/typescript/*" "./packages/typescript/*"
], ],
"scripts": { "scripts": {
"tsc": "tsc --noEmit", "tsc": "npx tsc --noEmit -p etc/tsconfig.json",
"eslint": "npm exec eslint -- --fix src/js/" "eslint": "npx eslint --config etc/eslint.config.mjs src/js/",
"eslint:apply": "npx eslint --config etc/eslint.config.mjs --fix src/js/"
}, },
"dependencies": { "dependencies": {
"classnames": "^2.3", "classnames": "^2.3",

View file

@ -6,7 +6,7 @@ namespace :ci do
end end
task :eslint do task :eslint do
sh "npx eslint src/js" sh "npm run eslint"
end end
task :tsc do task :tsc do

View file

@ -3,13 +3,23 @@
namespace :format do namespace :format do
desc "Run rubocop (Ruby)" desc "Run rubocop (Ruby)"
task :rubocop do task :rubocop do
sh "bundle exec rubocop -A" sh "bundle exec rubocop --config etc/rubocop.yml"
end
desc "Apply rubocop (Ruby)"
task :"rubocop:apply" do
sh "bundle exec rubocop -A --config etc/rubocop.yml"
end end
desc "Run eslint (TypeScript)" desc "Run eslint (TypeScript)"
task :eslint do task :eslint do
sh "npm run eslint" sh "npm run eslint"
end end
desc "Run eslint (TypeScript)"
task :"eslint:apply" do
sh "npm run eslint:apply"
end
end end
desc "Run all formats" desc "Run all formats"

View file

@ -1,3 +1,9 @@
* vNEXT
**** Add ~etc/~
This change moves a large portion of the website's configuration
files to the ~/etc~ directory
* v0.9.0 * v0.9.0
**** Add ~share/al-quran.reflectslight.io/documentation/~ **** Add ~share/al-quran.reflectslight.io/documentation/~