safn bætt!
This commit is contained in:
parent
ee77700c5e
commit
088a84d78e
@ -1,5 +1,5 @@
|
||||
import { createFileRoute } from '@tanstack/react-router'
|
||||
|
||||
import {Lib} from '@menntalind-framendi/lib'
|
||||
export const Route = createFileRoute('/')({
|
||||
component: Index,
|
||||
})
|
||||
@ -8,6 +8,7 @@ function Index() {
|
||||
return (
|
||||
<div className="p-2">
|
||||
<h3>Welcome Home!</h3>
|
||||
<Lib />
|
||||
</div>
|
||||
)
|
||||
}
|
@ -32,5 +32,10 @@
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.mjs"
|
||||
],
|
||||
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
|
||||
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../lib/tsconfig.lib.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -2,6 +2,9 @@
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "../../lib"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.app.json"
|
||||
},
|
||||
|
12
lib/.babelrc
Normal file
12
lib/.babelrc
Normal file
@ -0,0 +1,12 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@nx/react/babel",
|
||||
{
|
||||
"runtime": "automatic",
|
||||
"useBuiltIns": "usage"
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": []
|
||||
}
|
7
lib/README.md
Normal file
7
lib/README.md
Normal file
@ -0,0 +1,7 @@
|
||||
# @menntalind-framendi/lib
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Running unit tests
|
||||
|
||||
Run `nx test @menntalind-framendi/lib` to execute the unit tests via [Vitest](https://vitest.dev/).
|
12
lib/eslint.config.mjs
Normal file
12
lib/eslint.config.mjs
Normal file
@ -0,0 +1,12 @@
|
||||
import nx from '@nx/eslint-plugin';
|
||||
import baseConfig from '../eslint.config.mjs';
|
||||
|
||||
export default [
|
||||
...baseConfig,
|
||||
...nx.configs['flat/react'],
|
||||
{
|
||||
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
|
||||
// Override or add rules here
|
||||
rules: {},
|
||||
},
|
||||
];
|
17
lib/package.json
Normal file
17
lib/package.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "@menntalind-framendi/lib",
|
||||
"version": "0.0.1",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"development": "./src/index.ts",
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js",
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
}
|
||||
}
|
1
lib/src/index.ts
Normal file
1
lib/src/index.ts
Normal file
@ -0,0 +1 @@
|
||||
export * from './lib/lib';
|
7
lib/src/lib/lib.module.scss
Normal file
7
lib/src/lib/lib.module.scss
Normal file
@ -0,0 +1,7 @@
|
||||
/*
|
||||
* Replace this with your own classes
|
||||
*
|
||||
* e.g.
|
||||
* .container {
|
||||
* }
|
||||
*/
|
10
lib/src/lib/lib.spec.tsx
Normal file
10
lib/src/lib/lib.spec.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
import { render } from '@testing-library/react';
|
||||
|
||||
import Lib from './lib';
|
||||
|
||||
describe('Lib', () => {
|
||||
it('should render successfully', () => {
|
||||
const { baseElement } = render(<Lib />);
|
||||
expect(baseElement).toBeTruthy();
|
||||
});
|
||||
});
|
11
lib/src/lib/lib.tsx
Normal file
11
lib/src/lib/lib.tsx
Normal file
@ -0,0 +1,11 @@
|
||||
import styles from './lib.module.scss';
|
||||
|
||||
export function Lib() {
|
||||
return (
|
||||
<div className={styles['container']}>
|
||||
<h1>Welcome to Lib!</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Lib;
|
13
lib/tsconfig.json
Normal file
13
lib/tsconfig.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
}
|
||||
],
|
||||
"extends": "../tsconfig.base.json"
|
||||
}
|
43
lib/tsconfig.lib.json
Normal file
43
lib/tsconfig.lib.json
Normal file
@ -0,0 +1,43 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"types": [
|
||||
"node",
|
||||
"@nx/react/typings/cssmodule.d.ts",
|
||||
"@nx/react/typings/image.d.ts",
|
||||
"vite/client"
|
||||
],
|
||||
"rootDir": "src",
|
||||
"jsx": "react-jsx",
|
||||
"tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo"
|
||||
},
|
||||
"exclude": [
|
||||
"out-tsc",
|
||||
"dist",
|
||||
"**/*.spec.ts",
|
||||
"**/*.test.ts",
|
||||
"**/*.spec.tsx",
|
||||
"**/*.test.tsx",
|
||||
"**/*.spec.js",
|
||||
"**/*.test.js",
|
||||
"**/*.spec.jsx",
|
||||
"**/*.test.jsx",
|
||||
"vite.config.ts",
|
||||
"vite.config.mts",
|
||||
"vitest.config.ts",
|
||||
"vitest.config.mts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.test.tsx",
|
||||
"src/**/*.spec.tsx",
|
||||
"src/**/*.test.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.test.jsx",
|
||||
"src/**/*.spec.jsx",
|
||||
"eslint.config.js",
|
||||
"eslint.config.cjs",
|
||||
"eslint.config.mjs"
|
||||
],
|
||||
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
|
||||
}
|
34
lib/tsconfig.spec.json
Normal file
34
lib/tsconfig.spec.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./out-tsc/vitest",
|
||||
"types": [
|
||||
"vitest/globals",
|
||||
"vitest/importMeta",
|
||||
"vite/client",
|
||||
"node",
|
||||
"vitest"
|
||||
],
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": [
|
||||
"vite.config.ts",
|
||||
"vite.config.mts",
|
||||
"vitest.config.ts",
|
||||
"vitest.config.mts",
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.spec.ts",
|
||||
"src/**/*.test.tsx",
|
||||
"src/**/*.spec.tsx",
|
||||
"src/**/*.test.js",
|
||||
"src/**/*.spec.js",
|
||||
"src/**/*.test.jsx",
|
||||
"src/**/*.spec.jsx",
|
||||
"src/**/*.d.ts"
|
||||
],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
}
|
||||
]
|
||||
}
|
55
lib/vite.config.ts
Normal file
55
lib/vite.config.ts
Normal file
@ -0,0 +1,55 @@
|
||||
/// <reference types='vitest' />
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import dts from 'vite-plugin-dts';
|
||||
import * as path from 'path';
|
||||
|
||||
export default defineConfig(() => ({
|
||||
root: __dirname,
|
||||
cacheDir: '../node_modules/.vite/lib',
|
||||
plugins: [
|
||||
react(),
|
||||
dts({
|
||||
entryRoot: 'src',
|
||||
tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
|
||||
}),
|
||||
],
|
||||
// Uncomment this if you are using workers.
|
||||
// worker: {
|
||||
// plugins: [ nxViteTsPaths() ],
|
||||
// },
|
||||
// Configuration for building your library.
|
||||
// See: https://vitejs.dev/guide/build.html#library-mode
|
||||
build: {
|
||||
outDir: './dist',
|
||||
emptyOutDir: true,
|
||||
reportCompressedSize: true,
|
||||
commonjsOptions: {
|
||||
transformMixedEsModules: true,
|
||||
},
|
||||
lib: {
|
||||
// Could also be a dictionary or array of multiple entry points.
|
||||
entry: 'src/index.ts',
|
||||
name: '@menntalind-framendi/lib',
|
||||
fileName: 'index',
|
||||
// Change this to the formats you want to support.
|
||||
// Don't forget to update your package.json as well.
|
||||
formats: ['es' as const],
|
||||
},
|
||||
rollupOptions: {
|
||||
// External packages that should not be bundled into your library.
|
||||
external: ['react', 'react-dom', 'react/jsx-runtime'],
|
||||
},
|
||||
},
|
||||
test: {
|
||||
watch: false,
|
||||
globals: true,
|
||||
environment: 'jsdom',
|
||||
include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
||||
reporters: ['default'],
|
||||
coverage: {
|
||||
reportsDirectory: './test-output/vitest/coverage',
|
||||
provider: 'v8' as const,
|
||||
},
|
||||
},
|
||||
}));
|
3
nx.json
3
nx.json
@ -89,7 +89,8 @@
|
||||
},
|
||||
"library": {
|
||||
"style": "scss",
|
||||
"linter": "eslint"
|
||||
"linter": "eslint",
|
||||
"unitTestRunner": "vitest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
903
package-lock.json
generated
903
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -11,6 +11,8 @@
|
||||
"react-dom": "19.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.5",
|
||||
"@babel/preset-react": "^7.14.5",
|
||||
"@eslint/js": "^9.8.0",
|
||||
"@nx/cypress": "21.0.3",
|
||||
"@nx/eslint": "21.0.3",
|
||||
@ -50,9 +52,11 @@
|
||||
"typescript": "~5.7.2",
|
||||
"typescript-eslint": "^8.19.0",
|
||||
"vite": "^6.0.0",
|
||||
"vite-plugin-dts": "~4.5.0",
|
||||
"vitest": "^3.0.0"
|
||||
},
|
||||
"workspaces": [
|
||||
"apps/*"
|
||||
"apps/*",
|
||||
"lib"
|
||||
]
|
||||
}
|
||||
|
@ -8,6 +8,9 @@
|
||||
},
|
||||
{
|
||||
"path": "./apps/menntalind"
|
||||
},
|
||||
{
|
||||
"path": "./lib"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user