chore: TypeScript 5.1 with Nx 16.6 migrations (#10338)

This commit is contained in:
Nathan Walker
2023-08-11 07:09:32 -07:00
committed by GitHub
parent 7a353eca14
commit d3a0f2c9a6
61 changed files with 741 additions and 483 deletions

View File

@@ -0,0 +1,32 @@
{
"extends": ["../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.ts", "*.tsx"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
},
{
"files": ["./package.json", "./generators.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/nx-plugin-checks": "error"
}
}
]
}

View File

@@ -0,0 +1,9 @@
{
"generators": {
"app": {
"implementation": "./src/generators/app",
"schema": "./src/generators/app/schema.json",
"description": "Generator app"
}
}
}

View File

@@ -0,0 +1,10 @@
/* eslint-disable */
export default {
displayName: 'workspace-plugin',
preset: '../../jest.preset.js',
transform: {
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/tools/workspace-plugin',
};

View File

@@ -0,0 +1,11 @@
{
"name": "@nativescript/workspace-plugin",
"version": "0.0.1",
"dependencies": {
"tslib": "^2.3.0"
},
"type": "commonjs",
"main": "./src/index.js",
"typings": "./src/index.d.ts",
"generators": "./generators.json"
}

View File

@@ -0,0 +1,61 @@
{
"name": "workspace-plugin",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "tools/workspace-plugin/src",
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/tools/workspace-plugin",
"main": "tools/workspace-plugin/src/index.ts",
"tsConfig": "tools/workspace-plugin/tsconfig.lib.json",
"assets": [
{
"input": "./tools/workspace-plugin/src",
"glob": "**/!(*.ts)",
"output": "./src"
},
{
"input": "./tools/workspace-plugin/src",
"glob": "**/*.d.ts",
"output": "./src"
},
{
"input": "./tools/workspace-plugin",
"glob": "generators.json",
"output": "."
},
{
"input": "./tools/workspace-plugin",
"glob": "executors.json",
"output": "."
}
]
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["tools/workspace-plugin/**/*.ts", "tools/workspace-plugin/package.json", "tools/workspace-plugin/generators.json"]
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "tools/workspace-plugin/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
}
},
"tags": []
}

View File

@@ -0,0 +1,9 @@
import { chain, externalSchematic, Rule } from '@angular-devkit/schematics';
export default function (schema: any): Rule {
return chain([
externalSchematic('@nx/workspace', 'lib', {
name: schema.name,
}),
]);
}

View File

@@ -0,0 +1,16 @@
{
"$schema": "http://json-schema.org/schema",
"id": "app",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Library name",
"$default": {
"$source": "argv",
"index": 0
}
}
},
"required": ["name"]
}

View File

View File

@@ -0,0 +1,16 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs"
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}

View File

@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
}

View File

@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
}