-
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 #1 from primno/doc
Publish package to npm
- Loading branch information
Showing
52 changed files
with
1,032 additions
and
2,762 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,28 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
pull_request: | ||
branches: [ main ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '18.x' | ||
|
||
- name: Install dependencies and build | ||
run: | | ||
npm ci | ||
npm run 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,20 @@ | ||
name: Publish Core | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
publish-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: npm ci | ||
- run: npm run build | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.npm_token}} |
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 |
---|---|---|
|
@@ -21,7 +21,7 @@ node_modules/ | |
.pnp.* | ||
|
||
# Primno CLI | ||
dist/tsc.js | ||
dist/tsc.mjs | ||
build/ | ||
.nyc_output | ||
.cache |
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,2 @@ | ||
# .npmrc | ||
engine-strict=true |
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,3 @@ | ||
#!/usr/bin/env node | ||
|
||
require('./tsc.js'); | ||
import './tsc.mjs'; |
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,11 @@ | ||
# Node.js | ||
node_modules/ | ||
|
||
# VSCode | ||
.vscode/ | ||
|
||
# Primno | ||
.cache | ||
dist | ||
build | ||
primno.env.json |
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,2 @@ | ||
# .npmrc | ||
engine-strict=true |
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,11 +1,15 @@ | ||
{ | ||
"devDependencies": {}, | ||
"name": "{{ name }}", | ||
"engines": { | ||
"node": ">=16.0.0" | ||
}, | ||
"scripts": { | ||
"start": "mn start", | ||
"build:prod": "mn build -p", | ||
"build:dev": "mn build", | ||
"start": "mn start", | ||
"watch": "mn watch" | ||
"watch": "mn watch", | ||
"deploy": "mn deploy" | ||
}, | ||
"dependencies": {} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,26 @@ | ||
/** Read README.md first */ | ||
|
||
import { MnModule } from "@primno/core"; | ||
import { ListModule } from "../list/list.module"; | ||
import { RecordModule } from "../record/record.module"; | ||
|
||
/** | ||
* An 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 MainModule} class is defined as a module by the {@link MnModule} decorator. | ||
* A module is a container of components / sub-modules. | ||
* | ||
* {@link MainModule} is the primary module for this entry point and imports the {@link RecordModule} and {@link ListModule}. | ||
* The `bootstrap` components defined in these sub-modules will be started when the entry point is loaded. | ||
* | ||
* In this architecture, {@link RecordModule} is the primary module for the page type `record` | ||
* while {@link ListModule} is for the page type `list`. | ||
* Each page type must have their own component tree (separated boot), this architecture allows for a clear separation. | ||
*/ | ||
@MnModule({ | ||
imports: [RecordModule, ListModule] | ||
}) | ||
export class MainModule {} |
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,29 @@ | ||
import { CommandBarEventArg, MnComponent, MnOnCommandInvoke } from "@primno/core"; | ||
|
||
/** | ||
* The {@link ContactComponent} class is defined as a component by the {@link @MnComponent} decorator. | ||
* This component runs on lists (sub-grid, home-grid, associated-grid) of the `contact` table. | ||
*/ | ||
@MnComponent({ | ||
scope: { | ||
pageType: "list", | ||
table: "contact" | ||
} | ||
}) | ||
export class ContactComponent { | ||
|
||
/** | ||
* sayHello is an event handler that will be called | ||
* when the user click on the command bar button "hello" due to the {@link MnOnCommandInvoke} decorator. | ||
* | ||
* To works, this event must be manually added in the command bar of `contact` table | ||
* by calling the `mn_main.onCommandInvoke` method with the parameters: | ||
* - A string parameter with the name `hello` (the name of the command) | ||
* - SelectedControl | ||
* - PrimaryControl | ||
*/ | ||
@MnOnCommandInvoke("hello") | ||
public sayHello(eventArg: CommandBarEventArg) { | ||
Xrm.Navigation.openAlertDialog({ text: "Hello from Primno." }); | ||
} | ||
} |
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,26 @@ | ||
import { MnModule } from "@primno/core"; | ||
import { ContactComponent } from "./contact.component"; | ||
|
||
/** | ||
* The AppModule class is defined as a module by the {@link MnModule} decorator. | ||
* A module is a container of components. | ||
*/ | ||
@MnModule({ | ||
/** | ||
* The bootstrap property defines that {@link RecordComponent} will be the root component of this module | ||
* and will be created when the module is loaded. | ||
*/ | ||
bootstrap: ContactComponent, | ||
/** | ||
* The declarations property defines the components that will be available to be child components of the others components of this module. | ||
* In this case, the {@link RecordComponent} is the only component of this module. | ||
* If you want to create a component that will be a child of the {@link RecordComponent}, you must define it in the declarations property. | ||
* A component can be declared in only one module. | ||
*/ | ||
declarations: [ | ||
ContactComponent | ||
] | ||
}) | ||
export class ListModule { | ||
|
||
} |
Oops, something went wrong.