This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
"use strict";
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular/cdk/schematics");
const schematics_2 = require("@angular-devkit/schematics");
const utility_1 = require("@schematics/angular/utility");
const fs_1 = require("fs");
const bootPageHTML = `<!-- NG-ZORRO -->
<a href="https://github.com/NG-ZORRO/ng-zorro-antd" target="_blank" style="display: flex;align-items: center;justify-content: center;height: 100%;width: 100%;">
<img height="300" alt="logo" src="https://img.alicdn.com/tfs/TB1X.qJJgHqK1RjSZFgXXa7JXXa-89-131.svg">
</a>`;
function default_1(options) {
return (host, context) => __awaiter(this, void 0, void 0, function* () {
const workspace = yield (0, utility_1.readWorkspace)(host);
const project = (0, schematics_1.getProjectFromWorkspace)(workspace, options.project);
const appHTMLFile = `${project.sourceRoot}/app/app.html`;
const buffer = host.read(appHTMLFile);
if (!buffer) {
context.logger.error(`Could not find the project ${appHTMLFile} file inside of the ` + `workspace config`);
return (0, schematics_2.noop)();
}
if ((0, fs_1.existsSync)(appHTMLFile)) {
const stat = (0, fs_1.statSync)(appHTMLFile);
if (stat.mtimeMs === stat.ctimeMs) {
host.overwrite(appHTMLFile, bootPageHTML);
}
}
else {
host.overwrite(appHTMLFile, bootPageHTML);
}
return (0, schematics_2.noop)();
});
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/ng-generate/blank/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;AAiBH,4BAwBC;AAvCD,wDAAkE;AAGlE,2DAA8D;AAC9D,yDAA4D;AAE5D,2BAA0C;AAI1C,MAAM,YAAY,GAAG;;;KAGhB,CAAC;AAEN,mBAAwB,OAAe;IACrC,OAAO,CAAO,IAAU,EAAE,OAAO,EAAE,EAAE;QACnC,MAAM,SAAS,GAAG,MAAM,IAAA,uBAAa,EAAC,IAAI,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,IAAA,oCAAuB,EAAC,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACpE,MAAM,WAAW,GAAG,GAAG,OAAO,CAAC,UAAU,eAAe,CAAC;QACzD,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEtC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,8BAA8B,WAAW,sBAAsB,GAAG,kBAAkB,CACrF,CAAC;YACF,OAAO,IAAA,iBAAI,GAAE,CAAC;QAChB,CAAC;QACD,IAAI,IAAA,eAAU,EAAC,WAAW,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,GAAG,IAAA,aAAQ,EAAC,WAAW,CAAC,CAAC;YACnC,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,OAAO,EAAE,CAAC;gBAClC,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,IAAA,iBAAI,GAAE,CAAC;IAChB,CAAC,CAAA,CAAC;AACJ,CAAC"}

View File

@@ -0,0 +1,38 @@
"use strict";
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const testing_1 = require("@angular-devkit/schematics/testing");
const test_app_1 = require("../../testing/test-app");
describe('[schematic] ng-generate', () => {
const defaultOptions = {
project: 'ng-zorro',
};
let runner;
let appTree;
beforeEach(() => __awaiter(void 0, void 0, void 0, function* () {
runner = new testing_1.SchematicTestRunner('schematics', require.resolve('../../collection.json'));
appTree = yield (0, test_app_1.createTestApp)(runner);
}));
it('should update app.html', () => __awaiter(void 0, void 0, void 0, function* () {
const options = Object.assign({}, defaultOptions);
const appComponentHTMLPath = '/projects/ng-zorro/src/app/app.html';
const tree = yield runner.runSchematic('blank', options, appTree);
const appComponentHTML = tree.readContent(appComponentHTMLPath);
const files = tree.files;
expect(files).toEqual(jasmine.arrayContaining([appComponentHTMLPath]));
expect(appComponentHTML).toContain('href="https://github.com/NG-ZORRO/ng-zorro-antd"');
}));
});
//# sourceMappingURL=index.spec.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.spec.js","sourceRoot":"","sources":["../../../../schematics/ng-generate/blank/index.spec.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;AAGH,gEAAyE;AAGzE,qDAAuD;AAEvD,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,MAAM,cAAc,GAAc;QAChC,OAAO,EAAE,UAAU;KACpB,CAAC;IACF,IAAI,MAA2B,CAAC;IAChC,IAAI,OAAa,CAAC;IAElB,UAAU,CAAC,GAAS,EAAE;QACpB,MAAM,GAAG,IAAI,6BAAmB,CAAC,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC;QACzF,OAAO,GAAG,MAAM,IAAA,wBAAa,EAAC,MAAM,CAAC,CAAC;IACxC,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,GAAS,EAAE;QACtC,MAAM,OAAO,qBAAO,cAAc,CAAC,CAAC;QACpC,MAAM,oBAAoB,GAAG,qCAAqC,CAAC;QACnE,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAClE,MAAM,gBAAgB,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QAChE,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QAEzB,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAE,oBAAoB,CAAE,CAAC,CAAC,CAAC;QACzE,MAAM,CAAC,gBAAgB,CAAC,CAAC,SAAS,CAAC,kDAAkD,CAAC,CAAC;IACzF,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,7 @@
"use strict";
/**
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/ng-generate/blank/schema.ts"],"names":[],"mappings":";AAAA;;;GAGG"}

View File

@@ -0,0 +1,16 @@
{
"$schema": "http://json-schema.org/schema",
"$id": "nz-ng-generate-boot",
"title": "Ant Design of Angular(NG-ZORRO) boot page schematic",
"type": "object",
"properties": {
"project": {
"type": "string",
"description": "Name of the project.",
"$default": {
"$source": "projectName"
}
}
},
"required": []
}