New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

analyze-ember-project-dependencies

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analyze-ember-project-dependencies - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

6

dist/bin/analyze-ember-project-dependencies.js

@@ -10,2 +10,7 @@ #!/usr/bin/env node

const argv = yargs(hideBin(process.argv))
.option('component-structure', {
choices: ['flat', 'nested'],
describe: 'Component structure (how your components are colocated)',
type: 'string',
})
.option('root', {

@@ -17,4 +22,5 @@ describe: 'Where to run the codemod',

const codemodOptions = {
componentStructure: argv['component-structure'] ?? 'flat',
projectRoot: argv['root'] ?? process.cwd(),
};
analyzeEmberProjectDependencies(codemodOptions);

5

dist/src/steps/analyze-project.js

@@ -12,6 +12,3 @@ import { readPackageJson } from '@codemod-utils/json';

const { dependencies, devDependencies, packageType } = analyzePackageJson(packageJson);
const entities = analyzeEntities({
packageRoot,
packageType,
});
const entities = analyzeEntities(packageRoot, packageType, options);
projectData.set(packageJson['name'], {

@@ -18,0 +15,0 @@ dependencies,

9

dist/src/steps/analyze-project/analyze-entities.js

@@ -15,4 +15,3 @@ import { doubleColonize } from '@codemod-utils/ember';

];
export function analyzeEntities(options) {
const { packageRoot, packageType } = options;
export function analyzeEntities(packageRoot, packageType, options) {
const source = SOURCE[packageType];

@@ -29,2 +28,3 @@ const entities = {

}
const { componentStructure } = options;
ENTITY_TYPES.forEach((entityType) => {

@@ -42,2 +42,7 @@ const filePaths = findFiles(`${source}/${entityType}/**/*.{gjs,gts,hbs,js,ts}`, {

entityNames = Array.from(new Set(entityNames));
if (componentStructure === 'nested') {
entityNames = entityNames.map((entityName) => {
return entityName.replace(/\/index$/, '');
});
}
entities['components'] = entityNames;

@@ -44,0 +49,0 @@ entities['componentsDoubleColonized'] = entityNames.map(doubleColonize);

export function createOptions(codemodOptions) {
const { projectRoot } = codemodOptions;
const { componentStructure, projectRoot } = codemodOptions;
return {
componentStructure,
projectRoot,
};
}
{
"name": "analyze-ember-project-dependencies",
"version": "0.3.1",
"version": "0.4.0",
"description": "Analyze dependencies of an Ember project",

@@ -5,0 +5,0 @@ "keywords": [

@@ -37,2 +37,14 @@ # analyze-ember-project-dependencies

<summary>Optional: Specify the component structure</summary>
By default, apps and addons follow the flat component structure for components. Pass `--component-structure` to indicate otherwise.
```sh
npx analyze-ember-project-dependencies --component-structure nested
```
</details>
<details>
<summary>Optional: Specify the project root</summary>

@@ -43,3 +55,3 @@

```sh
npx ember-codemod-remove-inject-as-service --root <path/to/your/project>
npx analyze-ember-project-dependencies --root <path/to/your/project>
```

@@ -46,0 +58,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc