-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into core/capacitor-5
- Loading branch information
Showing
67 changed files
with
285 additions
and
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## Data Models | ||
|
||
### How to import | ||
|
||
**Node** | ||
The workspace is designed for direct import as `.ts` files, to be compiled within parent project. Most imports are made available from the top-level `index.ts` | ||
```ts | ||
import { getDefaultAppConfig } from "data-models" | ||
``` | ||
If any imports are not available simply update the workspace `index.ts` to include | ||
|
||
**Angular** | ||
The angular compiler uses local `tsconfig.app.json` to include external dependencies, therefore if using an entry should be included | ||
```json | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": [ | ||
"packages/data-models/**/*.ts", | ||
] | ||
} | ||
|
||
``` | ||
Once included, data-models can be imported in the same way | ||
```ts | ||
import { getDefaultAppConfig } from "data-models" | ||
``` | ||
|
||
*Legacy Implementation* | ||
If it is not possible to import via tsconfig, it is still possible to include as a workspace dependency (defined in package.json), however the data models package.json requires update to build and import from dist folder. Additionally any angular serve script should concurrently serve the data-models workspace to ensure changes are recompiled, e.g. | ||
|
||
```ts | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsc -b", | ||
"serve": "tsc -w" | ||
}, | ||
``` | ||
|
||
|
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,12 +1,6 @@ | ||
export * from "./appConfig"; | ||
export * from "./db.model"; | ||
export * from "./deployment.model"; | ||
export * from "./flowTypes"; | ||
export * from "./functions"; | ||
// NOTE - avoid exporting workflows as node-based can't be consumed by frontend src | ||
// export { IDeploymentWorkflows, IWorkflow, IWorkflowContext, WORKFLOW_DEFAULTS } from "./workflows"; | ||
export { | ||
IDeploymentConfig, | ||
IDeploymentConfigJson, | ||
DEPLOYMENT_CONFIG_EXAMPLE_DEFAULTS, | ||
DEPLOYMENT_CONFIG_VERSION, | ||
} from "./deployment.model"; | ||
export { IAppSkin } from "./skin.model"; | ||
export { IAppConfig, IAppConfigOverride, getDefaultAppConfig } from "./appConfig"; | ||
export * from "./skin.model"; |
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
2 changes: 1 addition & 1 deletion
2
...ipts/src/commands/app-data/convert/processors/flowParser/parsers/data_pipe.parser.spec.ts
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,24 +1,2 @@ | ||
import * as path from "path"; | ||
|
||
export const ROOT_DIR = path.resolve(__dirname, "../../../"); | ||
export const MAIN_PACKAGE_PATH = path.join(ROOT_DIR, "package.json"); | ||
|
||
export const DEPLOYMENTS_PATH = path.resolve(ROOT_DIR, ".idems_app", "deployments"); | ||
|
||
export const SCRIPTS_WORKSPACE_PATH = path.join(ROOT_DIR, "packages/scripts"); | ||
export const SCRIPTS_TEST_DATA_DIR = path.join(SCRIPTS_WORKSPACE_PATH, "test", "data"); | ||
export const SCRIPTS_LOGS_DIR = path.join(SCRIPTS_WORKSPACE_PATH, "logs"); | ||
export const DATA_MODELS_WORKSPACE_PATH = path.join(ROOT_DIR, "packages/data-models"); | ||
|
||
export const SRC_ASSETS_PATH = path.join(ROOT_DIR, "src", "assets"); | ||
|
||
export const CONFIG_FOLDER_PATH = path.join(SCRIPTS_WORKSPACE_PATH, "config"); | ||
export const PRIVATE_KEY_PATH = path.join(CONFIG_FOLDER_PATH, "private.key"); | ||
export const PUBLIC_KEY_PATH = path.join(CONFIG_FOLDER_PATH, "public.key"); | ||
export const CREDENTIALS_PATH = path.join(CONFIG_FOLDER_PATH, "credentials.json"); | ||
export const AUTH_TOKEN_PATH = path.join(CONFIG_FOLDER_PATH, "token.json"); | ||
|
||
export const RESOURCE_FOLDER_PATH = path.join(ROOT_DIR, "resources"); | ||
|
||
export const ANDROID_RES_PATH = path.join(ROOT_DIR, "android/app/src/main/res"); | ||
export const APP_BUILD_GRADLE_PATH = path.join(ROOT_DIR, "android/app/build.gradle"); | ||
// re-export shared utils for ease of import | ||
export * from "shared/src/paths"; |
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,2 @@ | ||
// re-export shared utils for ease of import | ||
export * from "shared/src/utils"; |
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,44 @@ | ||
## Shared | ||
|
||
Common platform methods and utility functions. | ||
|
||
There are particularly a number of utility methods used by both scripts and workflow packages | ||
|
||
Note, some methods will only work in node-based environments (non-browser) | ||
|
||
### How to import | ||
|
||
**Node** | ||
The workspace is designed for direct import as `.ts` files, to be compiled within parent project. Most imports are made available from the top-level `index.ts` | ||
```ts | ||
import { TemplatedData } from "shared" | ||
``` | ||
If any imports are not available simply update the workspace `index.ts` to include | ||
|
||
**Angular** | ||
The angular compiler uses local `tsconfig.app.json` to include external dependencies, therefore if using an entry should be included | ||
|
||
```json | ||
{ | ||
"extends": "./tsconfig.json", | ||
"include": [ | ||
"packages/shared/**/*.ts", | ||
] | ||
} | ||
``` | ||
|
||
**NOTE** - the `shared` package workspace name conflicts with local `shared` folder | ||
As such when importing methods a package-based path will be required, i.e | ||
|
||
```ts | ||
import { TemplatedData } from "packages/shared" | ||
``` | ||
|
||
In addition, to avoid compiler errors thrown by non-browser shared methods, explicit paths should be included to import only the supported files as required | ||
|
||
```ts | ||
import { AppStringEvaluator } from "packages/shared/src/models/appStringEvaluator/appStringEvaluator"; | ||
import { TemplatedData } from "packages/shared/src/models/templatedData/templatedData"; | ||
``` | ||
|
||
In future it may be better to move any non-compatible shared methods to own package, or polyfill missing functions (e.g. `os`) |
Oops, something went wrong.