-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[x-license] license update proposal (#13459)
Signed-off-by: Michel Engelen <32863416+michelengelen@users.noreply.github.com> Co-authored-by: Andrew Cherniavskii <andrew.cherniavskii@gmail.com> Co-authored-by: Flavien DELANGLE <flaviendelangle@gmail.com>
- Loading branch information
1 parent
5f49acf
commit c84a2ee
Showing
13 changed files
with
279 additions
and
20 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
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,3 +1,20 @@ | ||
export const LICENSE_SCOPES = ['pro', 'premium'] as const; | ||
export const PRODUCT_SCOPES = ['data-grid', 'date-pickers', 'charts', 'tree-view'] as const; | ||
export const PLAN_VERSIONS = ['initial', 'Q3-2024'] as const; | ||
|
||
export type LicenseScope = (typeof LICENSE_SCOPES)[number]; | ||
export type ProductScope = (typeof PRODUCT_SCOPES)[number]; | ||
export type PlanVersion = (typeof PLAN_VERSIONS)[number]; | ||
|
||
export const extractProductScope = (packageName: string): ProductScope => { | ||
// extract the part between "x-" and "-pro"/"-premium" | ||
const regex = /x-(.*?)(-pro|-premium)?$/; | ||
const match = packageName.match(regex); | ||
return match![1] as ProductScope; | ||
}; | ||
|
||
export const extractAcceptedScopes = (packageName: string): readonly LicenseScope[] => { | ||
return packageName.includes('premium') | ||
? LICENSE_SCOPES.filter((scope) => scope.includes('premium')) | ||
: LICENSE_SCOPES; | ||
}; |
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
Oops, something went wrong.