-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7aa7904
commit 7cf2782
Showing
10 changed files
with
65 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,37 @@ | ||
import { type EmberPackageJson } from "./types.js"; | ||
import { kebabCase } from "change-case"; | ||
import type { EmberPackageJson } from "./types.js"; | ||
|
||
export function isAddon(packageJson: EmberPackageJson): boolean { | ||
if (Array.isArray(packageJson.keywords)) { | ||
return packageJson.keywords.includes("ember-addon"); | ||
export function isV1Addon(packageJson: EmberPackageJson): boolean { | ||
if (isAddon(packageJson)) { | ||
const { version } = packageJson["ember-addon"] ?? {}; | ||
|
||
return version === 1 || version === undefined; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
export function isV2Addon(packageJson: EmberPackageJson): boolean { | ||
return packageJson["ember-addon"]?.version === 2; | ||
if (isAddon(packageJson)) { | ||
const { version } = packageJson["ember-addon"] ?? {}; | ||
|
||
return version === 2; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
export function pathCase(entityName: string): string { | ||
return entityName | ||
.split("/") | ||
.map((part) => kebabCase(part)) | ||
.join("/"); | ||
} | ||
|
||
function isAddon(packageJson: EmberPackageJson): boolean { | ||
if (Array.isArray(packageJson.keywords)) { | ||
return packageJson.keywords.includes("ember-addon"); | ||
} | ||
|
||
return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "v2-app", | ||
"ember": {}, | ||
"ember-addon": { | ||
"type": "app", | ||
"version": 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters