Skip to content

Commit

Permalink
Move ./utils/parser to ./parser
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 committed May 28, 2024
1 parent f05a689 commit 72f6066
Show file tree
Hide file tree
Showing 20 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/compiler/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import { createAppendix } from './transform/compiled/create-appendix.js';
import { insertDefineMetaJSDocCommentAsDescription } from './transform/define-meta/description.js';
import { destructureMetaFromDefineMeta } from './transform/define-meta/destructure-meta.js';
import { insertStoryHTMLCommentAsDescription } from './transform/Story/description.js';
import { getSvelteAST } from '../parser/ast.js';
import { extractStoriesNodesFromExportDefaultFn } from '../parser/extract/compiled/stories.js';
import { extractCompiledASTNodes } from '../parser/extract/compiled/nodes.js';
import { extractSvelteASTNodes } from '../parser/extract/svelte/nodes.js';
import { getNameFromFilename } from '../utils/get-component-name.js';
import { getSvelteAST } from '../utils/parser/ast.js';
import { extractStoriesNodesFromExportDefaultFn } from '../utils/parser/extract/compiled/stories.js';
import { extractCompiledASTNodes } from '../utils/parser/extract/compiled/nodes.js';
import { extractSvelteASTNodes } from '../utils/parser/extract/svelte/nodes.js';

export async function plugin(): Promise<Plugin> {
const [{ createFilter }, { loadSvelteConfig }] = await Promise.all([
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/transform/Story/description.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { toJs } from 'estree-util-to-js';
import type MagicString from 'magic-string';
import type { Component } from 'svelte/compiler';

import type { SvelteASTNodes } from '../../../utils/parser/extract/svelte/nodes.js';
import type { extractStoriesNodesFromExportDefaultFn } from '../../../utils/parser/extract/compiled/stories.js';
import type { extractStoriesNodesFromExportDefaultFn } from '../../../parser/extract/compiled/stories.js';
import type { SvelteASTNodes } from '../../../parser/extract/svelte/nodes.js';

interface Params {
code: MagicString;
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/transform/compiled/create-appendix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import url from 'node:url';
import MagicString from 'magic-string';

import { getNameFromStoryAttribute } from '../../../utils/parser/analyse/Story-attributes.js';
import type { SvelteASTNodes } from '../../../utils/parser/extract/svelte/nodes.js';
import type { CompiledASTNodes } from '../../../utils/parser/extract/compiled/nodes.js';
import { extractStoryAttributesNodes } from '../../../utils/parser/extract/svelte/Story-attributes.js';
import { getNameFromStoryAttribute } from '../../../parser/analyse/Story-attributes.js';
import type { CompiledASTNodes } from '../../../parser/extract/compiled/nodes.js';
import type { SvelteASTNodes } from '../../../parser/extract/svelte/nodes.js';
import { extractStoryAttributesNodes } from '../../../parser/extract/svelte/Story-attributes.js';

const parserModulePath = url
.fileURLToPath(new URL('../../../utils/parser/collect-stories.js', import.meta.url))
Expand Down
12 changes: 6 additions & 6 deletions src/indexer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import { combineTags } from '@storybook/csf';
import type { IndexInput, Indexer } from '@storybook/types';
import { preprocess } from 'svelte/compiler';

import { getSvelteAST } from '../utils/parser/ast.js';
import { extractSvelteASTNodes } from '../utils/parser/extract/svelte/nodes.js';
import { extractMetaPropertiesNodes } from '../utils/parser/extract/meta-properties.js';
import { getSvelteAST } from '../parser/ast.js';
import { extractSvelteASTNodes } from '../parser/extract/svelte/nodes.js';
import { extractMetaPropertiesNodes } from '../parser/extract/meta-properties.js';
import {
getMetaIdValue,
getMetaTagsValue,
getMetaTitleValue,
} from '../utils/parser/analyse/meta-properties.js';
import { extractStoryAttributesNodes } from '../utils/parser/extract/svelte/Story-attributes.js';
} from '../parser/analyse/meta-properties.js';
import { extractStoryAttributesNodes } from '../parser/extract/svelte/Story-attributes.js';
import {
getNameFromStoryAttribute,
getTagsFromStoryAttribute,
} from '../utils/parser/analyse/Story-attributes.js';
} from '../parser/analyse/Story-attributes.js';

export const indexer: Indexer = {
test: /\.svelte$/,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 72f6066

Please sign in to comment.