Skip to content

Commit

Permalink
Initialize the monaco library
Browse files Browse the repository at this point in the history
The command used for initializing the library:
npx nx g @nrwl/react:library --name=monaco-editor --publishable
--style=scss --setParserOptionsProject --bundler=rollup
--importPath=@jayvee/monaco-editor
  • Loading branch information
MBuchalik committed Dec 14, 2022
1 parent d34ed98 commit e6f9f7d
Show file tree
Hide file tree
Showing 19 changed files with 16,783 additions and 10,294 deletions.
6 changes: 5 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"recommendations": ["nrwl.angular-console", "langium.langium-vscode"]
"recommendations": [
"nrwl.angular-console",
"langium.langium-vscode",
"firsttris.vscode-jest-runner"
]
}
3 changes: 3 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"babelrcRoots": ["*"]
}
12 changes: 12 additions & 0 deletions libs/monaco-editor/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@nrwl/react/babel",
{
"runtime": "automatic",
"useBuiltIns": "usage"
}
]
],
"plugins": []
}
18 changes: 18 additions & 0 deletions libs/monaco-editor/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"extends": ["plugin:@nrwl/nx/react", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
}
]
}
7 changes: 7 additions & 0 deletions libs/monaco-editor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# monaco-editor

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test monaco-editor` to execute the unit tests via [Jest](https://jestjs.io).
11 changes: 11 additions & 0 deletions libs/monaco-editor/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* eslint-disable */
export default {
displayName: 'monaco-editor',
preset: '../../jest.preset.js',
transform: {
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',
'^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nrwl/react/babel'] }],
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
coverageDirectory: '../../coverage/libs/monaco-editor',
};
12 changes: 12 additions & 0 deletions libs/monaco-editor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@jayvee/monaco-editor",
"version": "0.0.1",
"main": "./index.js",
"module": "./index.mjs",
"exports": {
".": {
"import": "./index.mjs",
"require": "./index.js"
}
}
}
43 changes: 43 additions & 0 deletions libs/monaco-editor/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "monaco-editor",
"sourceRoot": "libs/monaco-editor/src",
"projectType": "library",
"tags": [],
"targets": {
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["libs/monaco-editor/**/*.{ts,tsx,js,jsx}"]
}
},
"build": {
"executor": "@nrwl/rollup:rollup",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/libs/monaco-editor",
"tsConfig": "libs/monaco-editor/tsconfig.lib.json",
"project": "libs/monaco-editor/package.json",
"entryFile": "libs/monaco-editor/src/index.ts",
"external": ["react/jsx-runtime"],
"rollupConfig": "@nrwl/react/plugins/bundle-rollup",
"compiler": "babel",
"assets": [
{
"glob": "libs/monaco-editor/README.md",
"input": ".",
"output": "."
}
]
}
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/monaco-editor/jest.config.ts",
"passWithNoTests": true
}
}
}
}
1 change: 1 addition & 0 deletions libs/monaco-editor/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/monaco-editor';
7 changes: 7 additions & 0 deletions libs/monaco-editor/src/lib/monaco-editor.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Replace this with your own classes
*
* e.g.
* .container {
* }
*/
10 changes: 10 additions & 0 deletions libs/monaco-editor/src/lib/monaco-editor.spec.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { render } from '@testing-library/react';

import MonacoEditor from './monaco-editor';

describe('MonacoEditor', () => {
it('should render successfully', () => {
const { baseElement } = render(<MonacoEditor />);
expect(baseElement).toBeTruthy();
});
});
14 changes: 14 additions & 0 deletions libs/monaco-editor/src/lib/monaco-editor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import styles from './monaco-editor.module.scss';

/* eslint-disable-next-line */
export interface MonacoEditorProps {}

export function MonacoEditor(props: MonacoEditorProps) {
return (
<div className={styles['container']}>
<h1>Welcome to MonacoEditor!</h1>
</div>
);
}

export default MonacoEditor;
20 changes: 20 additions & 0 deletions libs/monaco-editor/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"allowJs": false,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"extends": "../../tsconfig.base.json"
}
23 changes: 23 additions & 0 deletions libs/monaco-editor/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"types": ["node"]
},
"files": [
"../../node_modules/@nrwl/react/typings/cssmodule.d.ts",
"../../node_modules/@nrwl/react/typings/image.d.ts"
],
"exclude": [
"jest.config.ts",
"src/**/*.spec.ts",
"src/**/*.test.ts",
"src/**/*.spec.tsx",
"src/**/*.test.tsx",
"src/**/*.spec.js",
"src/**/*.test.js",
"src/**/*.spec.jsx",
"src/**/*.test.jsx"
],
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
}
20 changes: 20 additions & 0 deletions libs/monaco-editor/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"jest.config.ts",
"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"
]
}
11 changes: 9 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,14 @@
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/.eslintrc.json"
],
"sharedGlobals": []
"sharedGlobals": ["{workspaceRoot}/babel.config.json"]
},
"defaultProject": "interpreter"
"defaultProject": "interpreter",
"generators": {
"@nrwl/react": {
"application": {
"babel": true
}
}
}
}
Loading

0 comments on commit e6f9f7d

Please sign in to comment.