@po-ui/ng-storage 5.22.3 → 6.2.0
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/README.md +16 -16
- package/{esm2015/lib/drivers/lokijs/po-loki-driver.js → esm2020/lib/drivers/lokijs/po-loki-driver.mjs} +209 -209
- package/{esm2015/lib/index.js → esm2020/lib/index.mjs} +3 -3
- package/esm2020/lib/po-storage.module.mjs +33 -0
- package/esm2020/lib/services/po-storage-config.interface.mjs +11 -0
- package/esm2020/lib/services/po-storage.service.mjs +520 -0
- package/esm2020/po-ui-ng-storage.mjs +5 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +2 -2
- package/fesm2015/{po-ui-ng-storage.js → po-ui-ng-storage.mjs} +786 -774
- package/fesm2015/po-ui-ng-storage.mjs.map +1 -0
- package/fesm2020/po-ui-ng-storage.mjs +764 -0
- package/fesm2020/po-ui-ng-storage.mjs.map +1 -0
- package/lib/drivers/lokijs/po-loki-driver.d.ts +30 -30
- package/lib/index.d.ts +3 -3
- package/lib/po-storage.module.d.ts +14 -10
- package/lib/services/po-storage-config.interface.d.ts +27 -27
- package/lib/services/po-storage.service.d.ts +381 -378
- package/package.json +28 -13
- package/po-ui-ng-storage-6.2.0.tgz +0 -0
- package/po-ui-ng-storage.d.ts +5 -5
- package/public-api.d.ts +1 -1
- package/schematics/README.md +91 -91
- package/schematics/collection.json +10 -10
- package/schematics/ng-add/index.d.ts +7 -7
- package/schematics/ng-add/index.js +28 -28
- package/schematics/ng-add/index.js.map +1 -1
- package/schematics/ng-add/index.spec.d.ts +1 -1
- package/schematics/ng-add/index.spec.js +50 -50
- package/schematics/ng-add/index.spec.js.map +1 -1
- package/schematics/ng-add/schema.json +6 -6
- package/bundles/po-ui-ng-storage.umd.js +0 -1279
- package/bundles/po-ui-ng-storage.umd.js.map +0 -1
- package/esm2015/lib/po-storage.module.js +0 -29
- package/esm2015/lib/services/po-storage-config.interface.js +0 -11
- package/esm2015/lib/services/po-storage.service.js +0 -546
- package/esm2015/po-ui-ng-storage.js +0 -6
- package/fesm2015/po-ui-ng-storage.js.map +0 -1
- package/po-ui-ng-storage-5.22.3.tgz +0 -0
- package/po-ui-ng-storage.metadata.json +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@po-ui/ng-storage",
|
|
3
|
-
"version": "
|
|
4
|
-
"tag": "
|
|
3
|
+
"version": "6.2.0",
|
|
4
|
+
"tag": "next",
|
|
5
5
|
"description": "PO UI - Storage",
|
|
6
6
|
"author": "PO UI",
|
|
7
7
|
"license": "MIT",
|
|
@@ -12,26 +12,41 @@
|
|
|
12
12
|
},
|
|
13
13
|
"schematics": "./schematics/collection.json",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@po-ui/ng-schematics": "
|
|
15
|
+
"@po-ui/ng-schematics": "6.2.0",
|
|
16
16
|
"custom-idle-queue": "2.1.2",
|
|
17
17
|
"localforage": "1.9.0",
|
|
18
18
|
"lokijs": "1.5.12",
|
|
19
|
-
"tslib": "^2.
|
|
19
|
+
"tslib": "^2.3.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@angular/core": "^
|
|
22
|
+
"@angular/core": "^13.0.2",
|
|
23
23
|
"custom-idle-queue": "2.1.2",
|
|
24
24
|
"localforage": "1.9.0",
|
|
25
25
|
"lokijs": "1.5.12",
|
|
26
|
-
"rxjs": "~
|
|
26
|
+
"rxjs": "~7.4.0",
|
|
27
27
|
"zone.js": "~0.11.4"
|
|
28
28
|
},
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"fesm2015": "fesm2015/po-ui-ng-storage.
|
|
29
|
+
"module": "fesm2015/po-ui-ng-storage.mjs",
|
|
30
|
+
"es2020": "fesm2020/po-ui-ng-storage.mjs",
|
|
31
|
+
"esm2020": "esm2020/po-ui-ng-storage.mjs",
|
|
32
|
+
"fesm2020": "fesm2020/po-ui-ng-storage.mjs",
|
|
33
|
+
"fesm2015": "fesm2015/po-ui-ng-storage.mjs",
|
|
34
34
|
"typings": "po-ui-ng-storage.d.ts",
|
|
35
|
-
"
|
|
36
|
-
|
|
35
|
+
"exports": {
|
|
36
|
+
"./package.json": {
|
|
37
|
+
"default": "./package.json"
|
|
38
|
+
},
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./po-ui-ng-storage.d.ts",
|
|
41
|
+
"esm2020": "./esm2020/po-ui-ng-storage.mjs",
|
|
42
|
+
"es2020": "./fesm2020/po-ui-ng-storage.mjs",
|
|
43
|
+
"es2015": "./fesm2015/po-ui-ng-storage.mjs",
|
|
44
|
+
"node": "./fesm2015/po-ui-ng-storage.mjs",
|
|
45
|
+
"default": "./fesm2020/po-ui-ng-storage.mjs"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"sideEffects": false,
|
|
49
|
+
"scripts": {
|
|
50
|
+
"prepublishOnly": "node --eval \"console.error('ERROR: Trying to publish a package that has been compiled by Ivy in full compilation mode. This is not allowed.\\nPlease delete and rebuild the package with Ivy partial compilation mode, before attempting to publish.\\n')\" && exit 1"
|
|
51
|
+
}
|
|
37
52
|
}
|
|
Binary file
|
package/po-ui-ng-storage.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@po-ui/ng-storage" />
|
|
5
|
+
export * from './public-api';
|
package/public-api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './lib/index';
|
|
1
|
+
export * from './lib/index';
|
package/schematics/README.md
CHANGED
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
# PO UI Storage
|
|
2
|
-
|
|
3
|
-
## Modo desenvolvimento
|
|
4
|
-
|
|
5
|
-
Para desenvolver novos *schematics* ou alterá-los é necessário executar o comando abaixo na raiz do projeto:
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
~ <caminho_do_repositorio>/po-angular
|
|
9
|
-
|
|
10
|
-
> npm run build:schematics
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Após executar o comando será criado a pasta `dist/ng-schematics` e você estará apto a utilizar a biblioteca
|
|
14
|
-
em modo de desenvolvimento para implementar novas melhorias/correções e etc.
|
|
15
|
-
|
|
16
|
-
## Como testar
|
|
17
|
-
|
|
18
|
-
Há duas possibilidades para execução de testes para os novos *schematics*:
|
|
19
|
-
|
|
20
|
-
### 1 - npm link
|
|
21
|
-
|
|
22
|
-
O comando **npm link** criará um link simbólico do pacote que deseja testar dentro do `node_modules` da aplicação. Desta forma, é possível executar *schematics* do `po-storage` diretamente em `./projects/app/src/app`.
|
|
23
|
-
|
|
24
|
-
Primeiramente, é necessária a alteração em `angular.json`:
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
...
|
|
28
|
-
"defaultProject": "app"
|
|
29
|
-
...
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Executar o build do projeto `po-storage`:
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
> npm run build:storage
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Agora executaremos o comando de link:
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
> npm link dist/ng-storage
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Por fim, executando o comando abaixo, o pacote do `po-storage` será instalado e também será adicionado o módulo `PoStorageModule` em `app.module.ts`:
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
> ng generate @po-ui/ng-storage:ng-add
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
> Pra remover posteriormente o pacote `po-storage` do `node_modules` execute `npm uninstall @po-ui/ng-storage`.
|
|
51
|
-
|
|
52
|
-
### 2 - verdaccio
|
|
53
|
-
|
|
54
|
-
Para poder testar localmente é necessário instalar [verdaccio](https://github.com/verdaccio/verdaccio), para termos um *npm registry* local,
|
|
55
|
-
onde publicaremos os pacotes para realizar o teste.
|
|
56
|
-
|
|
57
|
-
Após a instalação, devemos apontar o npm registry para o que iniciaremos localmente.
|
|
58
|
-
|
|
59
|
-
O comando abaixo subirá o npm local, no endereço http://localhost:4873.
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
> verdaccio
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Em seguida, definiremos o *npm registry*, conforme o comando abaixo:
|
|
66
|
-
|
|
67
|
-
```
|
|
68
|
-
> npm set registry http://localhost:4873
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
A partir de agora, os pacotes que publicaremos serão enviados ao nosso registry local.
|
|
72
|
-
|
|
73
|
-
> Para utilizar *npm registry* global novamente, execute o comando: `npm set registry https://registry.npmjs.org/`.
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Antes de testarmos o pacotes, devemos fazer duas configurações, são elas:
|
|
77
|
-
|
|
78
|
-
- Adicionar dentro do arquivo ```verdaccio/config.yaml``` a configuração: `max_body_size: 200mb`;
|
|
79
|
-
- Executar o comando: ``` npm adduser --registry http://localhost:4873 ```
|
|
80
|
-
|
|
81
|
-
Para testarmos o pacote, devemos incrementar a versão do mesmo e ter o npm registry local em execução. confirmando essas situações, podemos rodar o script abaixo:
|
|
82
|
-
|
|
83
|
-
```
|
|
84
|
-
> npm run build:storage && npm run publish:storage:local
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
Por fim, execute os comando abaixo no seu projeto Angular:
|
|
88
|
-
|
|
89
|
-
```
|
|
90
|
-
> ng add @po-ui/ng-storage
|
|
91
|
-
```
|
|
1
|
+
# PO UI Storage
|
|
2
|
+
|
|
3
|
+
## Modo desenvolvimento
|
|
4
|
+
|
|
5
|
+
Para desenvolver novos *schematics* ou alterá-los é necessário executar o comando abaixo na raiz do projeto:
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
~ <caminho_do_repositorio>/po-angular
|
|
9
|
+
|
|
10
|
+
> npm run build:schematics
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Após executar o comando será criado a pasta `dist/ng-schematics` e você estará apto a utilizar a biblioteca
|
|
14
|
+
em modo de desenvolvimento para implementar novas melhorias/correções e etc.
|
|
15
|
+
|
|
16
|
+
## Como testar
|
|
17
|
+
|
|
18
|
+
Há duas possibilidades para execução de testes para os novos *schematics*:
|
|
19
|
+
|
|
20
|
+
### 1 - npm link
|
|
21
|
+
|
|
22
|
+
O comando **npm link** criará um link simbólico do pacote que deseja testar dentro do `node_modules` da aplicação. Desta forma, é possível executar *schematics* do `po-storage` diretamente em `./projects/app/src/app`.
|
|
23
|
+
|
|
24
|
+
Primeiramente, é necessária a alteração em `angular.json`:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
...
|
|
28
|
+
"defaultProject": "app"
|
|
29
|
+
...
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Executar o build do projeto `po-storage`:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
> npm run build:storage
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Agora executaremos o comando de link:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
> npm link dist/ng-storage
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Por fim, executando o comando abaixo, o pacote do `po-storage` será instalado e também será adicionado o módulo `PoStorageModule` em `app.module.ts`:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
> ng generate @po-ui/ng-storage:ng-add
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
> Pra remover posteriormente o pacote `po-storage` do `node_modules` execute `npm uninstall @po-ui/ng-storage`.
|
|
51
|
+
|
|
52
|
+
### 2 - verdaccio
|
|
53
|
+
|
|
54
|
+
Para poder testar localmente é necessário instalar [verdaccio](https://github.com/verdaccio/verdaccio), para termos um *npm registry* local,
|
|
55
|
+
onde publicaremos os pacotes para realizar o teste.
|
|
56
|
+
|
|
57
|
+
Após a instalação, devemos apontar o npm registry para o que iniciaremos localmente.
|
|
58
|
+
|
|
59
|
+
O comando abaixo subirá o npm local, no endereço http://localhost:4873.
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
> verdaccio
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Em seguida, definiremos o *npm registry*, conforme o comando abaixo:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
> npm set registry http://localhost:4873
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
A partir de agora, os pacotes que publicaremos serão enviados ao nosso registry local.
|
|
72
|
+
|
|
73
|
+
> Para utilizar *npm registry* global novamente, execute o comando: `npm set registry https://registry.npmjs.org/`.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
Antes de testarmos o pacotes, devemos fazer duas configurações, são elas:
|
|
77
|
+
|
|
78
|
+
- Adicionar dentro do arquivo ```verdaccio/config.yaml``` a configuração: `max_body_size: 200mb`;
|
|
79
|
+
- Executar o comando: ``` npm adduser --registry http://localhost:4873 ```
|
|
80
|
+
|
|
81
|
+
Para testarmos o pacote, devemos incrementar a versão do mesmo e ter o npm registry local em execução. confirmando essas situações, podemos rodar o script abaixo:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
> npm run build:storage && npm run publish:storage:local
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Por fim, execute os comando abaixo no seu projeto Angular:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
> ng add @po-ui/ng-storage
|
|
91
|
+
```
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
-
"schematics": {
|
|
4
|
-
"ng-add": {
|
|
5
|
-
"description": "Add my library to the project.",
|
|
6
|
-
"factory": "./ng-add/index",
|
|
7
|
-
"schema": "./ng-add/schema.json"
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"ng-add": {
|
|
5
|
+
"description": "Add my library to the project.",
|
|
6
|
+
"factory": "./ng-add/index",
|
|
7
|
+
"schema": "./ng-add/schema.json"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
-
/**
|
|
3
|
-
* Scaffolds the basics of the PO Storage, this includes:
|
|
4
|
-
* - Install dependencies;
|
|
5
|
-
* - Imports PoStorageModule to app root module;
|
|
6
|
-
*/
|
|
7
|
-
export default function (options: any): Rule;
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
|
2
|
+
/**
|
|
3
|
+
* Scaffolds the basics of the PO Storage, this includes:
|
|
4
|
+
* - Install dependencies;
|
|
5
|
+
* - Imports PoStorageModule to app root module;
|
|
6
|
+
*/
|
|
7
|
+
export default function (options: any): Rule;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const schematics_1 = require("@angular-devkit/schematics");
|
|
4
|
-
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
5
|
-
const package_config_1 = require("@po-ui/ng-schematics/package-config");
|
|
6
|
-
const module_1 = require("@po-ui/ng-schematics/module/module");
|
|
7
|
-
/** PO Module name that will be inserted into app root module */
|
|
8
|
-
const poStorageModuleName = 'PoStorageModule.forRoot()';
|
|
9
|
-
const poStorageModuleSourcePath = '@po-ui/ng-storage';
|
|
10
|
-
/**
|
|
11
|
-
* Scaffolds the basics of the PO Storage, this includes:
|
|
12
|
-
* - Install dependencies;
|
|
13
|
-
* - Imports PoStorageModule to app root module;
|
|
14
|
-
*/
|
|
15
|
-
function default_1(options) {
|
|
16
|
-
return schematics_1.chain([
|
|
17
|
-
addPoPackageAndInstall(),
|
|
18
|
-
module_1.addModuleImportToRootModule(options, poStorageModuleName, poStorageModuleSourcePath)
|
|
19
|
-
]);
|
|
20
|
-
}
|
|
21
|
-
exports.default = default_1;
|
|
22
|
-
function addPoPackageAndInstall() {
|
|
23
|
-
return (tree, context) => {
|
|
24
|
-
package_config_1.addPackageToPackageJson(tree, '@po-ui/ng-storage', '
|
|
25
|
-
// install packages
|
|
26
|
-
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
27
|
-
};
|
|
28
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
4
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
5
|
+
const package_config_1 = require("@po-ui/ng-schematics/package-config");
|
|
6
|
+
const module_1 = require("@po-ui/ng-schematics/module/module");
|
|
7
|
+
/** PO Module name that will be inserted into app root module */
|
|
8
|
+
const poStorageModuleName = 'PoStorageModule.forRoot()';
|
|
9
|
+
const poStorageModuleSourcePath = '@po-ui/ng-storage';
|
|
10
|
+
/**
|
|
11
|
+
* Scaffolds the basics of the PO Storage, this includes:
|
|
12
|
+
* - Install dependencies;
|
|
13
|
+
* - Imports PoStorageModule to app root module;
|
|
14
|
+
*/
|
|
15
|
+
function default_1(options) {
|
|
16
|
+
return (0, schematics_1.chain)([
|
|
17
|
+
addPoPackageAndInstall(),
|
|
18
|
+
(0, module_1.addModuleImportToRootModule)(options, poStorageModuleName, poStorageModuleSourcePath)
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
exports.default = default_1;
|
|
22
|
+
function addPoPackageAndInstall() {
|
|
23
|
+
return (tree, context) => {
|
|
24
|
+
(0, package_config_1.addPackageToPackageJson)(tree, '@po-ui/ng-storage', '6.2.0');
|
|
25
|
+
// install packages
|
|
26
|
+
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/storage/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAAA,2DAAiF;AACjF,4DAA0E;AAE1E,wEAA8E;AAC9E,+DAAiF;AAEjF,gEAAgE;AAChE,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AACxD,MAAM,yBAAyB,GAAG,mBAAmB,CAAC;AAEtD;;;;GAIG;AACH,mBAAyB,OAAY;IACnC,OAAO,kBAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../projects/storage/schematics/ng-add/index.ts"],"names":[],"mappings":";;AAAA,2DAAiF;AACjF,4DAA0E;AAE1E,wEAA8E;AAC9E,+DAAiF;AAEjF,gEAAgE;AAChE,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AACxD,MAAM,yBAAyB,GAAG,mBAAmB,CAAC;AAEtD;;;;GAIG;AACH,mBAAyB,OAAY;IACnC,OAAO,IAAA,kBAAK,EAAC;QACX,sBAAsB,EAAE;QACxB,IAAA,oCAA2B,EAAC,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,CAAC;KACrF,CAAC,CAAC;AACL,CAAC;AALD,4BAKC;AAED,SAAS,sBAAsB;IAC7B,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,IAAA,wCAAuB,EAAC,IAAI,EAAE,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;QAExE,mBAAmB;QACnB,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
5
|
-
const path = require("path");
|
|
6
|
-
const collectionPath = path.join(__dirname, '../collection.json');
|
|
7
|
-
|
|
8
|
-
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
9
|
-
const workspaceOptions = {
|
|
10
|
-
name: 'workspace',
|
|
11
|
-
newProjectRoot: 'projects',
|
|
12
|
-
version: '6.0.0'
|
|
13
|
-
};
|
|
14
|
-
const componentOptions = {
|
|
15
|
-
name: 'po'
|
|
16
|
-
};
|
|
17
|
-
let appTree;
|
|
18
|
-
beforeEach(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
19
|
-
appTree = yield runner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise();
|
|
20
|
-
appTree = yield runner
|
|
21
|
-
.runExternalSchematicAsync('@schematics/angular', 'application', componentOptions, appTree)
|
|
22
|
-
.toPromise();
|
|
23
|
-
}));
|
|
24
|
-
describe('Dependencies:', () => {
|
|
25
|
-
it('should update package.json with @po-ui/ng-storage dependency and run nodePackageInstall', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
26
|
-
const tree = yield runner.runSchematicAsync('ng-add', componentOptions, appTree).toPromise();
|
|
27
|
-
const packageJson = JSON.parse(getFileContent(tree, '/package.json'));
|
|
28
|
-
const dependencies = packageJson.dependencies;
|
|
29
|
-
expect(dependencies['@po-ui/ng-storage']).toBeDefined();
|
|
30
|
-
expect(Object.keys(dependencies)).toEqual(Object.keys(dependencies).sort());
|
|
31
|
-
expect(runner.tasks.some(task => task.name === 'node-package')).toBe(true);
|
|
32
|
-
}));
|
|
33
|
-
});
|
|
34
|
-
describe('Imports:', () => {
|
|
35
|
-
it('should add the PoStorageModule to the project module', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
const poStorageModuleName = 'PoStorageModule';
|
|
37
|
-
const tree = yield runner.runSchematicAsync('ng-add', componentOptions, appTree).toPromise();
|
|
38
|
-
const fileContent = getFileContent(tree, `projects/${componentOptions.name}/src/app/app.module.ts`);
|
|
39
|
-
expect(fileContent).toContain(poStorageModuleName);
|
|
40
|
-
}));
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
/** Gets the content of a specified file from a schematic tree. */
|
|
44
|
-
function getFileContent(tree, filePath) {
|
|
45
|
-
const contentBuffer = tree.read(filePath);
|
|
46
|
-
if (!contentBuffer) {
|
|
47
|
-
throw new Error(`Cannot read "${filePath}" because it does not exist.`);
|
|
48
|
-
}
|
|
49
|
-
return contentBuffer.toString();
|
|
50
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const testing_1 = require("@angular-devkit/schematics/testing");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const collectionPath = path.join(__dirname, '../collection.json');
|
|
7
|
+
xdescribe('Schematic: ng-add', () => {
|
|
8
|
+
const runner = new testing_1.SchematicTestRunner('schematics', collectionPath);
|
|
9
|
+
const workspaceOptions = {
|
|
10
|
+
name: 'workspace',
|
|
11
|
+
newProjectRoot: 'projects',
|
|
12
|
+
version: '6.0.0'
|
|
13
|
+
};
|
|
14
|
+
const componentOptions = {
|
|
15
|
+
name: 'po'
|
|
16
|
+
};
|
|
17
|
+
let appTree;
|
|
18
|
+
beforeEach(() => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
|
19
|
+
appTree = yield runner.runExternalSchematicAsync('@schematics/angular', 'workspace', workspaceOptions).toPromise();
|
|
20
|
+
appTree = yield runner
|
|
21
|
+
.runExternalSchematicAsync('@schematics/angular', 'application', componentOptions, appTree)
|
|
22
|
+
.toPromise();
|
|
23
|
+
}));
|
|
24
|
+
describe('Dependencies:', () => {
|
|
25
|
+
it('should update package.json with @po-ui/ng-storage dependency and run nodePackageInstall', () => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
|
26
|
+
const tree = yield runner.runSchematicAsync('ng-add', componentOptions, appTree).toPromise();
|
|
27
|
+
const packageJson = JSON.parse(getFileContent(tree, '/package.json'));
|
|
28
|
+
const dependencies = packageJson.dependencies;
|
|
29
|
+
expect(dependencies['@po-ui/ng-storage']).toBeDefined();
|
|
30
|
+
expect(Object.keys(dependencies)).toEqual(Object.keys(dependencies).sort());
|
|
31
|
+
expect(runner.tasks.some(task => task.name === 'node-package')).toBe(true);
|
|
32
|
+
}));
|
|
33
|
+
});
|
|
34
|
+
describe('Imports:', () => {
|
|
35
|
+
it('should add the PoStorageModule to the project module', () => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
|
36
|
+
const poStorageModuleName = 'PoStorageModule';
|
|
37
|
+
const tree = yield runner.runSchematicAsync('ng-add', componentOptions, appTree).toPromise();
|
|
38
|
+
const fileContent = getFileContent(tree, `projects/${componentOptions.name}/src/app/app.module.ts`);
|
|
39
|
+
expect(fileContent).toContain(poStorageModuleName);
|
|
40
|
+
}));
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
/** Gets the content of a specified file from a schematic tree. */
|
|
44
|
+
function getFileContent(tree, filePath) {
|
|
45
|
+
const contentBuffer = tree.read(filePath);
|
|
46
|
+
if (!contentBuffer) {
|
|
47
|
+
throw new Error(`Cannot read "${filePath}" because it does not exist.`);
|
|
48
|
+
}
|
|
49
|
+
return contentBuffer.toString();
|
|
50
|
+
}
|
|
51
51
|
//# sourceMappingURL=index.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../projects/storage/schematics/ng-add/index.spec.ts"],"names":[],"mappings":";;;AAAA,gEAAuF;AAIvF,6BAA6B;AAE7B,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAElE,
|
|
1
|
+
{"version":3,"file":"index.spec.js","sourceRoot":"","sources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
|
4
|
-
"title": "Ng Add Options Schema",
|
|
5
|
-
"type": ["object"]
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "SchematicsNgAdd",
|
|
4
|
+
"title": "Ng Add Options Schema",
|
|
5
|
+
"type": ["object"]
|
|
6
|
+
}
|