-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
66 changed files
with
2,185 additions
and
1,311 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,10 +1,10 @@ | ||
{ | ||
"trailingComma": "all", | ||
"printWidth": 140, | ||
"tabWidth": 4, | ||
"semi": true, | ||
"singleQuote": false, | ||
"bracketSpacing": true, | ||
"bracketSameLine": false, | ||
"useTabs": true | ||
} | ||
"trailingComma": "all", | ||
"printWidth": 140, | ||
"tabWidth": 4, | ||
"semi": true, | ||
"singleQuote": false, | ||
"bracketSpacing": true, | ||
"bracketSameLine": false, | ||
"useTabs": 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
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
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,58 +1,65 @@ | ||
{ | ||
"name": "unthread.me", | ||
"private": false, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"homepage": "https://unthread.me/", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "bunx --bun vite build", | ||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", | ||
"preview": "vite preview", | ||
"format": "prettier --write ." | ||
}, | ||
"dependencies": { | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@react-spring/web": "^9.7.3", | ||
"@types/bun": "^1.1.5", | ||
"@types/chai": "^4.3.16", | ||
"@types/express": "^4.17.21", | ||
"@types/node": "^20.14.8", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"@typescript-eslint/eslint-plugin": "^7.13.1", | ||
"@typescript-eslint/parser": "^7.13.1", | ||
"@vitejs/plugin-basic-ssl": "^1.1.0", | ||
"@vitejs/plugin-react-swc": "^3.5.0", | ||
"apexcharts": "^3.49.2", | ||
"autoprefixer": "^10.4.19", | ||
"body-parser": "^1.20.2", | ||
"compromise": "^14.13.0", | ||
"eslint": "^8.57.0", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-import-resolver-vite": "^2.0.1", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react": "^7.34.3", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"eslint-plugin-react-refresh": "^0.4.7", | ||
"eslint-plugin-simple-import-sort": "^12.1.0", | ||
"eslint-plugin-unused-imports": "^4.0.0", | ||
"express": "^4.19.2", | ||
"ky": "^1.3.0", | ||
"path": "^0.12.7", | ||
"pify": "^6.1.0", | ||
"prettier": "^3.3.2", | ||
"prettier-plugin-tailwindcss": "^0.6.5", | ||
"react-apexcharts": "^1.4.1", | ||
"react-router-dom": "^6.23.1", | ||
"tailwindcss": "^3.4.4", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.2.2", | ||
"vite": "^5.3.1", | ||
"zustand": "^4.5.2" | ||
} | ||
} | ||
"name": "unthread.me", | ||
"private": false, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"homepage": "https://unthread.me/", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "bunx --bun vite build", | ||
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --fix --max-warnings 0", | ||
"preview": "vite preview", | ||
"format": "prettier --write .", | ||
"index": "iigen" | ||
}, | ||
"dependencies": { | ||
"@lingui/core": "^4.11.1", | ||
"import-index-generator": "^0.2.2", | ||
"make-plural": "^7.4.0", | ||
"polished": "^4.3.1", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1", | ||
"ua-parser-js": "^1.0.38" | ||
}, | ||
"devDependencies": { | ||
"@react-spring/web": "^9.7.3", | ||
"@types/bun": "^1.1.5", | ||
"@types/chai": "^4.3.16", | ||
"@types/express": "^4.17.21", | ||
"@types/node": "^20.14.8", | ||
"@types/react": "^18.3.3", | ||
"@types/react-dom": "^18.3.0", | ||
"@types/ua-parser-js": "^0.7.39", | ||
"@typescript-eslint/eslint-plugin": "^7.13.1", | ||
"@typescript-eslint/parser": "^7.13.1", | ||
"@vitejs/plugin-basic-ssl": "^1.1.0", | ||
"@vitejs/plugin-react-swc": "^3.5.0", | ||
"apexcharts": "^3.49.2", | ||
"autoprefixer": "^10.4.19", | ||
"body-parser": "^1.20.2", | ||
"compromise": "^14.13.0", | ||
"eslint": "^8.57.0", | ||
"eslint-import-resolver-typescript": "^3.6.1", | ||
"eslint-import-resolver-vite": "^2.0.1", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-react": "^7.34.3", | ||
"eslint-plugin-react-hooks": "^4.6.2", | ||
"eslint-plugin-react-refresh": "^0.4.7", | ||
"eslint-plugin-simple-import-sort": "^12.1.0", | ||
"eslint-plugin-unused-imports": "^4.0.0", | ||
"express": "^4.19.2", | ||
"ky": "^1.3.0", | ||
"path": "^0.12.7", | ||
"pify": "^6.1.0", | ||
"prettier": "^3.3.2", | ||
"prettier-plugin-tailwindcss": "^0.6.5", | ||
"react-apexcharts": "^1.4.1", | ||
"react-router-dom": "^6.23.1", | ||
"tailwindcss": "^3.4.4", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.2.2", | ||
"vite": "^5.3.1", | ||
"zustand": "^4.5.2" | ||
} | ||
} |
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 @@ | ||
module.exports = { | ||
export default { | ||
plugins: [require("prettier-plugin-tailwindcss")], | ||
}; |
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,62 @@ | ||
import * as fs from "fs"; | ||
import * as path from "path"; | ||
|
||
const srcDir = path.resolve(__dirname, "../src"); | ||
|
||
// Function to check if file contains 'export default' | ||
const hasDefaultExport = (filePath: string): boolean => { | ||
const content = fs.readFileSync(filePath, "utf-8"); | ||
return content.includes("export default"); | ||
}; | ||
|
||
// Function to generate index.ts | ||
const generateIndexFile = (dirPath: string) => { | ||
const files = fs.readdirSync(dirPath).filter((file) => file.endsWith(".ts") && file !== "index.ts" && !file.includes(".styles.")); | ||
const imports: string[] = []; | ||
const exports: string[] = []; | ||
|
||
files.forEach((file) => { | ||
const filePath = path.join(dirPath, file); | ||
if (hasDefaultExport(filePath)) { | ||
const fileName = path.basename(file, ".ts"); | ||
imports.push(`import ${fileName} from "./${fileName}";`); | ||
exports.push(fileName); | ||
} | ||
}); | ||
|
||
if (imports.length > 0) { | ||
const indexContent = `${imports.join("\n")} | ||
export default { | ||
${exports.join(",\n ")}, | ||
};`; | ||
|
||
fs.writeFileSync(path.join(dirPath, "index.ts"), indexContent, "utf-8"); | ||
console.log(`Generated index.ts in ${dirPath}`); | ||
} | ||
}; | ||
|
||
// Function to start the process | ||
const generateIndexes = (baseDir: string) => { | ||
const getDirectories = (dir: string): string[] => { | ||
const subdirs = fs | ||
.readdirSync(dir) | ||
.map((subdir) => path.join(dir, subdir)) | ||
.filter((subdirPath) => fs.statSync(subdirPath).isDirectory()); | ||
return subdirs.reduce((acc: string[], subdir) => acc.concat(subdir, getDirectories(subdir)), []); | ||
}; | ||
|
||
const directories = [baseDir, ...getDirectories(baseDir)]; | ||
|
||
console.log("Directories", directories); | ||
|
||
directories.forEach((dir) => { | ||
console.log(`Generating index.ts in ${dir}`); | ||
generateIndexFile(dir); | ||
}); | ||
}; | ||
|
||
// Start | ||
|
||
// Start generating index.ts files | ||
generateIndexes(srcDir); |
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
Oops, something went wrong.