{"_id":"@amiller-gh/glimmer-analyzer","_rev":"1-554575ae4e3435a2cb9d70e7eea19902","name":"@amiller-gh/glimmer-analyzer","dist-tags":{"latest":"0.4.0"},"versions":{"0.4.0":{"name":"@amiller-gh/glimmer-analyzer","version":"0.4.0","description":"Statically analyzes Handlebars templates and components for dependency trees and other information.","main":"dist/index.js","types":"dist/index.d.ts","files":["dist"],"scripts":{"test":"mocha","prepare":"npm run build","build":"tsc -p tsconfig.build.json"},"repository":{"type":"git","url":"git+https://github.com/tomdale/glimmer-analyzer.git"},"keywords":["glimmer","static","analysis","handlebars"],"author":{"name":"Tom Dale","email":"tom@tomdale.net"},"license":"MIT","bugs":{"url":"https://github.com/tomdale/glimmer-analyzer/issues"},"homepage":"https://github.com/tomdale/glimmer-analyzer#readme","devDependencies":{"@glimmer/compiler":"^0.34.2","@types/chai":"^3.5.2","@types/debug":"^0.0.30","@types/mocha":"^2.2.41","@types/node":"^7.0.18","chai":"^3.5.0","mocha":"^3.4.1","ts-node":"^5.0.1","typescript":"~2.4.0"},"dependencies":{"@glimmer/resolution-map-builder":"^0.4.0","@glimmer/resolver":"^0.3.0","@glimmer/syntax":"^0.34.2","debug":"^3.1.0","simple-html-tokenizer":"^0.5.1"},"gitHead":"ea6f198602da4d91fc9b45d2329e761d66b0c436","_id":"@amiller-gh/glimmer-analyzer@0.4.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.1","_npmUser":{"name":"epicmiller","email":"ammiller@linkedin.com"},"dist":{"integrity":"sha512-ndUsqI3r0UG+UziAc8LdqD3t68/A/hhOwz9coRUh0Hah5bL8P4JD/fePThwrGM4TS7Fjfos58vca5akVirDfJg==","shasum":"8cdc1035d9f23dfff04dfc693a6ccbf43710f011","tarball":"https://registry.npmjs.org/@amiller-gh/glimmer-analyzer/-/glimmer-analyzer-0.4.0.tgz","fileCount":19,"unpackedSize":44069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbXineCRA9TVsSAnZWagAAoDQP/09DgZxGmNcChUtGFssn\nOzgGcNKZ2mly/zWUCD1vSOu5TlgkP5km7kQu8nVL2tw8Mkdou5+b1HSF+SpA\ngk8g9K5ZW6gLP3ZLZgJFlhvpw1LLeSBF7uSZVqax2N31itsTnUdClPFEOkDv\nvCDXyJDnPtIF7RHLrDf5QioB+C+31JbjPyfRmcSXzZAWPBBT65hMknD0fABi\ntMFk3WKOmj9juTNpHE4l7VYD83Ilv66NnqgC/cyMxi4Gp2kuqLThH0x+5rNj\nhy8STTJr5JffiaAP1q6M+k8RQgWNawzJN0JLBjEEbF3VpE4KCBXNefED/wVM\ncDFXk9rOQdJrl7ohGz/Jo9fHuPBqIJ2W6OBJKUDrFR5sJGlftRtqgUzufTTt\nbZT6g/ROEzoyUbdhPIF5jpp9dffms2ZXXpqIeUnl+OZYKfFiYxcCY1IL7jlA\nTBJA43/wjlA179ozpVAHxJPW6TcydqQuiA/xeHmTOyzYnlKfny2HASYFGKO8\nzUr/5fx05OH/BZDDyMJ4QBcDWyuVYi7WjCO3bz8MmVYqjhYIQ34/suQjeESR\nYT3x8x2qNnG7SQjCFSPErevIlWFUmrBcjdGQ00qGxYEmbsiIQuiUJR6FdUob\nqIFI1cmvLYmBWNeCoLbd1Xj5C946ewt+kYbKygGJPxMnhGgeUsZZ3LOxRM8p\nOpPf\r\n=Vv/t\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDZVtkERi4Jw6Gq/YD1RinwIL+UDYTpqjwPiTrUUVqg1AiEAgbYpRkBSXtVD4jV7MUe7NQY4YDFBOrexfPPbpK+4/5o="}]},"maintainers":[{"name":"epicmiller","email":"ammiller@linkedin.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/glimmer-analyzer_0.4.0_1532897758769_0.5370850406280476"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-29T20:55:58.567Z","0.4.0":"2018-07-29T20:55:58.889Z","modified":"2022-04-04T13:48:55.167Z"},"maintainers":[{"name":"epicmiller","email":"ammiller@linkedin.com"}],"description":"Statically analyzes Handlebars templates and components for dependency trees and other information.","homepage":"https://github.com/tomdale/glimmer-analyzer#readme","keywords":["glimmer","static","analysis","handlebars"],"repository":{"type":"git","url":"git+https://github.com/tomdale/glimmer-analyzer.git"},"author":{"name":"Tom Dale","email":"tom@tomdale.net"},"bugs":{"url":"https://github.com/tomdale/glimmer-analyzer/issues"},"license":"MIT","readme":"# First, a PSA\n> Please do not use this package! This is a personal, experimental branch.\n> Use the original package at:\n> https://github.com/tomdale/glimmer-analyzer.git\n\n# Glimmer Analyzer\n\nA library for doing some static analysis of Glimmer apps.\n\n## Installation\n\n```\nyarn add glimmer-analyzer\n```\n\n## Creating an Analyzer\n\n```ts\nimport Analyzer from 'glimmer-analyzer';\nlet analyzer = new Analyzer('/path/to/glimmer/app');\n```\n\n## Template Dependencies\n\n### `dependenciesForTemplate(componentName)`\n\nDiscover the child components used in a component's template.\n\n```ts\nimport Analyzer from 'glimmer-analyzer';\nlet analyzer = new Analyzer('/path/to/glimmer/app');\nanalyzer.dependenciesForTemplate('my-component');\n// {\n//   path: '/my-app/components/my-component',\n//   hasComponentHelper: false,\n//   components: [\n//     '/my-app/components/my-component/local-component',\n//     '/my-app/components/my-other-component'\n//   ]\n// }\n```\n\n### `recursiveDependenciesForTemplate(componentName)`\n\nDiscover the child components used in a component's template, and the components\nused in the child components' templates, and so on, until the entire dependency\ngraph has been walked.\n\n```ts\nimport Analyzer from 'glimmer-analyzer';\nlet analyzer = new Analyzer('/path/to/glimmer/app');\nanalyzer.dependenciesForTemplate('my-component');\n// {\n//   path: '/my-app/components/my-component',\n//   hasComponentHelper: false,\n//   components: [\n//     '/my-app/components/my-component/local-component',\n//     '/my-app/components/my-component/local-component/we-must-go-deeper',\n//     '/my-app/components/my-other-component',\n//     '/my-app/components/user-profile',\n//     '/my-app/components/some-component-used-by-my-other-component-but-not-my-component'\n//     '/my-app/components/no-one-reads-readmes-anyway',\n//   ]\n// }\n```\n\n## Treeshaken Resolution Maps\n\nGlimmer uses a [resolution\nmap](https://github.com/glimmerjs/resolution-map-builder#the-resolution-map) to\nmap components used in your templates to their underlying modules. Instead of\nbuilding a resolution map that contains everything for the whole app, you can\nbuild a map that contains the modules for just a single component (an entry\npoint for a route, for example) and all of its dependencies.\n\n### `resolutionMapForEntryPoint`\n\nReturns the resolution map for the app with everything but the given component\nand its dependencies removed. If you don't provide the map as the second\nargument, it will try to generate one for you.\n\n```ts\nimport Analyzer from 'glimmer-analyzer';\nlet analyzer = new Analyzer('/path/to/glimmer/app');\nlet resolutionMapForWholeApp = ...;\n\nanalyzer.resolutionMapForEntryPoint('my-component', resolutionMapForWholeApp);\n// {\n//   'component:/my-app/components/my-component': 'ui/components/my-component/component.ts',\n//   'template:/my-app/components/my-component': 'ui/components/my-component/template.hbs',\n//   'component:/my-app/components/my-component/page-banner': 'ui/components/my-app/page-banner/component.ts',\n//   'template:/my-app/components/my-component/page-banner': 'ui/components/my-app/page-banner/template.hbs',\n//   'template:/my-app/components/ferret-launcher': 'ui/components/ferret-launcher/template.hbs',\n// }\n```\n","readmeFilename":"README.md"}