mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: TypeScript 5.1 with Nx 16.6 migrations (#10338)
This commit is contained in:
32
tools/workspace-plugin/.eslintrc.json
Normal file
32
tools/workspace-plugin/.eslintrc.json
Normal 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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
9
tools/workspace-plugin/generators.json
Normal file
9
tools/workspace-plugin/generators.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"generators": {
|
||||
"app": {
|
||||
"implementation": "./src/generators/app",
|
||||
"schema": "./src/generators/app/schema.json",
|
||||
"description": "Generator app"
|
||||
}
|
||||
}
|
||||
}
|
||||
10
tools/workspace-plugin/jest.config.ts
Normal file
10
tools/workspace-plugin/jest.config.ts
Normal 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',
|
||||
};
|
||||
11
tools/workspace-plugin/package.json
Normal file
11
tools/workspace-plugin/package.json
Normal 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"
|
||||
}
|
||||
61
tools/workspace-plugin/project.json
Normal file
61
tools/workspace-plugin/project.json
Normal 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": []
|
||||
}
|
||||
9
tools/workspace-plugin/src/generators/app/index.ts
Normal file
9
tools/workspace-plugin/src/generators/app/index.ts
Normal 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,
|
||||
}),
|
||||
]);
|
||||
}
|
||||
16
tools/workspace-plugin/src/generators/app/schema.json
Normal file
16
tools/workspace-plugin/src/generators/app/schema.json
Normal 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"]
|
||||
}
|
||||
0
tools/workspace-plugin/src/index.ts
Normal file
0
tools/workspace-plugin/src/index.ts
Normal file
16
tools/workspace-plugin/tsconfig.json
Normal file
16
tools/workspace-plugin/tsconfig.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs"
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.spec.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
10
tools/workspace-plugin/tsconfig.lib.json
Normal file
10
tools/workspace-plugin/tsconfig.lib.json
Normal 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"]
|
||||
}
|
||||
9
tools/workspace-plugin/tsconfig.spec.json
Normal file
9
tools/workspace-plugin/tsconfig.spec.json
Normal 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"]
|
||||
}
|
||||
Reference in New Issue
Block a user