{"_id":"@ackheron/prepare-angular-json","name":"@ackheron/prepare-angular-json","dist-tags":{"latest":"1.0.26"},"versions":{"1.0.26":{"name":"@ackheron/prepare-angular-json","version":"1.0.26","publishConfig":{"access":"public"},"description":"Génère un fichier angular.json propre à partir d’un angular.jsonc avec commentaires.","bin":{"prepare-angular-json":"index.js"},"type":"module","keywords":["angular","json","jsonc","strip-comments","cli"],"author":{"name":"Chris"},"license":"MIT","dependencies":{"strip-json-comments":"^5.0.0"},"_id":"@ackheron/prepare-angular-json@1.0.26","gitHead":"0551aa4b34a4f66e09fa69d1751c7d426180a15c","_nodeVersion":"24.2.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-a3PqBm5ysZrWFf0GlJMkQ33hgJ4oSDyduYxI1KgKGrHiFZBpxu66jTKPSAsm1RM6zY4IIv33HqeaA1uar/HXxw==","shasum":"f3a9442795c2e6ae94964efecbe203f7542084cf","tarball":"https://registry.npmjs.org/@ackheron/prepare-angular-json/-/prepare-angular-json-1.0.26.tgz","fileCount":6,"unpackedSize":7388,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFPA/QVapWTi0RPBzPMFsP5gxWeM+CbXw6frPaSvyEu0AiBH0ay8LYC+8bN1Qy+weB3H+WxEs5iD4MODDXLIR8Bm3g=="}]},"_npmUser":{"name":"chris_romand","email":"ackheron@etik.com","actor":{"name":"chris_romand","email":"ackheron@etik.com","type":"user"}},"directories":{},"maintainers":[{"name":"chris_romand","email":"ackheron@etik.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/prepare-angular-json_1.0.26_1751316388115_0.6175624057536422"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-30T20:46:27.972Z","1.0.26":"2025-06-30T20:46:28.311Z","modified":"2025-06-30T20:46:28.608Z"},"maintainers":[{"name":"chris_romand","email":"ackheron@etik.com"}],"description":"Génère un fichier angular.json propre à partir d’un angular.jsonc avec commentaires.","keywords":["angular","json","jsonc","strip-comments","cli"],"author":{"name":"Chris"},"license":"MIT","readme":"# Prepare Angular JSON.\n\n**Prepare Angular JSON** is a lightweight CLI tool that generates a clean `angular.json` file from a commented `angular.jsonc`.  \nIt allows you to keep your Angular configuration files readable and well-documented, while staying fully compatible with the Angular CLI.\n\n## ✨ Features\n\n- ✅ Converts `angular.jsonc` (with comments) into valid `angular.json`\n- ✅ Automatically adds `prepare-json` and `start` scripts to your `package.json`\n- ✅ Validates JSON output before writing\n- ✅ Ready for integration into CI/CD pipelines\n- ✅ No runtime dependencies in your Angular app\n\n## 🚀 Quick Start\n\n### Install globally\n\n```bash\nnpm install -g prepare-angular-json\n\n```\n\n### Run the tool\n\n```\nprepare-angular-json\n```\nThis will:\n\n- Create or update `angular.json` from `angular.jsonc`\n\n- Add useful scripts to your `package.json` if needed\n\n### Use it\n\n```bash\npnpm start\n#or\nnpm run start\n```\n\n## 🛠 What it does\n\nThe tool adds or updates these entries in your package.json:\n\n```json\n\"scripts\": {\n  \"prepare-json\": \"node prepare-angular-json.js\",\n  \"start\": \"pnpm run prepare-json && ng serve\"\n}\n```\n\nAnd generates this file if not present:\n```js\n// prepare-angular-json.js\nimport { readFileSync, writeFileSync, existsSync } from 'fs';\nimport stripJsonComments from 'strip-json-comments';\n\nconst inputPath = './angular.jsonc';\nconst outputPath = './angular.json';\n\nif (!existsSync(inputPath)) {\n  console.error(`❌ File \"${inputPath}\" not found.`);\n  process.exit(1);\n}\n\ntry {\n  const jsonWithComments = readFileSync(inputPath, 'utf8');\n  const cleanedJson = stripJsonComments(jsonWithComments);\n  JSON.parse(cleanedJson);\n  writeFileSync(outputPath, cleanedJson);\n  console.log(`✅ \"${outputPath}\" successfully created from \"${inputPath}\".`);\n} catch (error) {\n  console.error('❌ Error:', error.message);\n  process.exit(1);\n}\n```\n","readmeFilename":"README.md","_rev":"1-9472ab2ae4851fbb6b262969b8e576a1"}