From 34f4e83581bb703207cfb866e458c1f3d2ed4b51 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Tue, 25 May 2021 17:45:15 -0700 Subject: [PATCH] Add heft-fastify-test project --- build-tests/heft-fastify-test/.eslintrc.js | 7 +++ build-tests/heft-fastify-test/README.md | 3 ++ .../heft-fastify-test/config/heft.json | 51 +++++++++++++++++++ .../config/rush-project.json | 3 ++ build-tests/heft-fastify-test/package.json | 19 +++++++ build-tests/heft-fastify-test/src/start.ts | 4 ++ build-tests/heft-fastify-test/tsconfig.json | 25 +++++++++ rush.json | 6 +++ 8 files changed, 118 insertions(+) create mode 100644 build-tests/heft-fastify-test/.eslintrc.js create mode 100644 build-tests/heft-fastify-test/README.md create mode 100644 build-tests/heft-fastify-test/config/heft.json create mode 100644 build-tests/heft-fastify-test/config/rush-project.json create mode 100644 build-tests/heft-fastify-test/package.json create mode 100644 build-tests/heft-fastify-test/src/start.ts create mode 100644 build-tests/heft-fastify-test/tsconfig.json diff --git a/build-tests/heft-fastify-test/.eslintrc.js b/build-tests/heft-fastify-test/.eslintrc.js new file mode 100644 index 00000000000..60160b354c4 --- /dev/null +++ b/build-tests/heft-fastify-test/.eslintrc.js @@ -0,0 +1,7 @@ +// This is a workaround for https://github.com/eslint/eslint/issues/3458 +require('@rushstack/eslint-config/patch/modern-module-resolution'); + +module.exports = { + extends: ['@rushstack/eslint-config/profile/node'], + parserOptions: { tsconfigRootDir: __dirname } +}; diff --git a/build-tests/heft-fastify-test/README.md b/build-tests/heft-fastify-test/README.md new file mode 100644 index 00000000000..f9eaf392cdb --- /dev/null +++ b/build-tests/heft-fastify-test/README.md @@ -0,0 +1,3 @@ +# heft-fastify-test + +This project tests Heft support for the [Fastify](https://www.fastify.io/) framework for Node.js services. diff --git a/build-tests/heft-fastify-test/config/heft.json b/build-tests/heft-fastify-test/config/heft.json new file mode 100644 index 00000000000..99e058540fb --- /dev/null +++ b/build-tests/heft-fastify-test/config/heft.json @@ -0,0 +1,51 @@ +/** + * Defines configuration used by core Heft. + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/heft/heft.schema.json", + + "eventActions": [ + { + /** + * The kind of built-in operation that should be performed. + * The "deleteGlobs" action deletes files or folders that match the + * specified glob patterns. + */ + "actionKind": "deleteGlobs", + + /** + * The stage of the Heft run during which this action should occur. Note that actions specified in heft.json + * occur at the end of the stage of the Heft run. + */ + "heftEvent": "clean", + + /** + * A user-defined tag whose purpose is to allow configs to replace/delete handlers that were added by other + * configs. + */ + "actionId": "defaultClean", + + /** + * Glob patterns to be deleted. The paths are resolved relative to the project folder. + */ + "globsToDelete": ["dist", "lib", "temp"] + } + ], + + /** + * The list of Heft plugins to be loaded. + */ + "heftPlugins": [ + // { + // /** + // * The path to the plugin package. + // */ + // "plugin": "path/to/my-plugin", + // + // /** + // * An optional object that provides additional settings that may be defined by the plugin. + // */ + // // "options": { } + // } + ] +} diff --git a/build-tests/heft-fastify-test/config/rush-project.json b/build-tests/heft-fastify-test/config/rush-project.json new file mode 100644 index 00000000000..61e414685c1 --- /dev/null +++ b/build-tests/heft-fastify-test/config/rush-project.json @@ -0,0 +1,3 @@ +{ + "projectOutputFolderNames": ["lib", "dist"] +} diff --git a/build-tests/heft-fastify-test/package.json b/build-tests/heft-fastify-test/package.json new file mode 100644 index 00000000000..134044f0bc3 --- /dev/null +++ b/build-tests/heft-fastify-test/package.json @@ -0,0 +1,19 @@ +{ + "name": "heft-fastify-test", + "description": "This project tests Heft support for the Fastify framework for Node.js services", + "version": "1.0.0", + "private": true, + "main": "lib/index.js", + "license": "MIT", + "scripts": { + "build": "heft test --clean" + }, + "devDependencies": { + "@rushstack/eslint-config": "workspace:*", + "@rushstack/heft": "workspace:*", + "@types/heft-jest": "1.0.1", + "@types/node": "10.17.13", + "eslint": "~7.12.1", + "typescript": "~3.9.7" + } +} diff --git a/build-tests/heft-fastify-test/src/start.ts b/build-tests/heft-fastify-test/src/start.ts new file mode 100644 index 00000000000..f8c17d2b962 --- /dev/null +++ b/build-tests/heft-fastify-test/src/start.ts @@ -0,0 +1,4 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +console.log('Hello, world!'); diff --git a/build-tests/heft-fastify-test/tsconfig.json b/build-tests/heft-fastify-test/tsconfig.json new file mode 100644 index 00000000000..845c0343e3c --- /dev/null +++ b/build-tests/heft-fastify-test/tsconfig.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json.schemastore.org/tsconfig", + + "compilerOptions": { + "outDir": "lib", + "rootDir": "src", + + "forceConsistentCasingInFileNames": true, + "jsx": "react", + "declaration": true, + "sourceMap": true, + "declarationMap": true, + "inlineSources": true, + "experimentalDecorators": true, + "strictNullChecks": true, + "noUnusedLocals": true, + "types": ["heft-jest", "node"], + + "module": "commonjs", + "target": "es2017", + "lib": ["es2017"] + }, + "include": ["src/**/*.ts", "src/**/*.tsx"], + "exclude": ["node_modules", "lib"] +} diff --git a/rush.json b/rush.json index bf1b1888564..6356932e3fa 100644 --- a/rush.json +++ b/rush.json @@ -568,6 +568,12 @@ "reviewCategory": "tests", "shouldPublish": false }, + { + "packageName": "heft-fastify-test", + "projectFolder": "build-tests/heft-fastify-test", + "reviewCategory": "tests", + "shouldPublish": false + }, { "packageName": "heft-minimal-rig-test", "projectFolder": "build-tests/heft-minimal-rig-test",