@limetech/lime-web-components 4.54.2 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt CHANGED
@@ -10,4 +10,4 @@ Unless required by applicable law or agreed to in writing, software
10
10
  distributed under the License is distributed on an "AS IS" BASIS,
11
11
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  See the License for the specific language governing permissions and
13
- limitations under the License.
13
+ limitations under the License.
package/README.md CHANGED
@@ -1,13 +1,28 @@
1
1
  # Lime Web Components
2
2
 
3
- This package contains the main library for Lime Web Components
3
+ [![Version](https://img.shields.io/npm/v/@limetech/lime-web-components.svg)](https://www.npmjs.com/package/@limetech/lime-web-components) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
4
4
 
5
- Lime Web Components are web components that are used to customize [Lime CRM](https://lime-crm.se/). Components are built using [StencilJS](https://stenciljs.com/docs/introduction), which uses [TypeScript](https://www.typescriptlang.org), [JSX](https://reactjs.org/docs/introducing-jsx.html) and [reactive](https://en.wikipedia.org/wiki/Reactive_programming) data-binding.
5
+ To start the dev-server, run `npm start`.
6
6
 
7
- ## Installation & Usage
7
+ To build the dist folder, run `npm run build`.
8
8
 
9
- Please use **lime-project** to generate new plugins and components. **lime-web-components** will be installed for you. To keep **lime-web-components** up to date, run `npm up @limetech/lime-web-components` to update within the same major version, or `npm install @limetech/lime-web-components@latest` to update to the latest version, possibly with breaking changes.
9
+ Read the full documentation at [https://lundalogik.github.io/lime-web-components/](https://lundalogik.github.io/lime-web-components/)
10
10
 
11
- For a list of changes, see the [CHANGELOG](https://github.com/Lundalogik/lime-web-components/blob/master/CHANGELOG.md).
11
+ ## Deploy documentation
12
12
 
13
- Read the full documentation at [https://lundalogik.github.io/lime-web-components/](https://lundalogik.github.io/lime-web-components/)
13
+ Documentation is deployed to GitHub Pages when a new release is built by Jenkins. It can also be deployed manually from a Linux or macOS computer. *NB! Running the publish script locally will update your git config for the repository with the values of the GIT_AUTHOR_EMAIL and GIT_AUTHOR_NAME environment variables. If you set these to anything other than your own user, you may wish to update your config again after publishing. The script will also make changes to a few files, and will checkout these again at the end. Any uncommitted changes you've made to these files **will be lost**. The script also removes the local copy of the branch gh-pages.*
14
+
15
+ Follow these steps:
16
+
17
+ 1. The following environment variables must be set:
18
+ - GIT_AUTHOR_EMAIL - the email address for the user making the commit
19
+ - GIT_AUTHOR_NAME - the name of the user making the commit
20
+ - GH_TOKEN - a GitHub access-token with write-access to the repository
21
+ - GH_USERNAME - the GitHub user to which the above access-token belongs
22
+ 2. Run `git fetch`.
23
+ 3. Run `git branch` and make sure you do *not* have a local copy of the branch `gh-pages`. If you do, push anything that should be pushed, and remove the local branch.
24
+ 4. From the repo-root, run `npm run docz:publish -- --v=<version>`, where `<version>` is the version of lime-elements you are building the documentation for. **Any existing documentation for this version number will be overwritten.** If no version is supplied, the version will be set to `0.0.0-dev`. If `--dryRun=true` is supplied, the entire script will run, except the push to GitHub.
25
+
26
+ ## Get help
27
+
28
+ - If you have a general question, or are in need of support, please open a [Question issue](https://github.com/Lundalogik/lime-web-components/issues/new?template=03_question.md) on GitHub.
@@ -41,7 +41,7 @@ export interface CommandBus extends CommandHandler {
41
41
  * @param {CommandConfig} config The command configuration
42
42
  * @throws {Error} Thrown if the command has not been registered yet
43
43
  */
44
- createCommand?<T = any>(config: CommandConfig<T>): T;
44
+ createCommand<T = any>(config: CommandConfig<T>): T;
45
45
  }
46
46
  /**
47
47
  * Service for executing commands
@@ -24,7 +24,7 @@ export interface DialogRenderer {
24
24
  * @param id the dialog identifier
25
25
  * @param properties any properties to send to the dialog
26
26
  */
27
- update?(id: number, properties?: DialogProperties): void;
27
+ update(id: number, properties?: DialogProperties): void;
28
28
  /**
29
29
  * Destroy a dialog
30
30
  *
@@ -6,7 +6,7 @@ var factory_1 = require("../core/decorators/factory");
6
6
  function SelectUserData(options) {
7
7
  if (options === void 0) { options = {}; }
8
8
  var config = {
9
- name: core_1.PlatformServiceName.UserData,
9
+ name: core_1.PlatformServiceName.UserDataRepository,
10
10
  };
11
11
  return (0, factory_1.createStateDecorator)(options, config);
12
12
  }
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  var platform_1 = require("../core/platform");
4
4
  var SERVICE_NAME = 'state.user-data';
5
- platform_1.PlatformServiceName.UserData = SERVICE_NAME;
5
+ platform_1.PlatformServiceName.UserDataRepository = SERVICE_NAME;
@@ -14,5 +14,5 @@ export interface FilterRepository extends StateRepository {
14
14
  * @param id a filter id to delete
15
15
  * @returns {Promise<void>} a promise that will be resolved when the filter is deleted
16
16
  */
17
- delete?(filter: Filter): Promise<void>;
17
+ delete(filter: Filter): Promise<void>;
18
18
  }
@@ -15,7 +15,7 @@ export interface LimeObjectRepository extends StateRepository {
15
15
  * @param {LoadOptions} options options about the objects to load
16
16
  * @returns {ObjectResponse} list of objects together with total count of objects
17
17
  */
18
- loadObjects?(limetype: string, options?: LoadOptions): Promise<ObjectResponse>;
18
+ loadObjects(limetype: string, options?: LoadOptions): Promise<ObjectResponse>;
19
19
  /**
20
20
  * Load related objects into the state
21
21
  *
@@ -31,27 +31,14 @@ export interface LimeObjectRepository extends StateRepository {
31
31
  *
32
32
  * @param {string} limetype name of the limetype of the owning limeobject
33
33
  */
34
- loadSchema?(limetype: string): Promise<object>;
35
- /**
36
- * Reload the specified limeobject and update corresponding views in the webclient
37
- *
38
- * NOTE: This is just a temporary method that can be used to get around some quirks in the current version of the
39
- * webclient. It is deprecated and code should not rely on its existance. Check if the method exists before using
40
- * it to make code backwards compatible, e.g. `limeobjects.reload && limeobjects.reload('company', 1001)`
41
- *
42
- * Once the quirks in the webclient have been fixed, there should be no need for this method and objects should
43
- * update themselves automatically.
44
- *
45
- * @deprecated
46
- */
47
- reloadObject?(limetype: string, id: number): void;
34
+ loadSchema(limetype: string): Promise<object>;
48
35
  /**
49
36
  * Delete the specified limeobject
50
37
  *
51
38
  * @param {string} limetype name of the limetype of the limeobject
52
39
  * @param {number} id the id of the limeobject
53
40
  */
54
- deleteObject?(limetype: string, id: number): Promise<void>;
41
+ deleteObject(limetype: string, id: number): Promise<void>;
55
42
  }
56
43
  export interface LoadOptions {
57
44
  /**
@@ -8,7 +8,7 @@ import { createStateDecorator } from '../core/decorators/factory';
8
8
  */
9
9
  export function SelectUserData(options = {}) {
10
10
  const config = {
11
- name: PlatformServiceName.UserData,
11
+ name: PlatformServiceName.UserDataRepository,
12
12
  };
13
13
  return createStateDecorator(options, config);
14
14
  }
@@ -5,10 +5,10 @@ declare module '../core/platform' {
5
5
  /**
6
6
  * @see {@link UserDataRepository}
7
7
  */
8
- UserData: typeof SERVICE_NAME;
8
+ UserDataRepository: typeof SERVICE_NAME;
9
9
  }
10
10
  interface LimeWebComponentPlatform {
11
- get(name: PlatformServiceNameType['UserData']): UserDataRepository;
11
+ get(name: PlatformServiceNameType['UserDataRepository']): UserDataRepository;
12
12
  }
13
13
  }
14
14
  export {};
@@ -1,3 +1,3 @@
1
1
  import { PlatformServiceName } from '../core/platform';
2
2
  const SERVICE_NAME = 'state.user-data';
3
- PlatformServiceName.UserData = SERVICE_NAME;
3
+ PlatformServiceName.UserDataRepository = SERVICE_NAME;
package/package.json CHANGED
@@ -1,55 +1,78 @@
1
1
  {
2
2
  "name": "@limetech/lime-web-components",
3
- "version": "4.54.2",
3
+ "version": "5.0.1",
4
+ "description": "Lime Web Components",
4
5
  "author": "Lime Technologies",
5
- "homepage": "https://github.com/Lundalogik/lime-web-components",
6
6
  "license": "Apache-2.0",
7
7
  "main": "dist/es5/index.js",
8
8
  "module": "dist/index.js",
9
9
  "types": "dist/index.d.ts",
10
- "keywords": [
11
- "lime web components",
12
- "lime crm"
13
- ],
14
10
  "files": [
15
- "dist",
11
+ "dist/",
16
12
  "testing"
17
13
  ],
18
14
  "scripts": {
19
15
  "build": "tsc && tsc -p tsconfig.es5.json",
16
+ "start": "npm run generate-api-docs && docz dev",
20
17
  "test": "stencil test --spec",
21
- "test:watch": "stencil test --spec --watch"
22
- },
23
- "config": {
24
- "commitizen": {
25
- "path": "../../node_modules/cz-conventional-changelog"
26
- }
27
- },
28
- "publishConfig": {
29
- "access": "public"
30
- },
31
- "repository": {
32
- "type": "git",
33
- "url": "https://github.com/Lundalogik/lime-web-components.git"
34
- },
35
- "bugs": {
36
- "url": "https://github.com/Lundalogik/lime-web-components/issues"
18
+ "docz:build": "npm run generate-api-docs && docz build",
19
+ "docz:publish": "node publish-docs.js",
20
+ "generate-api-docs": "typedoc && node transform-docs.js",
21
+ "lint": "npm run lint:src && npm run lint:json",
22
+ "lint:fix": "npm run lint:src:fix && npm run lint:json:fix",
23
+ "lint:json": "prettier -l '{!(package*).json,packages/*/!(package*).json,.prettierrc}'",
24
+ "lint:json:fix": "prettier --write '{!(package*).json,packages/*/!(package*).json,.prettierrc}'",
25
+ "lint:src": "eslint '**/*.{ts,js}' --max-warnings=0",
26
+ "lint:src:fix": "eslint '**/*.{ts,js}' --fix --max-warnings=0",
27
+ "postpublish": "npm run docz:publish -- --v=current",
28
+ "postpublish:dry-run": "npm run docz:publish -- --v=current --dryRun"
37
29
  },
38
30
  "dependencies": {
39
- "@limetech/lime-web-components-commands": "^4.51.2",
40
- "@limetech/lime-web-components-decorators": "^4.53.1",
41
- "@limetech/lime-web-components-interfaces": "^4.51.2",
42
- "@limetech/lime-web-components-testing": "^4.53.1",
43
31
  "rxjs": "^7.5.6",
44
32
  "tslib": "^2.4.0"
45
33
  },
46
34
  "devDependencies": {
35
+ "@commitlint/config-conventional": "^16.2.4",
36
+ "@stencil/core": "^2.18.0",
47
37
  "@types/jest": "^27.5.0",
38
+ "@typescript-eslint/eslint-plugin": "^5.38.0",
39
+ "@typescript-eslint/parser": "^5.38.0",
40
+ "commitizen": "^4.2.5",
41
+ "cz-conventional-changelog": "^3.3.0",
42
+ "docz": "0.12.5",
43
+ "eslint": "^8.23.1",
44
+ "eslint-config-prettier": "^8.5.0",
45
+ "eslint-plugin-jsdoc": "^37.9.7",
46
+ "eslint-plugin-prefer-arrow": "^1.2.3",
47
+ "eslint-plugin-prettier": "^4.2.1",
48
+ "eslint-plugin-react": "^7.31.8",
49
+ "eslint-plugin-sonarjs": "^0.15.0",
48
50
  "jest": "^27.5.1",
49
- "jest-cli": "^27.5.1"
51
+ "jest-cli": "^27.5.1",
52
+ "prettier": "^2.7.1",
53
+ "replace-in-file": "^6.3.5",
54
+ "shelljs": "0.8.5",
55
+ "typedoc": "0.17.7",
56
+ "typedoc-plugin-markdown": "~2.4.2",
57
+ "typescript": "^4.8.3"
50
58
  },
51
59
  "peerDependencies": {
52
60
  "@stencil/core": "^2.17.1"
53
61
  },
54
- "gitHead": "13613b1b5a0b22a21cd574f5050391e403a315c3"
62
+ "keywords": [
63
+ "lime web components",
64
+ "lime crm"
65
+ ],
66
+ "directories": {
67
+ "doc": "doc"
68
+ },
69
+ "config": {
70
+ "commitizen": {
71
+ "path": "./node_modules/cz-conventional-changelog"
72
+ }
73
+ },
74
+ "repository": {
75
+ "type": "git",
76
+ "url": "https://github.com/Lundalogik/lime-web-components.git"
77
+ }
55
78
  }
@@ -2,7 +2,7 @@
2
2
  "name": "@limetech/lime-web-components",
3
3
  "author": "Lime Technologies",
4
4
  "main": "../dist/es5/testing/index.js",
5
- "module": "../dist/testing/index.es.js",
5
+ "module": "../dist/testing/index.js",
6
6
  "types": "../dist/testing/index.d.ts",
7
7
  "keywords": [
8
8
  "lime web components",