Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build: move deprecated packages #22753

Merged
merged 3 commits into from
May 26, 2023
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
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ jobs:
- code/node_modules
- code/addons
- code/frameworks
- code/deprecated
- code/lib
- code/builders
- code/ui
Expand Down
1 change: 1 addition & 0 deletions code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module.exports = {
'frameworks/**/*',
'lib/**/*',
'builders/**/*',
'deprecated/**/*',
'renderers/**/*',
'ui/**/*',
],
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"keywords": [
"storybook"
],
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/addons",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/deprecated/addons",
"bugs": {
"url": "https://github.com/storybookjs/storybook/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "code/lib/addons"
"directory": "code/deprecated/addons"
},
"funding": {
"type": "opencollective",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"keywords": [
"storybook"
],
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/client-api",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/deprecated/client-api",
"bugs": {
"url": "https://github.com/storybookjs/storybook/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "code/lib/client-api"
"directory": "code/deprecated/client-api"
},
"funding": {
"type": "opencollective",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"keywords": [
"storybook"
],
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/core-client",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/deprecated/core-client",
"bugs": {
"url": "https://github.com/storybookjs/storybook/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "code/lib/core-client"
"directory": "code/deprecated/core-client"
},
"funding": {
"type": "opencollective",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "code/lib/manager-api-shim"
"directory": "code/deprecated/manager-api-shim"
},
"funding": {
"type": "opencollective",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"keywords": [
"storybook"
],
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/preview-web",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/deprecated/preview-web",
"bugs": {
"url": "https://github.com/storybookjs/storybook/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "code/lib/preview-web"
"directory": "code/deprecated/preview-web"
},
"funding": {
"type": "opencollective",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"keywords": [
"storybook"
],
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/lib/store",
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/deprecated/store",
"bugs": {
"url": "https://github.com/storybookjs/storybook/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/storybookjs/storybook.git",
"directory": "code/lib/store"
"directory": "code/deprecated/store"
},
"funding": {
"type": "opencollective",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions code/e2e-tests/preview-web.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test.describe('preview-web', () => {

test('should pass over shortcuts, but not from play functions, story', async ({ page }) => {
const sbPage = new SbPage(page);
await sbPage.navigateToStory('lib/store/shortcuts', 'keydown-during-play');
await sbPage.navigateToStory('lib/preview-api/shortcuts', 'keydown-during-play');

await expect(sbPage.page.locator('.sidebar-container')).toBeVisible();

Expand All @@ -22,7 +22,7 @@ test.describe('preview-web', () => {

test('should pass over shortcuts, but not from play functions, docs', async ({ page }) => {
const sbPage = new SbPage(page);
await sbPage.navigateToStory('lib/store/shortcuts', 'docs');
await sbPage.navigateToStory('lib/preview-api/shortcuts', 'docs');

await expect(sbPage.page.locator('.sidebar-container')).toBeVisible();

Expand Down
7 changes: 0 additions & 7 deletions code/lib/addons/jest.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions code/lib/client-api/jest.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions code/lib/core-client/jest.config.js

This file was deleted.

8 changes: 4 additions & 4 deletions code/lib/core-server/src/utils/summarizeIndex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,11 @@ describe('summarizeIndex', () => {
tags: ['autodocs', 'story'],
type: 'story',
},
'lib-store-shortcuts--docs': {
id: 'lib-store-shortcuts--docs',
title: 'lib/store/shortcuts',
'lib-preview-api-shortcuts--docs': {
id: 'lib-preview-api-shortcuts--docs',
title: 'lib/preview-api/shortcuts',
name: 'Docs',
importPath: './template-stories/lib/store/shortcuts.stories.ts',
importPath: './template-stories/lib/preview-api/shortcuts.stories.ts',
type: 'docs',
tags: ['autodocs', 'docs'],
storiesImports: [],
Expand Down
7 changes: 0 additions & 7 deletions code/lib/manager-api-shim/jest.config.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export default {

export const Default = {
play: async ({ title }: PlayFunctionContext<any>) => {
await expect(title).toBe('lib/store/autotitle');
await expect(title).toBe('lib/preview-api/autotitle');
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export default {

export const Default = {
play: async ({ title }: PlayFunctionContext<any>) => {
await expect(title).toBe('lib/store/manual title');
await expect(title).toBe('lib/preview-api/manual title');
},
};
7 changes: 0 additions & 7 deletions code/lib/preview-web/jest.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions code/lib/store/jest.config.js

This file was deleted.

1 change: 1 addition & 0 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"addons/*",
"frameworks/*",
"lib/*",
"deprecated/*",
"builders/*",
"ui/*",
"presets/*",
Expand Down
24 changes: 12 additions & 12 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5442,9 +5442,9 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/[email protected], @storybook/addons@workspace:*, @storybook/addons@workspace:lib/addons":
"@storybook/[email protected], @storybook/addons@workspace:*, @storybook/addons@workspace:deprecated/addons":
version: 0.0.0-use.local
resolution: "@storybook/addons@workspace:lib/addons"
resolution: "@storybook/addons@workspace:deprecated/addons"
dependencies:
"@storybook/manager-api": 7.1.0-alpha.25
"@storybook/preview-api": 7.1.0-alpha.25
Expand Down Expand Up @@ -5532,9 +5532,9 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/[email protected], @storybook/api@workspace:*, @storybook/api@workspace:lib/manager-api-shim":
"@storybook/[email protected], @storybook/api@workspace:*, @storybook/api@workspace:deprecated/manager-api-shim":
version: 0.0.0-use.local
resolution: "@storybook/api@workspace:lib/manager-api-shim"
resolution: "@storybook/api@workspace:deprecated/manager-api-shim"
dependencies:
"@storybook/client-logger": 7.1.0-alpha.25
"@storybook/manager-api": 7.1.0-alpha.25
Expand Down Expand Up @@ -5863,9 +5863,9 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/[email protected], @storybook/client-api@workspace:*, @storybook/client-api@workspace:lib/client-api":
"@storybook/[email protected], @storybook/client-api@workspace:*, @storybook/client-api@workspace:deprecated/client-api":
version: 0.0.0-use.local
resolution: "@storybook/client-api@workspace:lib/client-api"
resolution: "@storybook/client-api@workspace:deprecated/client-api"
dependencies:
"@storybook/client-logger": 7.1.0-alpha.25
"@storybook/preview-api": 7.1.0-alpha.25
Expand Down Expand Up @@ -5956,9 +5956,9 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/[email protected], @storybook/core-client@workspace:*, @storybook/core-client@workspace:lib/core-client":
"@storybook/[email protected], @storybook/core-client@workspace:*, @storybook/core-client@workspace:deprecated/core-client":
version: 0.0.0-use.local
resolution: "@storybook/core-client@workspace:lib/core-client"
resolution: "@storybook/core-client@workspace:deprecated/core-client"
dependencies:
"@storybook/client-logger": 7.1.0-alpha.25
"@storybook/preview-api": 7.1.0-alpha.25
Expand Down Expand Up @@ -6783,9 +6783,9 @@ __metadata:
languageName: node
linkType: hard

"@storybook/[email protected], @storybook/preview-web@workspace:*, @storybook/preview-web@workspace:lib/preview-web":
"@storybook/[email protected], @storybook/preview-web@workspace:*, @storybook/preview-web@workspace:deprecated/preview-web":
version: 0.0.0-use.local
resolution: "@storybook/preview-web@workspace:lib/preview-web"
resolution: "@storybook/preview-web@workspace:deprecated/preview-web"
dependencies:
"@storybook/client-logger": 7.1.0-alpha.25
"@storybook/preview-api": 7.1.0-alpha.25
Expand Down Expand Up @@ -7182,9 +7182,9 @@ __metadata:
languageName: unknown
linkType: soft

"@storybook/[email protected], @storybook/store@workspace:*, @storybook/store@workspace:lib/store":
"@storybook/[email protected], @storybook/store@workspace:*, @storybook/store@workspace:deprecated/store":
version: 0.0.0-use.local
resolution: "@storybook/store@workspace:lib/store"
resolution: "@storybook/store@workspace:deprecated/store"
dependencies:
"@storybook/client-logger": 7.1.0-alpha.25
"@storybook/preview-api": 7.1.0-alpha.25
Expand Down
14 changes: 7 additions & 7 deletions scripts/tasks/sandbox-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ async function linkPackageStories(
const storiesFolderName = variant ? getStoriesFolderWithVariant(variant) : 'stories';
const source = join(CODE_DIRECTORY, packageDir, 'template', storiesFolderName);
// By default we link `stories` directories
// e.g '../../../code/lib/store/template/stories' to 'template-stories/lib/store'
// if the directory <code>/lib/store/template/stories exists
// e.g '../../../code/lib/preview-api/template/stories' to 'template-stories/lib/preview-api'
// if the directory <code>/lib/preview-api/template/stories exists
//
// The files must be linked in the cwd, in order to ensure that any dependencies they
// reference are resolved in the cwd. In particular 'react' resolved by MDX files.
Expand All @@ -315,8 +315,8 @@ async function linkPackageStories(
}

// Add `previewAnnotation` entries of the form
// './template-stories/lib/store/preview.[tj]s'
// if the file <code>/lib/store/template/stories/preview.[jt]s exists
// './template-stories/lib/preview-api/preview.[tj]s'
// if the file <code>/lib/preview-api/template/stories/preview.[jt]s exists
await Promise.all(
['js', 'ts'].map(async (ext) => {
const previewFile = `preview.${ext}`;
Expand Down Expand Up @@ -384,7 +384,7 @@ export const addStories: Task['run'] = async (
const storiesVariantFolder = getStoriesFolderWithVariant(sandboxSpecificStoriesFolder);

if (isCoreRenderer) {
// Link in the template/components/index.js from store, the renderer and the addons
// Link in the template/components/index.js from preview-api, the renderer and the addons
const rendererPath = await workspacePath('renderer', template.expected.renderer);
await ensureSymlink(
join(CODE_DIRECTORY, rendererPath, 'template', 'components'),
Expand Down Expand Up @@ -450,9 +450,9 @@ export const addStories: Task['run'] = async (
}

if (isCoreRenderer) {
// Add stories for lib/store (and addons below). NOTE: these stories will be in the
// Add stories for lib/preview-api (and addons below). NOTE: these stories will be in the
// template-stories folder and *not* processed by the framework build config (instead by esbuild-loader)
await linkPackageStories(await workspacePath('core package', '@storybook/store'), {
await linkPackageStories(await workspacePath('core package', '@storybook/preview-api'), {
mainConfig,
cwd,
});
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/filterExistsInCodeDir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path';
import { pathExists } from 'fs-extra';
import { CODE_DIRECTORY } from './constants';

// packageDirs of the form `lib/store`
// packageDirs of the form `lib/preview-api`
// paths to check of the form 'template/stories'
export const filterExistsInCodeDir = async (packageDirs: string[], pathToCheck: string) =>
(
Expand Down
10 changes: 5 additions & 5 deletions test-storybooks/ember-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"@storybook/vue3-webpack5": "portal:../../code/frameworks/vue3-webpack5",
"@storybook/web-components-vite": "portal:../../code/frameworks/web-components-vite",
"@storybook/web-components-webpack5": "portal:../../code/frameworks/web-components-webpack5",
"@storybook/addons": "portal:../../code/lib/addons",
"@storybook/addons": "portal:../../code/deprecated/addons",
"@storybook/api": "portal:../../code/lib/api",
"@storybook/blocks": "portal:../../code/lib/blocks",
"@storybook/builder-manager": "portal:../../code/builders/builder-manager",
Expand All @@ -109,11 +109,11 @@
"@storybook/cli": "portal:../../code/lib/cli",
"sb": "portal:../../code/lib/cli-sb",
"storybook": "portal:../../code/lib/cli-storybook",
"@storybook/client-api": "portal:../../code/lib/client-api",
"@storybook/client-api": "portal:../../code/deprecated/client-api",
"@storybook/client-logger": "portal:../../code/lib/client-logger",
"@storybook/codemod": "portal:../../code/lib/codemod",
"@storybook/components": "portal:../../code/lib/components",
"@storybook/core-client": "portal:../../code/lib/core-client",
"@storybook/core-client": "portal:../../code/deprecated/core-client",
"@storybook/core-common": "portal:../../code/lib/core-common",
"@storybook/core-events": "portal:../../code/lib/core-events",
"@storybook/core-server": "portal:../../code/lib/core-server",
Expand All @@ -123,10 +123,10 @@
"@storybook/instrumenter": "portal:../../code/lib/instrumenter",
"@storybook/node-logger": "portal:../../code/lib/node-logger",
"@storybook/postinstall": "portal:../../code/lib/postinstall",
"@storybook/preview-web": "portal:../../code/lib/preview-web",
"@storybook/preview-web": "portal:../../code/deprecated/preview-web",
"@storybook/router": "portal:../../code/lib/router",
"@storybook/source-loader": "portal:../../code/lib/source-loader",
"@storybook/store": "portal:../../code/lib/store",
"@storybook/store": "portal:../../code/deprecated/store",
"@storybook/telemetry": "portal:../../code/lib/telemetry",
"@storybook/theming": "portal:../../code/lib/theming",
"@storybook/preset-html-webpack": "portal:../../code/presets/html-webpack",
Expand Down
Loading