-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(azure-theme): bootstrap new package (#180)
- Loading branch information
1 parent
348d8fb
commit 2125d9f
Showing
19 changed files
with
304 additions
and
30 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "../../babel.config.json" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"extends": ["../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["stories/**/*.tsx", "stories/**/*.ts"], | ||
"rules": { | ||
"@nx/enforce-module-boundaries": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { StorybookConfig } from '@storybook/react-webpack5'; | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../stories/**/index.stories.@(js|jsx|ts|tsx|mdx)'], | ||
addons: [ | ||
'@nx/react/plugins/storybook', | ||
{ | ||
name: '@storybook/addon-storysource', | ||
options: { | ||
loaderOptions: { | ||
injectStoryParameters: true, | ||
}, | ||
}, | ||
}, | ||
], | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {}, | ||
}, | ||
}; | ||
|
||
export default config; | ||
|
||
// To customize your webpack configuration you can use the webpackFinal field. | ||
// Check https://storybook.js.org/docs/react/builders/webpack#extending-storybooks-webpack-config | ||
// and https://nx.dev/packages/storybook/documents/custom-builder-configs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from 'react'; | ||
|
||
import { Preview } from '@storybook/react'; | ||
|
||
import { FluentProvider, webLightTheme } from '@fluentui/react-components'; | ||
|
||
const preview: Preview = { | ||
decorators: [ | ||
(Story) => ( | ||
<FluentProvider theme={webLightTheme}> | ||
<Story /> | ||
</FluentProvider> | ||
), | ||
], | ||
}; | ||
|
||
export default preview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"emitDecoratorMetadata": true, | ||
"outDir": "" | ||
}, | ||
"files": [ | ||
"../../../node_modules/@nx/react/typings/styled-jsx.d.ts", | ||
"../../../node_modules/@nx/react/typings/cssmodule.d.ts", | ||
"../../../node_modules/@nx/react/typings/image.d.ts" | ||
], | ||
"exclude": [ | ||
"../**/*.spec.ts", | ||
"../**/*.spec.js", | ||
"../**/*.spec.tsx", | ||
"../**/*.spec.jsx" | ||
], | ||
"include": [ | ||
"../stories/**/*.stories.ts", | ||
"../stories/**/*.stories.js", | ||
"../stories/**/*.stories.jsx", | ||
"../stories/**/*.stories.tsx", | ||
"../stories/**/*.stories.mdx", | ||
"*.ts", | ||
"*.js" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"jsc": { | ||
"target": "es2019", | ||
"parser": { | ||
"syntax": "typescript", | ||
"tsx": true, | ||
"decorators": false, | ||
"dynamicImport": false | ||
}, | ||
"transform": { | ||
"react": { | ||
"runtime": "classic", | ||
"useSpread": true | ||
} | ||
}, | ||
"keepClassNames": true, | ||
"externalHelpers": true, | ||
"loose": true | ||
}, | ||
"sourceMaps": true, | ||
"exclude": [ | ||
"jest.config.ts", | ||
".*\\.spec.tsx?$", | ||
".*\\.test.tsx?$", | ||
"./src/jest-setup.ts$", | ||
"./**/jest-setup.ts$", | ||
".*.js$" | ||
], | ||
"$schema": "https://json.schemastore.org/swcrc" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# azure-theme | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Building | ||
|
||
Run `nx build azure-theme` to build the library. | ||
|
||
## Running unit tests | ||
|
||
Run `nx test azure-theme` to execute the unit tests via [Jest](https://jestjs.io). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* eslint-disable */ | ||
import { readFileSync } from 'fs'; | ||
|
||
// Reading the SWC compilation config and remove the "exclude" | ||
// for the test files to be compiled by SWC | ||
const { exclude: _, ...swcJestConfig } = JSON.parse( | ||
readFileSync(`${__dirname}/.swcrc`, 'utf-8') | ||
); | ||
|
||
// disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves. | ||
// If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude" | ||
if (swcJestConfig.swcrc === undefined) { | ||
swcJestConfig.swcrc = false; | ||
} | ||
|
||
// Uncomment if using global setup/teardown files being transformed via swc | ||
// https://nx.dev/packages/jest/documents/overview#global-setup/teardown-with-nx-libraries | ||
// jest needs EsModule Interop to find the default exported setup/teardown functions | ||
// swcJestConfig.module.noInterop = false; | ||
|
||
export default { | ||
displayName: 'azure-theme', | ||
preset: '../../jest.preset.js', | ||
transform: { | ||
'^.+\\.[tj]s$': ['@swc/jest', swcJestConfig], | ||
}, | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
testEnvironment: 'jsdom', | ||
coverageDirectory: '../../coverage/packages/azure-theme', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "@fluentui-contrib/azure-theme", | ||
"version": "0.0.1", | ||
"dependencies": { | ||
"@swc/helpers": "~0.5.2" | ||
}, | ||
"main": "./src/index.js", | ||
"typings": "./src/index.d.ts", | ||
"private": true, | ||
"peerDependencies": { | ||
"@fluentui/react-components": ">=9.46.3 <10.0.0", | ||
"@types/react": ">=16.8.0 <19.0.0", | ||
"@types/react-dom": ">=16.8.0 <19.0.0", | ||
"react": ">=16.8.0 <19.0.0", | ||
"react-dom": ">=16.8.0 <19.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{ | ||
"name": "azure-theme", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"sourceRoot": "packages/azure-theme/src", | ||
"projectType": "library", | ||
"targets": { | ||
"build": { | ||
"executor": "@fluentui-contrib/nx-plugin:build" | ||
}, | ||
"publish": { | ||
"command": "node tools/scripts/publish.mjs azure-theme {args.ver} {args.tag}", | ||
"dependsOn": ["build"] | ||
}, | ||
"lint": { | ||
"executor": "@nx/eslint:lint", | ||
"options": { | ||
"lintFilePatterns": [ | ||
"packages/azure-theme/**/*.ts", | ||
"packages/azure-theme/**/*.tsx" | ||
] | ||
} | ||
}, | ||
"test": { | ||
"executor": "@nx/jest:jest", | ||
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"], | ||
"options": { | ||
"jestConfig": "packages/azure-theme/jest.config.ts", | ||
"passWithNoTests": true | ||
} | ||
}, | ||
"type-check": { | ||
"executor": "@fluentui-contrib/nx-plugin:type-check" | ||
}, | ||
"storybook": { | ||
"executor": "@nx/storybook:storybook", | ||
"options": { | ||
"port": 4400, | ||
"configDir": "packages/azure-theme/.storybook" | ||
}, | ||
"configurations": { | ||
"ci": { | ||
"quiet": true | ||
} | ||
} | ||
}, | ||
"build-storybook": { | ||
"executor": "@nx/storybook:build", | ||
"outputs": ["{options.outputDir}"], | ||
"options": { | ||
"outputDir": "dist/storybook/azure-theme", | ||
"configDir": "packages/azure-theme/.storybook" | ||
}, | ||
"configurations": { | ||
"ci": { | ||
"quiet": true | ||
} | ||
} | ||
} | ||
}, | ||
"tags": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"files": [], | ||
"compilerOptions": { | ||
"jsx": "react" | ||
}, | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.lib.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
}, | ||
{ | ||
"path": "./.storybook/tsconfig.json" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/out-tsc", | ||
"declaration": true | ||
}, | ||
"include": ["src/**/*.ts"], | ||
"exclude": [ | ||
"jest.config.ts", | ||
"src/**/*.test.ts", | ||
"src/**/*.test.tsx", | ||
"files/**", | ||
"**/*.stories.ts", | ||
"**/*.stories.js", | ||
"**/*.stories.jsx", | ||
"**/*.stories.tsx" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/out-tsc", | ||
"module": "commonjs", | ||
"types": ["jest", "node"] | ||
}, | ||
"include": [ | ||
"jest.config.ts", | ||
"src/**/*.test.ts", | ||
"src/**/*.test.tsx", | ||
"src/**/*.d.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.