mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	chore(nx): create project for codemirror
This commit is contained in:
		
							
								
								
									
										7
									
								
								packages/codemirror/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								packages/codemirror/README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,7 @@ | |||||||
|  | # codemirror | ||||||
|  |  | ||||||
|  | This library was generated with [Nx](https://nx.dev). | ||||||
|  |  | ||||||
|  | ## Building | ||||||
|  |  | ||||||
|  | Run `nx build codemirror` to build the library. | ||||||
							
								
								
									
										24
									
								
								packages/codemirror/eslint.config.mjs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								packages/codemirror/eslint.config.mjs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,24 @@ | |||||||
|  | import baseConfig from "../../eslint.config.mjs"; | ||||||
|  |  | ||||||
|  | export default [ | ||||||
|  |     ...baseConfig, | ||||||
|  |     { | ||||||
|  |       "files": [ | ||||||
|  |         "**/*.json" | ||||||
|  |       ], | ||||||
|  |       "rules": { | ||||||
|  |         "@nx/dependency-checks": [ | ||||||
|  |           "error", | ||||||
|  |           { | ||||||
|  |             "ignoredFiles": [ | ||||||
|  |               "{projectRoot}/eslint.config.{js,cjs,mjs}", | ||||||
|  |               "{projectRoot}/vite.config.{js,ts,mjs,mts}" | ||||||
|  |             ] | ||||||
|  |           } | ||||||
|  |         ] | ||||||
|  |       }, | ||||||
|  |       "languageOptions": { | ||||||
|  |         "parser": (await import('jsonc-eslint-parser')) | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  | ]; | ||||||
							
								
								
									
										22
									
								
								packages/codemirror/package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								packages/codemirror/package.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,22 @@ | |||||||
|  | { | ||||||
|  |   "name": "@triliumnext/codemirror", | ||||||
|  |   "version": "0.0.1", | ||||||
|  |   "private": true, | ||||||
|  |   "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" | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   "nx": { | ||||||
|  |     "name": "codemirror" | ||||||
|  |   }, | ||||||
|  |   "dependencies": {} | ||||||
|  | } | ||||||
							
								
								
									
										1
									
								
								packages/codemirror/src/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								packages/codemirror/src/index.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | |||||||
|  | export * from './lib/codemirror.js'; | ||||||
							
								
								
									
										3
									
								
								packages/codemirror/src/lib/codemirror.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								packages/codemirror/src/lib/codemirror.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | export function codemirror(): string { | ||||||
|  |   return 'codemirror'; | ||||||
|  | } | ||||||
							
								
								
									
										10
									
								
								packages/codemirror/tsconfig.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								packages/codemirror/tsconfig.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | |||||||
|  | { | ||||||
|  |   "extends": "../../tsconfig.base.json", | ||||||
|  |   "files": [], | ||||||
|  |   "include": [], | ||||||
|  |   "references": [ | ||||||
|  |     { | ||||||
|  |       "path": "./tsconfig.lib.json" | ||||||
|  |     } | ||||||
|  |   ] | ||||||
|  | } | ||||||
							
								
								
									
										21
									
								
								packages/codemirror/tsconfig.lib.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								packages/codemirror/tsconfig.lib.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | { | ||||||
|  |   "extends": "../../tsconfig.base.json", | ||||||
|  |   "compilerOptions": { | ||||||
|  |     "baseUrl": ".", | ||||||
|  |     "rootDir": "src", | ||||||
|  |     "outDir": "dist", | ||||||
|  |     "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo", | ||||||
|  |     "emitDeclarationOnly": true, | ||||||
|  |     "forceConsistentCasingInFileNames": true, | ||||||
|  |     "noImplicitOverride": true, | ||||||
|  |     "noImplicitReturns": true, | ||||||
|  |     "types": [ | ||||||
|  |       "node", | ||||||
|  |       "vite/client" | ||||||
|  |     ] | ||||||
|  |   }, | ||||||
|  |   "include": [ | ||||||
|  |     "src/**/*.ts" | ||||||
|  |   ], | ||||||
|  |   "references": [] | ||||||
|  | } | ||||||
							
								
								
									
										37
									
								
								packages/codemirror/vite.config.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								packages/codemirror/vite.config.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,37 @@ | |||||||
|  | /// <reference types='vitest' /> | ||||||
|  | import { defineConfig } from 'vite'; | ||||||
|  | import dts from 'vite-plugin-dts'; | ||||||
|  | import * as path from 'path'; | ||||||
|  |  | ||||||
|  | export default defineConfig(() => ({ | ||||||
|  |   root: __dirname, | ||||||
|  |   cacheDir: '../../node_modules/.vite/packages/codemirror', | ||||||
|  |   plugins: [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: 'codemirror', | ||||||
|  |       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: [] | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  | })); | ||||||
							
								
								
									
										2
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							| @@ -1149,6 +1149,8 @@ importers: | |||||||
|         specifier: ^9.0.7 |         specifier: ^9.0.7 | ||||||
|         version: 9.12.7(bufferutil@4.0.9)(utf-8-validate@6.0.5) |         version: 9.12.7(bufferutil@4.0.9)(utf-8-validate@6.0.5) | ||||||
| 
 | 
 | ||||||
|  |   packages/codemirror: {} | ||||||
|  | 
 | ||||||
|   packages/commons: |   packages/commons: | ||||||
|     dependencies: |     dependencies: | ||||||
|       '@swc/helpers': |       '@swc/helpers': | ||||||
|   | |||||||
| @@ -50,6 +50,9 @@ | |||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|       "path": "./packages/ckeditor5-math" |       "path": "./packages/ckeditor5-math" | ||||||
|  |     }, | ||||||
|  |     { | ||||||
|  |       "path": "./packages/codemirror" | ||||||
|     } |     } | ||||||
|   ] |   ] | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user