@skyux-sdk/testing-schematics 14.1.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/__mocks__/ora.d.ts +10 -0
- package/__mocks__/ora.js +14 -0
- package/__mocks__/ora.js.map +1 -0
- package/collection.json +10 -0
- package/package.json +40 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -0
- package/src/schematics/ng-add/ng-add.schematic.d.ts +2 -0
- package/src/schematics/ng-add/ng-add.schematic.js +28 -0
- package/src/schematics/ng-add/ng-add.schematic.js.map +1 -0
- package/src/schematics/ng-add/schema.json +5 -0
- package/src/schematics/testing/scaffold.d.ts +21 -0
- package/src/schematics/testing/scaffold.js +63 -0
- package/src/schematics/testing/scaffold.js.map +1 -0
package/__mocks__/ora.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = ora;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-empty-function */
|
|
5
|
+
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
6
|
+
function ora() {
|
|
7
|
+
return {
|
|
8
|
+
start: () => ({ succeed: () => { }, fail: () => { }, stop: () => { } }),
|
|
9
|
+
succeed: () => { },
|
|
10
|
+
fail: () => { },
|
|
11
|
+
stop: () => { },
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ora.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ora.js","sourceRoot":"","sources":["../../../../../libs/sdk/testing-schematics/__mocks__/ora.ts"],"names":[],"mappings":";;AAEA,sBAOC;AATD,yDAAyD;AACzD,qEAAqE;AACrE,SAAwB,GAAG;IACzB,OAAO;QACL,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,CAAC;QACpE,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;QACjB,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;QACd,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;KACf,CAAC;AACJ,CAAC"}
|
package/collection.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
|
|
3
|
+
"schematics": {
|
|
4
|
+
"ng-add": {
|
|
5
|
+
"description": "Add @skyux-sdk/testing to your project.",
|
|
6
|
+
"factory": "./src/schematics/ng-add/ng-add.schematic",
|
|
7
|
+
"schema": "./src/schematics/ng-add/schema.json"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@skyux-sdk/testing-schematics",
|
|
3
|
+
"version": "14.1.1",
|
|
4
|
+
"author": "Blackbaud, Inc.",
|
|
5
|
+
"description": "SKY UX testing schematics for Angular CLI projects",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"blackbaud",
|
|
8
|
+
"skyux"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/blackbaud/skyux.git"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/blackbaud/skyux/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/blackbaud/skyux#readme",
|
|
19
|
+
"schematics": "./collection.json",
|
|
20
|
+
"ng-add": {
|
|
21
|
+
"save": "devDependencies"
|
|
22
|
+
},
|
|
23
|
+
"ng-update": {
|
|
24
|
+
"packageGroupName": "@skyux-sdk/testing-schematics",
|
|
25
|
+
"packageGroup": {
|
|
26
|
+
"@skyux-sdk/testing": "14.1.1",
|
|
27
|
+
"@skyux-sdk/testing-schematics": "14.1.1",
|
|
28
|
+
"axe-core": "~4.11.1"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@angular/cli": "^21.2.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"tslib": "^2.8.1"
|
|
36
|
+
},
|
|
37
|
+
"types": "./src/index.d.ts",
|
|
38
|
+
"main": "./src/index.js",
|
|
39
|
+
"type": "commonjs"
|
|
40
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/src/index.js
ADDED
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/sdk/testing-schematics/src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = ngAdd;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
7
|
+
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
|
8
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
9
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
10
|
+
function installDependencies() {
|
|
11
|
+
return (tree, context) => {
|
|
12
|
+
const packageJson = JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.resolve(__dirname, '../../../package.json'), {
|
|
13
|
+
encoding: 'utf-8',
|
|
14
|
+
}));
|
|
15
|
+
const axeCoreVersion = packageJson['ng-update']?.packageGroup?.['axe-core'];
|
|
16
|
+
(0, dependencies_1.addPackageJsonDependency)(tree, {
|
|
17
|
+
type: dependencies_1.NodeDependencyType.Dev,
|
|
18
|
+
name: 'axe-core',
|
|
19
|
+
version: axeCoreVersion,
|
|
20
|
+
overwrite: true,
|
|
21
|
+
});
|
|
22
|
+
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function ngAdd() {
|
|
26
|
+
return (0, schematics_1.chain)([installDependencies()]);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=ng-add.schematic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-add.schematic.js","sourceRoot":"","sources":["../../../../../../../libs/sdk/testing-schematics/src/schematics/ng-add/ng-add.schematic.ts"],"names":[],"mappings":";;AA+BA,wBAEC;;AAjCD,2DAAyD;AACzD,4DAA0E;AAC1E,2EAGkD;AAElD,8DAAyB;AACzB,kEAA6B;AAE7B,SAAS,mBAAmB;IAC1B,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACvB,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,iBAAE,CAAC,YAAY,CAAC,mBAAI,CAAC,OAAO,CAAC,SAAS,EAAE,uBAAuB,CAAC,EAAE;YAChE,QAAQ,EAAE,OAAO;SAClB,CAAC,CACH,CAAC;QAEF,MAAM,cAAc,GAAG,WAAW,CAAC,WAAW,CAAC,EAAE,YAAY,EAAE,CAAC,UAAU,CAAC,CAAC;QAE5E,IAAA,uCAAwB,EAAC,IAAI,EAAE;YAC7B,IAAI,EAAE,iCAAkB,CAAC,GAAG;YAC5B,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,cAAc;YACvB,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,OAAO,CAAC,OAAO,CAAC,IAAI,8BAAsB,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC;AACJ,CAAC;AAED,SAAwB,KAAK;IAC3B,OAAO,IAAA,kBAAK,EAAC,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SchematicTestRunner, UnitTestTree } from '@angular-devkit/schematics/testing';
|
|
2
|
+
import { Schema } from '@schematics/angular/ng-new/schema';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a new Angular CLI application.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createTestApp(runner: SchematicTestRunner, appOptions: {
|
|
7
|
+
projectName: string;
|
|
8
|
+
options?: Partial<Schema>;
|
|
9
|
+
}): Promise<UnitTestTree>;
|
|
10
|
+
/**
|
|
11
|
+
* Create a test workspace with a library as the default project.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createTestLibrary(runner: SchematicTestRunner, libOptions: {
|
|
14
|
+
projectName: string;
|
|
15
|
+
options?: Partial<Schema>;
|
|
16
|
+
}): Promise<UnitTestTree>;
|
|
17
|
+
/**
|
|
18
|
+
* Get the currently installed version of Angular.
|
|
19
|
+
* Use `require` to satisfy Jest when importing from @angular/cli ESM module.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getAngularMajorVersion(): string;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createTestApp = createTestApp;
|
|
4
|
+
exports.createTestLibrary = createTestLibrary;
|
|
5
|
+
exports.getAngularMajorVersion = getAngularMajorVersion;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
8
|
+
const node_module_1 = require("node:module");
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new Angular CLI application.
|
|
11
|
+
*/
|
|
12
|
+
async function createTestApp(runner, appOptions) {
|
|
13
|
+
const tree = await runner.runExternalSchematic('@schematics/angular', 'ng-new', {
|
|
14
|
+
directory: '/',
|
|
15
|
+
name: appOptions.projectName,
|
|
16
|
+
routing: true,
|
|
17
|
+
strict: true,
|
|
18
|
+
style: 'scss',
|
|
19
|
+
version: getAngularMajorVersion(),
|
|
20
|
+
zoneless: false,
|
|
21
|
+
...appOptions.options,
|
|
22
|
+
});
|
|
23
|
+
return tree;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a test workspace with a library as the default project.
|
|
27
|
+
*/
|
|
28
|
+
async function createTestLibrary(runner, libOptions) {
|
|
29
|
+
const workspaceTree = await runner.runExternalSchematic('@schematics/angular', 'ng-new', {
|
|
30
|
+
directory: '/',
|
|
31
|
+
name: `${libOptions.projectName}-workspace`,
|
|
32
|
+
createApplication: false,
|
|
33
|
+
strict: true,
|
|
34
|
+
version: getAngularMajorVersion(),
|
|
35
|
+
zoneless: false,
|
|
36
|
+
...libOptions.options,
|
|
37
|
+
});
|
|
38
|
+
await runner.runExternalSchematic('@schematics/angular', 'library', {
|
|
39
|
+
name: libOptions.projectName,
|
|
40
|
+
}, workspaceTree);
|
|
41
|
+
// Create a "showcase" application for library projects.
|
|
42
|
+
await runner.runExternalSchematic('@schematics/angular', 'application', {
|
|
43
|
+
name: `${libOptions.projectName}-showcase`,
|
|
44
|
+
zoneless: false,
|
|
45
|
+
}, workspaceTree);
|
|
46
|
+
return workspaceTree;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get the currently installed version of Angular.
|
|
50
|
+
* Use `require` to satisfy Jest when importing from @angular/cli ESM module.
|
|
51
|
+
*/
|
|
52
|
+
function getAngularMajorVersion() {
|
|
53
|
+
const require = (0, node_module_1.createRequire)(__filename);
|
|
54
|
+
try {
|
|
55
|
+
const angularCliPackagePath = require.resolve('@angular/cli/package.json');
|
|
56
|
+
const angularCliPackage = JSON.parse(node_fs_1.default.readFileSync(angularCliPackagePath, 'utf8'));
|
|
57
|
+
return angularCliPackage.version.split('.')[0];
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
throw new Error('Unable to determine Angular CLI version. Please ensure @angular/cli is installed.');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../../../../../libs/sdk/testing-schematics/src/schematics/testing/scaffold.ts"],"names":[],"mappings":";;AAWA,sCAuBC;AAKD,8CA0CC;AAMD,wDAeC;;AAjGD,8DAAyB;AACzB,6CAA4C;AAE5C;;GAEG;AACI,KAAK,UAAU,aAAa,CACjC,MAA2B,EAC3B,UAGC;IAED,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAC5C,qBAAqB,EACrB,QAAQ,EACR;QACE,SAAS,EAAE,GAAG;QACd,IAAI,EAAE,UAAU,CAAC,WAAW;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,sBAAsB,EAAE;QACjC,QAAQ,EAAE,KAAK;QACf,GAAG,UAAU,CAAC,OAAO;KACtB,CACF,CAAC;IAEF,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,iBAAiB,CACrC,MAA2B,EAC3B,UAGC;IAED,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,oBAAoB,CACrD,qBAAqB,EACrB,QAAQ,EACR;QACE,SAAS,EAAE,GAAG;QACd,IAAI,EAAE,GAAG,UAAU,CAAC,WAAW,YAAY;QAC3C,iBAAiB,EAAE,KAAK;QACxB,MAAM,EAAE,IAAI;QACZ,OAAO,EAAE,sBAAsB,EAAE;QACjC,QAAQ,EAAE,KAAK;QACf,GAAG,UAAU,CAAC,OAAO;KACtB,CACF,CAAC;IAEF,MAAM,MAAM,CAAC,oBAAoB,CAC/B,qBAAqB,EACrB,SAAS,EACT;QACE,IAAI,EAAE,UAAU,CAAC,WAAW;KAC7B,EACD,aAAa,CACd,CAAC;IAEF,wDAAwD;IACxD,MAAM,MAAM,CAAC,oBAAoB,CAC/B,qBAAqB,EACrB,aAAa,EACb;QACE,IAAI,EAAE,GAAG,UAAU,CAAC,WAAW,WAAW;QAC1C,QAAQ,EAAE,KAAK;KAChB,EACD,aAAa,CACd,CAAC;IAEF,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB;IACpC,MAAM,OAAO,GAAG,IAAA,2BAAa,EAAC,UAAU,CAAC,CAAC;IAE1C,IAAI,CAAC;QACH,MAAM,qBAAqB,GAAG,OAAO,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;QAC3E,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAClC,iBAAE,CAAC,YAAY,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAC/C,CAAC;QAEF,OAAO,iBAAiB,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;IACJ,CAAC;AACH,CAAC"}
|