@mxfb/cli 0.0.68 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/make-calendar/index.js +4 -4
- package/make-calendar/index.js.map +4 -4
- package/{cli → mfcli}/assets/list.txt +1 -3
- package/mfcli/assets/version.txt +1 -0
- package/mfcli/index.js +5 -0
- package/mfcli/index.js.map +7 -0
- package/mxfb-projects-sync/index.js +3 -2
- package/mxfb-projects-sync/index.js.map +4 -4
- package/package.json +15 -18
- package/tumblr-crawler/index.js +1181 -2
- package/tumblr-crawler/index.js.map +4 -4
- package/cli/assets/version.txt +0 -1
- package/cli/index.js +0 -5
- package/cli/index.js.map +0 -7
- package/make-template/assets/html/icons/about.txt +0 -6
- package/make-template/assets/html/icons/android-chrome-192x192.png +0 -0
- package/make-template/assets/html/icons/android-chrome-512x512.png +0 -0
- package/make-template/assets/html/icons/apple-touch-icon.png +0 -0
- package/make-template/assets/html/icons/favicon-16x16.png +0 -0
- package/make-template/assets/html/icons/favicon-32x32.png +0 -0
- package/make-template/assets/html/icons/favicon.ico +0 -0
- package/make-template/assets/html/icons/site.webmanifest +0 -1
- package/make-template/assets/html/index.html +0 -20
- package/make-template/assets/react/gitignore +0 -259
- package/make-template/assets/react/package.json +0 -41
- package/make-template/assets/react/public/icons/about.txt +0 -6
- package/make-template/assets/react/public/icons/android-chrome-192x192.png +0 -0
- package/make-template/assets/react/public/icons/android-chrome-512x512.png +0 -0
- package/make-template/assets/react/public/icons/apple-touch-icon.png +0 -0
- package/make-template/assets/react/public/icons/favicon-16x16.png +0 -0
- package/make-template/assets/react/public/icons/favicon-32x32.png +0 -0
- package/make-template/assets/react/public/icons/favicon.ico +0 -0
- package/make-template/assets/react/public/icons/site.webmanifest +0 -1
- package/make-template/assets/react/public/index.html +0 -19
- package/make-template/assets/react/scripts/build/index.ts +0 -44
- package/make-template/assets/react/scripts/tsconfig.json +0 -21
- package/make-template/assets/react/src/components/App/index.tsx +0 -7
- package/make-template/assets/react/src/components/App/style.module.scss +0 -3
- package/make-template/assets/react/src/index.d.ts +0 -9
- package/make-template/assets/react/src/index.tsx +0 -5
- package/make-template/assets/react/src/tsconfig.json +0 -25
- package/make-template/assets/react/src/utils/some-util/index.ts +0 -1
- package/make-template/index.js +0 -4
- package/make-template/index.js.map +0 -7
- package/tree/index.js +0 -3
- package/tree/index.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/mxfb-projects-sync/index.ts"],
|
|
4
|
-
"sourcesContent": ["import process from 'node:process'\nimport url from 'node:url'\nimport path from 'node:path'\nimport os from 'node:os'\nimport { program } from 'commander'\nimport prompts from 'prompts'\nimport { getConfig, updateConfig } from '@mxfb/tools/
|
|
5
|
-
"mappings": "AAAA,OAAOA,MAAa,eACpB,OAAOC,MAAS,WAChB,OAAOC,MAAU,YACjB,OAAOC,MAAQ,UACf,OAAS,WAAAC,MAAe,YACxB,OAAOC,MAAa,
|
|
6
|
-
"names": ["process", "url", "path", "os", "program", "prompts", "getConfig", "updateConfig", "spawn", "__filename", "__dirname", "CWD", "_lmpath", "_mxfbpath", "options", "config", "configLmPath", "configMxfbPath", "lmPath", "resolveHome", "promptsLmPath", "mxfbPath", "promptsMxfbPath", "pathsAreOk", "savePaths", "updated", "curr", "shellScriptExecution", "err", "code", "filePath"]
|
|
3
|
+
"sources": ["../../src/mxfb-projects-sync/index.ts", "../../node_modules/@mxfb/tools/node/mxfb-cli-config/index.js"],
|
|
4
|
+
"sourcesContent": ["import process from 'node:process'\nimport url from 'node:url'\nimport path from 'node:path'\nimport os from 'node:os'\nimport { program } from 'commander'\nimport prompts from 'prompts'\nimport { getConfig, updateConfig } from '@mxfb/tools/node/mxfb-cli-config/index.js'\nimport { spawn } from 'node:child_process'\n\nconst __filename = url.fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\nconst CWD = process.cwd()\n\nprogram\n .name('@mxfb/mxfb-projects-sync')\n .description('Keep in sync the different git repos for mxfb/tools & mxfb/cli')\n .argument('[lmpath]', 'Path for Le Monde folder')\n .argument('[mxfbpath]', 'Path for Mxfb folder')\n .action(async (_lmpath, _mxfbpath, options) => {\n const config = await getConfig(true)\n if (config instanceof Error) throw config\n const { mxfb_projects_sync: {\n lm_path: configLmPath,\n mxfb_path: configMxfbPath\n } = {} } = config\n \n let lmPath: string = ''\n if (_lmpath !== undefined) { lmPath = resolveHome(`${_lmpath}`) }\n else {\n const { promptsLmPath } = await prompts({\n type: 'text',\n name: 'promptsLmPath',\n message: `Path to Le Monde directory (absolute or relative to ${CWD})`,\n initial: configLmPath ?? ''\n })\n lmPath = resolveHome(`${promptsLmPath}`)\n }\n \n let mxfbPath: string = ''\n if (_mxfbpath !== undefined) { mxfbPath = resolveHome(`${_mxfbpath}`) }\n else {\n const { promptsMxfbPath } = await prompts({\n type: 'text',\n name: 'promptsMxfbPath',\n message: `Path to Mxfb directory (absolute or relative to ${CWD})`,\n initial: configMxfbPath ?? ''\n })\n mxfbPath = resolveHome(`${promptsMxfbPath}`)\n }\n\n console.log('Le Monde:', lmPath)\n console.log('Mxfb: ', mxfbPath)\n const { pathsAreOk } = await prompts({\n type: 'confirm',\n name: 'pathsAreOk',\n message: 'Continue using those paths?'\n })\n if (pathsAreOk !== true) {\n console.log('\\nBye.\\n')\n process.exit(0)\n }\n if (lmPath !== configLmPath || mxfbPath !== configMxfbPath) {\n const { savePaths } = await prompts({\n type: 'confirm',\n name: 'savePaths',\n message: 'Do you want to save those paths for the next time ?'\n })\n if (savePaths === true) {\n const updated = await updateConfig(curr => ({\n ...curr,\n mxfb_projects_sync: {\n lm_path: lmPath,\n mxfb_path: mxfbPath\n }\n }), true)\n if (updated instanceof Error) throw updated\n console.log('Saved.')\n }\n }\n \n const shellScriptExecution = spawn('sh', [path.join(__dirname, './assets/main.sh'), lmPath, mxfbPath], { stdio: 'inherit' })\n shellScriptExecution.on('error', err => console.error(`Error: ${err.message}`))\n shellScriptExecution.on('close', code => console.error(`main.sh exited with code ${code}`))\n })\n\nprogram.parse(process.argv)\n\nfunction resolveHome (filePath: string) {\n if (filePath.startsWith('~/')) return path.join(os.homedir(), filePath.slice(2))\n return filePath\n}\n\n", "// src/node/mxfb-cli-config/index.ts\nimport os from \"node:os\";\nimport { promises as fs } from \"node:fs\";\nimport path from \"node:path\";\nvar homeDirPath = os.homedir();\nvar mxfbConfigDirPath = path.join(homeDirPath, \".config/mxfb-cli\");\nvar mxfbConfigFilePath = path.join(mxfbConfigDirPath, \"config.json\");\nvar emptyConfigObj = {};\nasync function createConfigFile(force = false) {\n await fs.mkdir(mxfbConfigDirPath, { recursive: true });\n try {\n await fs.stat(mxfbConfigFilePath);\n if (force === true) throw \"create anyway\";\n return true;\n } catch (err) {\n try {\n await fs.writeFile(\n mxfbConfigFilePath,\n `${JSON.stringify(emptyConfigObj, null, 2)}\n`,\n { encoding: \"utf-8\" }\n );\n return true;\n } catch (err2) {\n if (err2 instanceof Error) return err2;\n if (typeof err2 === \"string\") return new Error(err2);\n return new Error(`${err2}`);\n }\n }\n}\nvar deletionSecurityPhrase = \"THIS IS A DESTRUCTIVE AND DEFINITIVE ACTION\";\nasync function deleteConfigDir(security) {\n if (security !== deletionSecurityPhrase) return new Error(\"You must provide the security phrase\");\n await fs.rm(mxfbConfigDirPath, { recursive: true, force: true });\n return true;\n}\nasync function deleteConfigFile(security) {\n if (security !== deletionSecurityPhrase) return new Error(\"You must provide the security phrase\");\n await fs.rm(mxfbConfigDirPath);\n return true;\n}\nasync function ensureConfigFile() {\n try {\n await fs.stat(mxfbConfigFilePath);\n return true;\n } catch (err) {\n try {\n const created = await createConfigFile();\n if (created instanceof Error) throw created;\n return true;\n } catch (err2) {\n if (err2 instanceof Error) return err2;\n if (typeof err2 === \"string\") return new Error(err2);\n return new Error(`${err2}`);\n }\n }\n}\nasync function getConfigFile() {\n try {\n const fileContents = await fs.readFile(mxfbConfigFilePath, { encoding: \"utf-8\" });\n return fileContents;\n } catch (err) {\n if (err instanceof Error) return err;\n if (typeof err === \"string\") return new Error(err);\n return new Error(`${err}`);\n }\n}\nfunction validateConfigObj(configObj) {\n return true;\n}\nfunction parseConfigFile(fileContents) {\n try {\n const parsed = JSON.parse(fileContents);\n const validated = validateConfigObj(parsed);\n if (!validated) throw new Error(`Invalid config file shape: ${fileContents}`);\n return parsed;\n } catch (err) {\n if (err instanceof Error) return err;\n if (typeof err === \"string\") return new Error(err);\n return new Error(`${err}`);\n }\n}\nasync function getConfig(create = false) {\n if (create) {\n const created = await ensureConfigFile();\n if (created !== true) return created;\n }\n const configStr = await getConfigFile();\n if (configStr instanceof Error) return configStr;\n const parsed = parseConfigFile(configStr);\n if (parsed instanceof Error) return parsed;\n return parsed;\n}\nasync function updateConfig(updater, create = false) {\n const currentConfig = await getConfig(create);\n if (currentConfig instanceof Error) return currentConfig;\n const updatedConfig = typeof updater === \"function\" ? updater(currentConfig) : { ...currentConfig, ...updater };\n const stringified = JSON.stringify(updatedConfig, null, 2);\n await fs.writeFile(mxfbConfigFilePath, stringified, { encoding: \"utf-8\" });\n return true;\n}\nexport {\n createConfigFile,\n deleteConfigDir,\n deleteConfigFile,\n emptyConfigObj,\n ensureConfigFile,\n getConfig,\n getConfigFile,\n parseConfigFile,\n updateConfig,\n validateConfigObj\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAa,eACpB,OAAOC,MAAS,WAChB,OAAOC,MAAU,YACjB,OAAOC,MAAQ,UACf,OAAS,WAAAC,MAAe,YACxB,OAAOC,MAAa,UCJpB,OAAOC,MAAQ,UACf,OAAS,YAAYC,MAAU,UAC/B,OAAOC,MAAU,YACjB,IAAIC,EAAcH,EAAG,QAAQ,EACzBI,EAAoBF,EAAK,KAAKC,EAAa,kBAAkB,EAC7DE,EAAqBH,EAAK,KAAKE,EAAmB,aAAa,EAC/DE,EAAiB,CAAC,EACtB,eAAeC,EAAiBC,EAAQ,GAAO,CAC7C,MAAMP,EA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,QAAQ,MAAM,4BAA4BA,CAAI,EAAE,CAAC,CAC5F,CAAC,EAEHrB,EAAQ,MAAMD,EAAQ,IAAI,EAE1B,SAASU,EAAaa,EAAkB,CACtC,OAAIA,EAAS,WAAW,IAAI,EAAUzB,EAAK,KAAK0B,EAAG,QAAQ,EAAGD,EAAS,MAAM,CAAC,CAAC,EACxEA,CACT",
|
|
6
|
+
"names": ["process", "url", "path", "os", "program", "prompts", "os", "fs", "path", "homeDirPath", "mxfbConfigDirPath", "mxfbConfigFilePath", "emptyConfigObj", "createConfigFile", "force", "err2", "ensureConfigFile", "fs", "mxfbConfigFilePath", "created", "createConfigFile", "err2", "getConfigFile", "err", "validateConfigObj", "configObj", "parseConfigFile", "fileContents", "parsed", "getConfig", "create", "configStr", "updateConfig", "updater", "currentConfig", "updatedConfig", "stringified", "spawn", "__filename", "url", "__dirname", "path", "CWD", "process", "program", "_lmpath", "_mxfbpath", "options", "config", "getConfig", "configLmPath", "configMxfbPath", "lmPath", "resolveHome", "promptsLmPath", "prompts", "mxfbPath", "promptsMxfbPath", "pathsAreOk", "savePaths", "updated", "updateConfig", "curr", "shellScriptExecution", "err", "code", "filePath", "os"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mxfb/cli",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Maxime Fabas",
|
|
6
6
|
"license": "ISC",
|
|
@@ -12,31 +12,28 @@
|
|
|
12
12
|
"main": "index.js",
|
|
13
13
|
"module": "index.js",
|
|
14
14
|
"bin": {
|
|
15
|
-
"cli": "./cli/index.js",
|
|
16
15
|
"make-calendar": "./make-calendar/index.js",
|
|
17
|
-
"make-template": "./make-template/index.js",
|
|
18
16
|
"mxfb-projects-sync": "./mxfb-projects-sync/index.js",
|
|
17
|
+
"mfcli": "./mfcli/index.js",
|
|
19
18
|
"term-glossary": "./term-glossary/index.js",
|
|
20
|
-
"tree": "./tree/index.js",
|
|
21
19
|
"tumblr-crawler": "./tumblr-crawler/index.js"
|
|
22
20
|
},
|
|
23
21
|
"dependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
22
|
+
"@design-edito/tools": "^0.2.0",
|
|
23
|
+
"@mxfb/tools": "^0.3.0",
|
|
24
|
+
"commander": "^14.0.0",
|
|
25
|
+
"date-fns": "^4.1.0",
|
|
26
|
+
"jsdom": "^26.1.0",
|
|
27
|
+
"prompts": "^2.4.2"
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
32
|
-
"@types/jsdom": "^21.1.
|
|
33
|
-
"@types/node": "^
|
|
30
|
+
"@types/jsdom": "^21.1.7",
|
|
31
|
+
"@types/node": "^24.2.1",
|
|
34
32
|
"@types/prompts": "^2.4.9",
|
|
35
|
-
"@types/
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"typescript": "^5.5.4"
|
|
33
|
+
"@types/semver": "^7.7.0",
|
|
34
|
+
"esbuild": "^0.25.8",
|
|
35
|
+
"semver": "^7.7.2",
|
|
36
|
+
"simple-git": "^3.28.0",
|
|
37
|
+
"typescript": "^5.9.2"
|
|
41
38
|
}
|
|
42
39
|
}
|