-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from primno/dev
Architecture
- Loading branch information
Showing
49 changed files
with
2,035 additions
and
699 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@primno/cli": minor | ||
--- | ||
BREAKING CHANGE: | ||
Move the `environment` property from the deploy section to the root. |
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,6 @@ | ||
--- | ||
"@primno/cli": minor | ||
--- | ||
|
||
Use of plop as template engine. | ||
The creation of workspaces is now done with plop. |
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,5 @@ | ||
--- | ||
"@primno/cli": patch | ||
--- | ||
|
||
Remove warnings from node_modules packages during build. |
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,12 @@ | ||
--- | ||
"@primno/cli": minor | ||
--- | ||
|
||
BREAKING CHANGE: | ||
The file structure changes. Only one entry point is now supported. | ||
This entry point must be a file named "app.entry.ts" in the source directory of the project. | ||
|
||
To migrate, move your entry point from your entry-point directory to "app.entry.ts" in the source directory. | ||
If you have multiple entry points, you must create a new project for each entry point or merge them into one. | ||
|
||
The `entryPoints` properties of the primno configuration and the `entrypoint` option of the CLI was removed. |
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,5 @@ | ||
--- | ||
"@primno/cli": minor | ||
--- | ||
|
||
Component generator. |
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,6 @@ | ||
____ _ ____ _ ___ | ||
| _ \ _ __(_)_ __ ___ _ __ ___ / ___| | |_ _| | ||
| |_) | '__| | '_ ` _ \| '_ \ / _ \ | | | | | | | ||
| __/| | | | | | | | | | | | (_) | | |___| |___ | | | ||
|_| |_| |_|_| |_| |_|_| |_|\___/ \____|_____|___| | ||
|
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { MnComponent, MnOnCommandInvoke, CommandBarEventArg } from '@primno/core'; | ||
|
||
@MnComponent({ | ||
scope: { | ||
pageType: "{{ pageType }}", | ||
{{#if table}} | ||
table: "{{ table }}" | ||
{{/if}} | ||
} | ||
}) | ||
export class {{ pascalCase name }}Component { | ||
@MnOnCommandInvoke("<set command name here>") | ||
public onCommandInvoke(eventArg: CommandBarEventArg) { | ||
Xrm.Navigation.openAlertDialog({ text: "Hello from {{ name }} component" }); | ||
} | ||
} |
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,16 @@ | ||
import { MnComponent, MnOnFormLoad, FormEventArg } from '@primno/core'; | ||
|
||
@MnComponent({ | ||
scope: { | ||
pageType: "{{ pageType }}", | ||
{{#if table}} | ||
table: "{{ table }}" | ||
{{/if}} | ||
} | ||
}) | ||
export class {{ pascalCase name }}Component { | ||
@MnOnFormLoad() | ||
public onFormLoad(eventArg: FormEventArg) { | ||
Xrm.Navigation.openAlertDialog({ text: "Hello from {{ name }} component" }); | ||
} | ||
} |
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,44 @@ | ||
import path from 'path'; | ||
|
||
export default function ( | ||
/** @type { import("node-plop").NodePlopAPI } */ | ||
plop | ||
) { | ||
plop.setGenerator('new', { | ||
description: 'Create a new component', | ||
prompts: [ | ||
{ | ||
type: 'list', | ||
name: 'pageType', | ||
message: 'Which page are you targeting?', | ||
choices: [ | ||
{ name: 'Record (eg. main form, quick create)', short: "record", value: 'record' }, | ||
{ name: 'List (eg. grid, sub-grid)', short: "list", value: 'list' } | ||
] | ||
}, | ||
{ | ||
type: 'input', | ||
name: 'table', | ||
message: 'Which table(s) are you targeting? (eg. account, contact)' | ||
}, | ||
], | ||
actions: (/** @type { { name: string; pageType: "list" | "record", table: string } } */ data) => { | ||
const namePath = path.parse(data.name); | ||
data.name = namePath.base; | ||
data.subPath = namePath.dir; | ||
|
||
if (data.subPath.includes("..")) { | ||
throw new Error("Sub-path cannot reference parent directory"); | ||
} | ||
|
||
return [ | ||
{ | ||
type: 'add', | ||
path: 'src/{{pageType}}/{{subPath}}/{{dashCase name}}/{{dashCase name}}.component.ts', | ||
templateFile: 'new/{{pageType}}-component.ts.hbs', | ||
destination: 'src', | ||
} | ||
] | ||
} | ||
}); | ||
} |
Empty file.
Empty file.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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 @@ | ||
{{{ environments }}} |
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 @@ | ||
{{{ workspaceConfig }}} |
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,28 @@ | ||
/** Read README.md first */ | ||
|
||
import { MnModule } from "@primno/core"; | ||
import { ListModule } from "./list/list.module"; | ||
import { RecordModule } from "./record/record.module"; | ||
|
||
/** | ||
* This is the entry point of your application. | ||
* A entry point corresponds to a JS web resource that will be deployed to PowerApps / Dynamics 365. | ||
* The main module must be exported here to be loaded and run by Primno. | ||
*/ | ||
|
||
/** | ||
* The {@link AppModule} class is defined as a module by the {@link MnModule} decorator. | ||
* A module is a container of components / sub-modules. | ||
* | ||
* {@link AppModule} is the primary module and imports the {@link RecordModule} and {@link ListModule}. | ||
* The `bootstrap` components defined in these sub-modules will be started when this web resource is loaded. | ||
* | ||
* {@link RecordModule} is the primary module for the page type `record` while {@link ListModule} is for the page type `list`. | ||
* A list page is a page that displays a list of records, like a main grid or a sub-grid, | ||
* while a record page is a page that displays a single record, like a form or a quick create form. | ||
* Each page type have their own component tree, this means that a list component cannot contain a record component and vice-versa. | ||
*/ | ||
@MnModule({ | ||
imports: [RecordModule, ListModule] | ||
}) | ||
export class AppModule {} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
lib/template/new/src/list/list.module.ts → ...workspace/new/src/list/list.module.ts.hbs
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
2 changes: 1 addition & 1 deletion
2
...w/src/record/account/account.component.ts → ...c/record/account/account.component.ts.hbs
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
4 changes: 2 additions & 2 deletions
4
lib/template/new/src/record/record.module.ts → ...space/new/src/record/record.module.ts.hbs
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 |
---|---|---|
|
@@ -11,6 +11,6 @@ | |
"forceConsistentCasingInFileNames": true | ||
}, | ||
"include": [ | ||
"{{ sourceRoot }}" | ||
"src" | ||
] | ||
} |
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,19 @@ | ||
|
||
export default function ( | ||
/** @type { import("node-plop").NodePlopAPI } */ | ||
plop | ||
) { | ||
plop.setGenerator('new', { | ||
description: 'Create a new workspace', | ||
actions: [ | ||
{ | ||
type: 'addMany', | ||
templateFiles: 'new/**', | ||
globOptions: { | ||
dot: true, | ||
}, | ||
destination: '.', | ||
} | ||
] | ||
}); | ||
} |
Oops, something went wrong.