Skip to content

Commit 72af140

Browse files
committed
chore(package): enhance package configs and dependencies
Added scripts, metadata, tags, and publish configuration in package.json. Introduced semantic release, husky, and commitlint dependencies. Adjusted imports and error handling with `@ts-expect-error` for better clarity.
1 parent 139f87e commit 72af140

File tree

7 files changed

+70
-29
lines changed

7 files changed

+70
-29
lines changed

libs/nx-angular-mf/eslint.config.cjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ module.exports = [
99
'error',
1010
{
1111
ignoredFiles: ['{projectRoot}/eslint.config.{js,cjs,mjs}'],
12+
ignoredDependencies: [
13+
'@angular-devkit/architect',
14+
'esbuild',
15+
'vite',
16+
'@angular-devkit/core',
17+
'tsconfig-paths',
18+
'parse5',
19+
"tslib"
20+
],
1221
},
1322
],
1423
},

libs/nx-angular-mf/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
"name": "@klerick/nx-angular-mf",
33
"version": "0.0.1",
44
"dependencies": {
5-
"@nx/devkit": "20.3.0",
6-
"tslib": "^2.3.0"
5+
"@jspm/import-map": "^1.1.0",
6+
"enhanced-resolve": "^5.18.0",
7+
"@nx/devkit": ">=20.0.0",
8+
"@angular-devkit/build-angular": ">=19.0.0 <20.0.0",
9+
"@angular/ssr": ">=19.0.0 <20.0.0",
10+
"@angular/build": ">=19.0.0 <20.0.0",
11+
"ts-node": "^10.9.0"
712
},
813
"type": "commonjs",
914
"main": "./src/index.js",

libs/nx-angular-mf/project.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
}
1212
}
1313
},
14-
"tags": [],
1514
"targets": {
1615
"merge-schemes": {
1716
"executor": "nx:run-commands",
@@ -71,5 +70,9 @@
7170
"jestConfig": "libs/nx-angular-mf/jest.config.ts"
7271
}
7372
}
73+
},
74+
"tags": ["type:lib", "lib:nx-angular-mf"],
75+
"publishConfig": {
76+
"access": "public"
7477
}
7578
}

libs/nx-angular-mf/src/builders/build/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function* runBuilder(
5252
moveCustomLoaderPlugin(),
5353
changePathForAngularSsrNode(),
5454
];
55-
// @ts-ignore
55+
// @ts-expect-error it private var
5656
defaultOptions.partialSSRBuild = true;
5757

5858
const extensions = {

libs/nx-angular-mf/src/builders/custom-loader/patch-vite-dev-server.ts

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
1-
import {
2-
// @ts-ignore
3-
createServer as createServerVite,
4-
// @ts-ignore
5-
InlineConfig,
6-
// @ts-ignore
7-
Plugin,
8-
// @ts-ignore
9-
normalizePath as normalizePathVite,
10-
// @ts-ignore
11-
ViteDevServer,
12-
// @ts-ignore
13-
PreviewServer,
14-
// @ts-ignore
15-
ResolvedConfig,
16-
// @ts-ignore
17-
} from 'vite';
1+
// @ts-expect-error fix import
2+
import { createServer as createServerVite, InlineConfig } from 'vite';
3+
// @ts-expect-error fix import
4+
import { Plugin, normalizePath as normalizePathVite, ViteDevServer} from 'vite'
185

196
export const PREF = 'http://';
207
const external = [];
@@ -44,9 +31,6 @@ function customNodeImportPlugin(): Plugin {
4431
return {
4532
enforce: 'pre',
4633
name: 'vite:custom-node-import',
47-
async resolveId(source, importer, options) {},
48-
async configResolved(config: ResolvedConfig) {},
49-
async load(id) {},
5034
async transform(code, id) {
5135
const regex = new RegExp(
5236
`(["'])(${external.join('|').replace('*/main.server.mjs|', '')})\\1`,
@@ -56,9 +40,6 @@ function customNodeImportPlugin(): Plugin {
5640
return `${p1}${PREF}${p2}${p1}`;
5741
});
5842
},
59-
60-
async configureServer(server: ViteDevServer) {},
61-
async configurePreviewServer(server: PreviewServer) {},
6243
};
6344
}
6445

libs/nx-angular-mf/src/builders/helpers/transform-html.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export function addLinkForReload(input: string) {
128128

129129
const document = parse(input);
130130
const bodyNode = findBody(document);
131-
// @ts-ignore
131+
// @ts-expect-error need use dom type in modejs
132132
bodyNode.childNodes.push(...linkDiv.childNodes);
133133
return serialize(document);
134134
}

package.json

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,33 @@
22
"name": "@nx-angular-mf/source",
33
"version": "0.0.0",
44
"license": "MIT",
5-
"scripts": {},
5+
"scripts": {
6+
"prepare": "node ./prepare.js"
7+
},
8+
"contributors": [
9+
{
10+
"email": "klerick666@gmain.com",
11+
"name": "Aleksandr Kharkovey"
12+
}
13+
],
14+
"keywords": [
15+
"angular",
16+
"microfrontend",
17+
"ssr",
18+
"builder",
19+
"native esmodule",
20+
"importmap"
21+
],
22+
"author": "Aleksandr Kharkovey <klerick666@gmain.com>",
23+
"repository": {
24+
"type": "git",
25+
"url": "https://github.com/klerick/nx-angular-mf"
26+
},
27+
"sideEffects": false,
28+
"bugs": {
29+
"url": "https://github.com/klerick/nx-angular-mf/issues"
30+
},
31+
"homepage": "https://github.com/klerick/nx-angular-mf",
632
"private": true,
733
"dependencies": {
834
"@angular/animations": "~19.0.0",
@@ -28,6 +54,8 @@
2854
"@angular/cli": "~19.0.0",
2955
"@angular/compiler-cli": "~19.0.0",
3056
"@angular/language-service": "~19.0.0",
57+
"@commitlint/cli": "^19.6.1",
58+
"@commitlint/config-conventional": "^19.6.0",
3159
"@eslint/js": "^9.8.0",
3260
"@nx/angular": "20.3.0",
3361
"@nx/eslint": "20.3.0",
@@ -38,6 +66,12 @@
3866
"@nx/web": "20.3.0",
3967
"@nx/workspace": "20.3.0",
4068
"@schematics/angular": "~19.0.0",
69+
"@semantic-release/changelog": "^6.0.3",
70+
"@semantic-release/commit-analyzer": "^13.0.0",
71+
"@semantic-release/git": "^10.0.1",
72+
"@semantic-release/github": "^11.0.1",
73+
"@semantic-release/npm": "^12.0.1",
74+
"@semantic-release/release-notes-generator": "^14.0.2",
4175
"@swc-node/register": "~1.9.1",
4276
"@swc/cli": "~0.3.12",
4377
"@swc/core": "~1.5.7",
@@ -49,6 +83,7 @@
4983
"angular-eslint": "^19.0.2",
5084
"eslint": "^9.8.0",
5185
"eslint-config-prettier": "^9.0.0",
86+
"husky": "^8.0.3",
5287
"jest": "^29.7.0",
5388
"jest-environment-jsdom": "^29.7.0",
5489
"jest-preset-angular": "~14.4.0",
@@ -63,5 +98,13 @@
6398
},
6499
"nx": {
65100
"includedScripts": []
101+
},
102+
"overrides": {
103+
"@swc/cli": {
104+
"chokidar": "4.0.0"
105+
},
106+
"@angular/compiler-cli": {
107+
"chokidar": "4.0.0"
108+
}
66109
}
67110
}

0 commit comments

Comments
 (0)