@filip.mazev/blocks 1.0.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 +3 -0
- package/fesm2022/filip.mazev-blocks.mjs +12 -0
- package/fesm2022/filip.mazev-blocks.mjs.map +1 -0
- package/package.json +26 -0
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +63 -0
- package/schematics/ng-add/tsconfig.json +13 -0
- package/types/filip.mazev-blocks.d.ts +3 -0
package/README.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from '@filip.mazev/blocks-core';
|
|
2
|
+
export * from '@filip.mazev/modal';
|
|
3
|
+
export * from '@filip.mazev/toastr';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Public API Surface of blocks
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Generated bundle index. Do not edit.
|
|
11
|
+
*/
|
|
12
|
+
//# sourceMappingURL=filip.mazev-blocks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filip.mazev-blocks.mjs","sources":["../../../projects/blocks/src/public-api.ts","../../../projects/blocks/src/filip.mazev-blocks.ts"],"sourcesContent":["/*\n * Public API Surface of blocks\n */\n\nexport * from '@filip.mazev/blocks-core';\nexport * from '@filip.mazev/modal';\nexport * from '@filip.mazev/toastr';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;AAEG;;ACFH;;AAEG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@filip.mazev/blocks",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"schematics": "./schematics/collection.json",
|
|
5
|
+
"peerDependencies": {
|
|
6
|
+
"@angular/core": "^17.0.0",
|
|
7
|
+
"@filip.mazev/blocks-core": "latest",
|
|
8
|
+
"@filip.mazev/modal": "latest",
|
|
9
|
+
"@filip.mazev/toastr": "latest"
|
|
10
|
+
},
|
|
11
|
+
"module": "fesm2022/filip.mazev-blocks.mjs",
|
|
12
|
+
"typings": "types/filip.mazev-blocks.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
"./package.json": {
|
|
15
|
+
"default": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./types/filip.mazev-blocks.d.ts",
|
|
19
|
+
"default": "./fesm2022/filip.mazev-blocks.mjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"tslib": "^2.3.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ngAdd = ngAdd;
|
|
4
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
5
|
+
function ngAdd() {
|
|
6
|
+
return (tree, context) => {
|
|
7
|
+
addDependencies(tree, context);
|
|
8
|
+
injectStyles(tree, context);
|
|
9
|
+
context.addTask(new tasks_1.NodePackageInstallTask());
|
|
10
|
+
return tree;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function addDependencies(tree, context) {
|
|
14
|
+
const packageJsonPath = '/package.json';
|
|
15
|
+
if (!tree.exists(packageJsonPath)) {
|
|
16
|
+
context.logger.warn('Could not find package.json. Skipping dependency injection.');
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const packageJson = JSON.parse(tree.read(packageJsonPath).toString('utf-8'));
|
|
20
|
+
if (!packageJson.dependencies) {
|
|
21
|
+
packageJson.dependencies = {};
|
|
22
|
+
}
|
|
23
|
+
const packages = [
|
|
24
|
+
'@filip.mazev/blocks-core',
|
|
25
|
+
'@filip.mazev/modal',
|
|
26
|
+
'@filip.mazev/toastr'
|
|
27
|
+
];
|
|
28
|
+
packages.forEach(pkg => {
|
|
29
|
+
if (!packageJson.dependencies[pkg]) {
|
|
30
|
+
packageJson.dependencies[pkg] = 'latest';
|
|
31
|
+
context.logger.info(`Added ${pkg} to dependencies.`);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
tree.overwrite(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
35
|
+
}
|
|
36
|
+
function injectStyles(tree, context) {
|
|
37
|
+
const stylePaths = ['/src/styles.scss', '/src/styles.sass'];
|
|
38
|
+
const targetPath = stylePaths.find(p => tree.exists(p));
|
|
39
|
+
if (!targetPath) {
|
|
40
|
+
context.logger.warn('Could not find src/styles.scss. Please configure the Blocks theme manually.');
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const content = tree.read(targetPath).toString('utf-8');
|
|
44
|
+
if (content.includes('@filip.mazev/blocks-core')) {
|
|
45
|
+
context.logger.info('Blocks SCSS configuration already exists. Skipping style injection.');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const blocksThemeSnippet = `
|
|
49
|
+
@use '@filip.mazev/blocks-core/src/lib/styles/index' as *;
|
|
50
|
+
@use '@filip.mazev/modal/lib/styles/index' as modal;
|
|
51
|
+
@use '@filip.mazev/toastr/lib/styles/index' as toastr;
|
|
52
|
+
|
|
53
|
+
@layer base {
|
|
54
|
+
:root {
|
|
55
|
+
@include core-theme($default-light-theme-config);
|
|
56
|
+
@include modal.modal-theme();
|
|
57
|
+
@include toastr.toastr-theme(());
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
`;
|
|
61
|
+
tree.overwrite(targetPath, blocksThemeSnippet + '\n' + content);
|
|
62
|
+
context.logger.info('Successfully injected Blocks theme configuration into styles.scss.');
|
|
63
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "commonjs",
|
|
4
|
+
"target": "esnext",
|
|
5
|
+
"lib": ["esnext", "dom"],
|
|
6
|
+
"moduleResolution": "node",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"declaration": false,
|
|
9
|
+
"noImplicitAny": true
|
|
10
|
+
},
|
|
11
|
+
"include": ["**/*.ts"],
|
|
12
|
+
"exclude": ["node_modules"]
|
|
13
|
+
}
|