Skip to content

Commit

Permalink
build(nx): setup initial workspace & packages
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sa committed Sep 10, 2023
1 parent 727afc4 commit b6f7742
Show file tree
Hide file tree
Showing 170 changed files with 12,640 additions and 18,565 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
dist
187 changes: 187 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nx", "import", "@angular-eslint/eslint-plugin"],
"overrides": [
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
},
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nx/typescript"],
"rules": {
"@typescript-eslint/typedef": ["error"],
"@angular-eslint/component-class-suffix": "error",
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"@angular-eslint/directive-class-suffix": "error",
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@angular-eslint/no-input-rename": "error",
"@angular-eslint/no-output-on-prefix": "error",
"@angular-eslint/no-output-rename": "error",
"@angular-eslint/use-pipe-transform-interface": "error",
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"@typescript-eslint/indent": "error",
"@typescript-eslint/member-delimiter-style": [
"error",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": false
}
}
],
"@typescript-eslint/member-ordering": "error",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "variable",
"format": [
"camelCase",
"UPPER_CASE"
],
"leadingUnderscore": "forbid",
"trailingUnderscore": "forbid"
}
],
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-non-null-assertion": "error",
"@typescript-eslint/no-shadow": [
"error",
{
"hoist": "all"
}
],
"@typescript-eslint/no-unused-expressions": "off",
"@typescript-eslint/no-use-before-define": "error",
"@typescript-eslint/prefer-function-type": "error",
"@typescript-eslint/quotes": [
"error",
"single"
],
"@typescript-eslint/semi": [
"error",
"always"
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
"brace-style": [
"error",
"1tbs"
],
"constructor-super": "error",
"curly": "off",
"dot-notation": "off",
"eol-last": "error",
"eqeqeq": [
"error",
"smart"
],
"guard-for-in": "error",
"id-denylist": "off",
"id-match": "off",
"import/no-deprecated": "warn",
"indent": "off",
"max-len": [
"error",
{
"code": 180
}
],
"no-bitwise": "error",
"no-caller": "error",
"no-console": "off",
"no-debugger": "error",
"no-empty": "off",
"no-empty-function": "off",
"no-eval": "error",
"no-fallthrough": "error",
"no-new-wrappers": "error",
"no-shadow": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "off",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unused-expressions": "off",
"no-unused-labels": "error",
"no-use-before-define": "off",
"no-var": "error",
"prefer-const": "error",
"quotes": "off",
"radix": "error",
"semi": "off",
"@typescript-eslint/tslint/config": [
"error",
{
"rules": {
"use-host-property-decorator": true,
"use-input-property-decorator": true,
"use-life-cycle-interface": true,
"use-output-property-decorator": true
}
}
]
}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
}
]
}
8 changes: 3 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@ node_modules
.idea
docs
coverage
dist
packages/node
packages/network
packages/*/dist/*
!packages/*/dist/esm/package.json
!packages/*/dist/.gitkeep
packages/benchmark/src/orm/end-to-end/sqlite/prisma.sqlite
packages/benchmark/src/orm/end-to-end/sqlite/prisma.sqlite-journal
packages/benchmark/results
packages/example-app/var/debug
packages/example-app/migrations
examples/example-app/var/debug
examples/example-app/migrations
packages/create-app/files/dist
packages/create-app/files/var
.vs
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Add files here to ignore them from prettier formatting
/dist
/coverage
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"trailingComma": "all",
"bracketSpacing": true,
"tabWidth": 4,
"singleQuote": true,
"arrowParens": "avoid",
"endOfLine": "lf"
}
11 changes: 5 additions & 6 deletions install-compiler.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

set -e;

tsc --build packages/type-compiler/tsconfig.json;
node packages/type-compiler/dist/cjs/install-transformer.js;
NODE_ENV=development nx build type-compiler
node dist/packages/type-compiler/install-transformer.cjs.js


node packages/type-compiler/dist/cjs/install-transformer.js packages/api-console-gui;
node packages/type-compiler/dist/cjs/install-transformer.js packages/orm-browser-gui;
node packages/type-compiler/dist/cjs/install-transformer.js packages/framework-debug-gui;
#node dist/packages/type-compiler/install-transformer.js packages/api-console-gui;
#node dist/packages/type-compiler/install-transformer.js packages/orm-browser-gui;
#node dist/packages/type-compiler/install-transformer.js packages/framework-debug-gui;
48 changes: 0 additions & 48 deletions jest-resolver.js

This file was deleted.

10 changes: 0 additions & 10 deletions jest-serial-runner.js

This file was deleted.

5 changes: 5 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { getJestProjects } from '@nx/jest';

export default {
projects: getJestProjects(),
};
3 changes: 3 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const nxPreset = require('@nx/jest/preset').default;

module.exports = { ...nxPreset };
6 changes: 0 additions & 6 deletions lerna.json

This file was deleted.

46 changes: 46 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"],
"inputs": ["production", "^production"]
},
"test": {
"inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"]
},
"lint": {
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.json",
"{workspaceRoot}/.eslintignore"
]
}
},
"namedInputs": {
"default": ["{projectRoot}/**/*", "sharedGlobals"],
"production": [
"default",
"!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
"!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/src/test-setup.[jt]s",
"!{projectRoot}/test-setup.[jt]s",
"!{projectRoot}/.eslintrc.json"
],
"sharedGlobals": [
{ "env": "NODE_ENV" }
]
},
"workspaceLayout": {
"appsDir": "examples",
"libsDir": "packages"
}
}
Loading

0 comments on commit b6f7742

Please sign in to comment.