Skip to content

Commit bf2411b

Browse files
committed
feature: setup remote with module-federation
1 parent 9b2d0fd commit bf2411b

26 files changed

Lines changed: 8412 additions & 0 deletions

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
actions: read
11+
contents: read
12+
13+
jobs:
14+
main:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
filter: tree:0
20+
fetch-depth: 0
21+
22+
# This enables task distribution via Nx Cloud
23+
# Run this command as early as possible, before dependencies are installed
24+
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
25+
# Uncomment this line to enable task distribution
26+
# - run: npx nx start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build"
27+
28+
# Cache node_modules
29+
- uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
cache: 'npm'
33+
34+
- run: npm ci
35+
36+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
37+
# - run: npx nx-cloud record -- echo Hello World
38+
- run: npx nx run-many -t lint test build typecheck
39+
# Nx Cloud recommends fixes for failures to help you get CI green faster. Learn more: https://nx.dev/ci/features/self-healing-ci
40+
- run: npx nx fix-ci
41+
if: always()

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# compiled output
4+
dist
5+
tmp
6+
out-tsc
7+
8+
# dependencies
9+
node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db
40+
41+
.nx/cache
42+
.nx/workspace-data
43+
.cursor/rules/nx-rules.mdc
44+
.github/instructions/nx.instructions.md
45+
46+
vite.config.*.timestamp*
47+
vitest.config.*.timestamp*

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache
5+
/.nx/workspace-data

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.vscode/extensions.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"nrwl.angular-console",
4+
"esbenp.prettier-vscode",
5+
"dbaeumer.vscode-eslint"
6+
]
7+
}

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
# linid-im-front-community-plugins
22

3+
To build catalog-ui:
4+
npx vite build --config apps/catalog-ui/vite.config.ts
5+
6+
to run locally:
7+
nx run catalog-ui:preview
8+

apps/catalog-ui/eslint.config.mjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import vue from 'eslint-plugin-vue';
2+
import baseConfig from '../../eslint.config.mjs';
3+
4+
export default [
5+
...baseConfig,
6+
...vue.configs['flat/recommended'],
7+
{
8+
files: ['**/*.vue'],
9+
languageOptions: {
10+
parserOptions: {
11+
parser: await import('@typescript-eslint/parser'),
12+
},
13+
},
14+
},
15+
{
16+
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx', '**/*.vue'],
17+
rules: {
18+
'vue/multi-word-component-names': 'off',
19+
},
20+
},
21+
];

apps/catalog-ui/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@linid-im-front-community-plugins/catalog-ui",
3+
"version": "0.0.1",
4+
"private": true,
5+
"devDependencies": {
6+
"@originjs/vite-plugin-federation": "^1.4.1"
7+
},
8+
"peerDependencies": {
9+
"@linagora/linid-im-front-corelib": "file:../../../linid-im-front-corelib/dist",
10+
"quasar": "^2.16.0"
11+
}
12+
}

apps/catalog-ui/project.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
3+
"name": "catalog-ui",
4+
"sourceRoot": "apps/catalog-ui/src",
5+
"projectType": "library",
6+
"targets": {
7+
"serve": {
8+
"executor": "nx:run-commands",
9+
"options": {
10+
"command": "vite --config apps/catalog-ui/vite.config.ts",
11+
"cwd": ".",
12+
"parallel": false
13+
}
14+
},
15+
"build": {
16+
"executor": "@nx/vite:build",
17+
"outputs": ["{workspaceRoot}/dist/apps/catalog-ui"],
18+
"options": {
19+
"outputPath": "dist/apps/catalog-ui",
20+
"configFile": "apps/catalog-ui/vite.config.ts"
21+
}
22+
},
23+
24+
"preview": {
25+
"executor": "nx:run-commands",
26+
"options": {
27+
"command": "vite preview --port 5001 --config apps/catalog-ui/vite.config.ts"
28+
}
29+
}
30+
},
31+
"tags": []
32+
}

0 commit comments

Comments
 (0)