-
Notifications
You must be signed in to change notification settings - Fork 1
starting generate JSON file for module #99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
starting generate JSON file for module #99
Conversation
Deploying with
|
| Latest commit: |
62d0226
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://307fafbb.platform-nan-dev-8sl.pages.dev |
| process.env.HASH = `unk@${now.toString(36)}` | ||
| } | ||
|
|
||
| export const modJsDir = () => readdir(join(rootDir, 'js-module')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pas convaincu de l'utilite de cette fonction, elle abstrait les mauvaise chose a mon avis.
A la limite fait un readdirFromRoot = path => readdir(join(rootDir, path))
Mais franchement on gagne pas grand chose vs juste faire le call
| }), | ||
| ) | ||
| return entries | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pareil, pas sur que ca soit specialement une bonne abstraction, a la limite faire un readdirContent:
const readdirContent = path => {
const files = readdir(join(rootDir, path))
const pendingEntries = files.map(async (fileName) => [
fileName,
await readFile(join(rootDir, path, fileName)),
])
return Promise.all(pendingEntries)
}Plus generique et re-utilisable, et tu fait la passe de markdown apres
| }) | ||
|
|
||
| await (await readdir(rootDir)) | ||
| .filter((filename) => filename.includes('module.json')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.endsWith plutot que .includes la
| const modulebundle = await bundleJSONDir('modulebundle') | ||
| dirList.map(async (file) => { | ||
| const data = Object.fromEntries(entries)[file] | ||
| await writeFile(`${file.split('.md')[0]}.json`, JSON.stringify(data)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file.split('.md')[0]}.json toujours pas une tres bonne facon d'extraire l'extension
|
|
||
| - variables | ||
| - data types | ||
| - console |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya pas de markdown vraiment a parser pour les modules, tu peu gerer un README mais la il aura pas ce genre de contenu, juste une description libre.
No description provided.