Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "chore: Migrate to new package structure.",
"packageName": "@fluentui/babel-preset-global-context",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
bundle-size/
config/
coverage/
e2e/
docs/
etc/
node_modules/
src/
stories/
dist/types/
temp/
__fixtures__
Expand All @@ -16,7 +17,7 @@ __tests__
*.api.json
*.log
*.spec.*
*.stories.*
*.cy.*
*.test.*
*.yml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
* These tests are run with the specific cypress.config.ts file
* in this project in order to consume @fluentui/babel-preset-global-context during bundling
*/

// eslint-disable-next-line import/no-extraneous-dependencies
import * as React from 'react';
// eslint-disable-next-line import/no-extraneous-dependencies
import { mount } from '@cypress/react';
import { ProviderContext as ProviderContextV1 } from './fake_node_modules/context-v1.0.0';
import { ProviderContext as ProviderContextV11 } from './fake_node_modules/context-v1.1.0';
import { ProviderContext as ProviderContextV2 } from './fake_node_modules/context-v2.0.0';
import { ProviderContext as ProviderContextV1 } from './testing/fake_node_modules/context-v1.0.0';
import { ProviderContext as ProviderContextV11 } from './testing/fake_node_modules/context-v1.1.0';
import { ProviderContext as ProviderContextV2 } from './testing/fake_node_modules/context-v2.0.0';

import { ProviderContext as IgnoredContextV1 } from './fake_node_modules/ignored-context-v1.0.0';
import { ProviderContext as IgnoredContextV11 } from './fake_node_modules/ignored-context-v1.1.0';
import { ProviderContext as IgnoredContextV1 } from './testing/fake_node_modules/ignored-context-v1.0.0';
import { ProviderContext as IgnoredContextV11 } from './testing/fake_node_modules/ignored-context-v1.1.0';

describe('babel-preset-global-context', () => {
describe('targeted packages', () => {
const v1Foo = 'v1-foo';
const v1Bar = 'v1-bar';
const v2Bar = 'v2-bar';

// eslint-disable-next-line @typescript-eslint/naming-convention
function Consumer() {
const ctx = React.useContext(ProviderContextV1);
const ctxV11 = React.useContext(ProviderContextV11);
Expand All @@ -32,7 +34,7 @@ describe('babel-preset-global-context', () => {
</>
);
}

// eslint-disable-next-line @typescript-eslint/naming-convention
function Example() {
return (
<ProviderContextV1.Provider value={{ foo: 'red', bar: 'blue' }}>
Expand Down Expand Up @@ -69,7 +71,7 @@ describe('babel-preset-global-context', () => {
// configured in cypress.config.ts
describe('untargeted packages', () => {
const v1Foo = 'v1-foo';

// eslint-disable-next-line @typescript-eslint/naming-convention
function Consumer() {
const ctx = React.useContext(IgnoredContextV1);
const ctxV11 = React.useContext(IgnoredContextV11);
Expand All @@ -80,7 +82,7 @@ describe('babel-preset-global-context', () => {
</>
);
}

// eslint-disable-next-line @typescript-eslint/naming-convention
function Example() {
return (
<IgnoredContextV1.Provider value={{ foo: 'red' }}>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"extends": "../tsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"isolatedModules": false,
"types": ["node", "cypress", "cypress-storybook/cypress", "cypress-real-events"],
"lib": ["ES2019", "dom"]
},
"include": ["**/*.ts", "**/*.tsx"]
"include": ["**/*.cy.ts", "**/*.cy.tsx"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"path": "./tsconfig.spec.json"
},
{
"path": "./e2e/tsconfig.json"
"path": "./tsconfig.cy.json"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"types": ["static-assets", "environment", "node"],
"module": "CommonJS"
},
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx"],
"exclude": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.cy.ts", "**/*.cy.tsx"],
"include": ["./src/**/*.ts", "./src/**/*.tsx"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@
"outDir": "dist",
"types": ["jest", "node"]
},
"include": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.ts", "**/*.test.tsx", "**/*.d.ts"]
"include": [
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.test.ts",
"**/*.test.tsx",
"**/*.d.ts",
"./src/testing/**/*.ts",
"./src/testing/**/*.tsx"
]
}