diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index acf6c942351a68..bdab14b28026b3 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -92,6 +92,7 @@ scripts/projects-test @microsoft/fluentui-react-build scripts/puppeteer @microsoft/fluentui-react-build scripts/storybook @microsoft/fluentui-react-build scripts/tasks @microsoft/fluentui-react-build +scripts/test-ssr @microsoft/fluentui-react-build scripts/triage-bot @microsoft/fluentui-react-build @microsoft/cxe-prg scripts/ts-node @microsoft/fluentui-react-build scripts/update-release-notes @microsoft/fluentui-react-build diff --git a/scripts/test-ssr/.eslintrc.json b/scripts/test-ssr/.eslintrc.json new file mode 100644 index 00000000000000..e047a5d6646541 --- /dev/null +++ b/scripts/test-ssr/.eslintrc.json @@ -0,0 +1,21 @@ +{ + "extends": ["plugin:@fluentui/eslint-plugin/node", "plugin:@fluentui/eslint-plugin/imports"], + "rules": { + "@fluentui/max-len": "off", + "import/no-extraneous-dependencies": [ + "error", + { + "packageDir": [".", "../../"] + } + ] + }, + "overrides": [ + { + "files": "src/index.d.ts", + "rules": { + "import/no-self-import": "off" + } + } + ], + "root": true +} diff --git a/scripts/test-ssr/README.md b/scripts/test-ssr/README.md new file mode 100644 index 00000000000000..89e215196eaf70 --- /dev/null +++ b/scripts/test-ssr/README.md @@ -0,0 +1,3 @@ +## Test SSR utility + +TBD diff --git a/scripts/test-ssr/bin/test-ssr.js b/scripts/test-ssr/bin/test-ssr.js new file mode 100755 index 00000000000000..92ec99dd0e3f37 --- /dev/null +++ b/scripts/test-ssr/bin/test-ssr.js @@ -0,0 +1,2 @@ +#!/usr/bin/env node +console.log('test-ssr: is not implemented yet'); diff --git a/scripts/test-ssr/jest.config.js b/scripts/test-ssr/jest.config.js new file mode 100644 index 00000000000000..e24dd66f6cd5c9 --- /dev/null +++ b/scripts/test-ssr/jest.config.js @@ -0,0 +1,14 @@ +// @ts-check + +/** + * @type {import('@jest/types').Config.InitialOptions} + */ +module.exports = { + displayName: 'scripts-test-ssr', + preset: '../../jest.preset.js', + transform: { + '^.+\\.tsx?$': 'ts-jest', + }, + coverageDirectory: './coverage', + testEnvironment: 'node', +}; diff --git a/scripts/test-ssr/package.json b/scripts/test-ssr/package.json new file mode 100644 index 00000000000000..15b2239ace8943 --- /dev/null +++ b/scripts/test-ssr/package.json @@ -0,0 +1,16 @@ +{ + "name": "@fluentui/scripts-test-ssr", + "version": "0.0.1", + "private": true, + "bin": { + "test-ssr": "./bin/test-ssr.js" + }, + "scripts": { + "format": "prettier -w --ignore-path ../../.prettierignore .", + "format:check": "yarn format -c", + "lint": "eslint --ext .ts,.js .", + "test": "jest --passWithNoTests", + "type-check": "tsc -b tsconfig.json" + }, + "dependencies": {} +} diff --git a/scripts/test-ssr/src/index.ts b/scripts/test-ssr/src/index.ts new file mode 100644 index 00000000000000..b439385965fea5 --- /dev/null +++ b/scripts/test-ssr/src/index.ts @@ -0,0 +1 @@ +console.log('Hello from test-ssr'); diff --git a/scripts/test-ssr/tsconfig.json b/scripts/test-ssr/tsconfig.json new file mode 100644 index 00000000000000..b289e657bc0e53 --- /dev/null +++ b/scripts/test-ssr/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "@tsconfig/node14/tsconfig.json", + "compilerOptions": { + "target": "ES2019", + "pretty": true, + "noEmit": true, + "allowJs": true, + "checkJs": true, + "sourceMap": true, + "noUnusedLocals": true + }, + "include": [], + "files": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/scripts/test-ssr/tsconfig.lib.json b/scripts/test-ssr/tsconfig.lib.json new file mode 100644 index 00000000000000..f513783ef5307a --- /dev/null +++ b/scripts/test-ssr/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "lib": ["ES2019"], + "outDir": "../../dist/out-tsc", + "types": ["node"] + }, + "exclude": ["**/*.spec.ts", "**/*.test.ts"], + "include": ["./src/**/*.ts", "./src/**/*.js"] +} diff --git a/scripts/test-ssr/tsconfig.spec.json b/scripts/test-ssr/tsconfig.spec.json new file mode 100644 index 00000000000000..4d20fc98b71dd4 --- /dev/null +++ b/scripts/test-ssr/tsconfig.spec.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "CommonJS", + "outDir": "dist", + "types": ["jest", "node"] + }, + "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] +} diff --git a/workspace.json b/workspace.json index 7160536139301b..5734b81403817b 100644 --- a/workspace.json +++ b/workspace.json @@ -996,6 +996,12 @@ "projectType": "library", "tags": ["tools"] }, + "@fluentui/scripts-test-ssr": { + "root": "scripts/test-ssr", + "sourceRoot": "scripts/test-ssr/src", + "projectType": "library", + "tags": ["tools"] + }, "@fluentui/scripts-triage-bot": { "root": "scripts/triage-bot", "sourceRoot": "scripts/triage-bot/src",