diff --git a/.changeset/config.json b/.changeset/config.json index 51e0c0af5..c9c7d3d7d 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,7 +2,7 @@ "$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json", "changelog": "@changesets/cli/changelog", "commit": false, - "linked": [["astro", "astro-parser"]], + "linked": [["astro", "@astrojs/parser"]], "access": "public", "baseBranch": "main", "updateInternalDependencies": "patch", diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 3294a404d..455f0258d 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -21,7 +21,7 @@ jobs: - run: yarn --frozen-lockfile --ignore-engines env: CI: true - - run: yarn lerna run build --scope astro-parser + - run: yarn lerna run build --scope @astrojs/parser - run: yarn format - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 diff --git a/contributing.md b/contributing.md index 1792e8985..ef6bcb392 100644 --- a/contributing.md +++ b/contributing.md @@ -32,7 +32,7 @@ This should change package.json bumping version numbers and update changelogs. I Commit and push these changes, then run an npm publish for each of the packages that have changed. -> **Important**! Ordering publishes can be important. If `astro-parser` changes you should publish that before `astro`, for example. +> **Important**! Ordering publishes can be important. If `@astrojs/parser` changes you should publish that before `astro`, for example. ```shell cd packages/astro diff --git a/package.json b/package.json index ed48cccea..5532f0277 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "release": "yarn build && yarn changeset publish", "benchmark": "yarn workspace astro run benchmark", "build": "yarn build:core", - "build:core": "lerna run build --scope astro --scope astro-parser --scope @astrojs/markdown-support", - "build:vscode": "lerna run build --scope astro-languageserver --scope astro-vscode --scope astro-parser", - "dev:vscode": "lerna run dev --scope astro-languageserver --scope astro-vscode --scope astro-parser --parallel --stream", + "build:core": "lerna run build --scope astro --scope @astrojs/parser --scope @astrojs/markdown-support", + "build:vscode": "lerna run build --scope astro-languageserver --scope astro-vscode --scope @astrojs/parser", + "dev:vscode": "lerna run dev --scope astro-languageserver --scope astro-vscode --scope @astrojs/parser --parallel --stream", "format": "prettier -w \"**/*.{js,jsx,ts,tsx,md,json}\"", "lint": "eslint \"packages/**/*.ts\"", "test": "lerna run test --scope astro --stream", diff --git a/packages/astro-parser/CHANGELOG.md b/packages/astro-parser/CHANGELOG.md index 11bff8793..597672239 100644 --- a/packages/astro-parser/CHANGELOG.md +++ b/packages/astro-parser/CHANGELOG.md @@ -1,4 +1,4 @@ -# astro-parser +# @astrojs/parser ## 0.12.1 diff --git a/packages/astro-parser/package.json b/packages/astro-parser/package.json index dd689f855..7d9252d1e 100644 --- a/packages/astro-parser/package.json +++ b/packages/astro-parser/package.json @@ -1,5 +1,5 @@ { - "name": "astro-parser", + "name": "@astrojs/parser", "version": "0.12.1", "author": "Skypack", "license": "MIT", diff --git a/packages/astro/package.json b/packages/astro/package.json index bfe1cc5e2..a23e1b5bd 100644 --- a/packages/astro/package.json +++ b/packages/astro/package.json @@ -37,6 +37,7 @@ }, "dependencies": { "@astrojs/markdown-support": "0.1.1", + "@astrojs/parser": "0.12.1", "@astrojs/prism": "0.2.0", "@astrojs/renderer-preact": "0.1.0", "@astrojs/renderer-react": "0.1.0", @@ -51,7 +52,6 @@ "@snowpack/plugin-sass": "^1.4.0", "acorn": "^7.4.0", "astring": "^1.7.4", - "astro-parser": "0.12.1", "autoprefixer": "^10.2.5", "cheerio": "^1.0.0-rc.6", "del": "^6.0.0", diff --git a/packages/astro/src/@types/transformer.ts b/packages/astro/src/@types/transformer.ts index 8a2099d61..6bb453c1d 100644 --- a/packages/astro/src/@types/transformer.ts +++ b/packages/astro/src/@types/transformer.ts @@ -1,4 +1,4 @@ -import type { TemplateNode } from 'astro-parser'; +import type { TemplateNode } from '@astrojs/parser'; import type { CompileOptions } from './compiler'; export type VisitorFn = (this: { skip: () => void; remove: () => void; replace: (node: T) => void }, node: T, parent: T, type: string, index: number) => void; diff --git a/packages/astro/src/ast.ts b/packages/astro/src/ast.ts index bee1d9b6f..4de7a6d16 100644 --- a/packages/astro/src/ast.ts +++ b/packages/astro/src/ast.ts @@ -1,5 +1,5 @@ import 'source-map-support/register.js'; -import type { Attribute } from 'astro-parser'; +import type { Attribute } from '@astrojs/parser'; // AST utility functions diff --git a/packages/astro/src/compiler/codegen/index.ts b/packages/astro/src/compiler/codegen/index.ts index 8a168f0c5..8c5cb1fb1 100644 --- a/packages/astro/src/compiler/codegen/index.ts +++ b/packages/astro/src/compiler/codegen/index.ts @@ -1,4 +1,4 @@ -import type { Ast, Script, Style, TemplateNode } from 'astro-parser'; +import type { Ast, Script, Style, TemplateNode } from '@astrojs/parser'; import type { CompileOptions } from '../../@types/compiler'; import type { AstroConfig, AstroMarkdownOptions, TransformResult, ComponentInfo, Components } from '../../@types/astro'; import type { ImportDeclaration, ExportNamedDeclaration, VariableDeclarator, Identifier, ImportDefaultSpecifier } from '@babel/types'; @@ -7,7 +7,7 @@ import 'source-map-support/register.js'; import eslexer from 'es-module-lexer'; import esbuild from 'esbuild'; import path from 'path'; -import { parse } from 'astro-parser'; +import { parse } from '@astrojs/parser'; import { walk, asyncWalk } from 'estree-walker'; import _babelGenerator from '@babel/generator'; import babelParser from '@babel/parser'; diff --git a/packages/astro/src/compiler/index.ts b/packages/astro/src/compiler/index.ts index b206878e0..c74dd05f2 100644 --- a/packages/astro/src/compiler/index.ts +++ b/packages/astro/src/compiler/index.ts @@ -5,7 +5,7 @@ import type { CompileOptions } from '../@types/compiler.js'; import path from 'path'; import { renderMarkdownWithFrontmatter } from '@astrojs/markdown-support'; -import { parse } from 'astro-parser'; +import { parse } from '@astrojs/parser'; import { transform } from './transform/index.js'; import { codegen } from './codegen/index.js'; diff --git a/packages/astro/src/compiler/transform/head.ts b/packages/astro/src/compiler/transform/head.ts index bafe3e341..b11581814 100644 --- a/packages/astro/src/compiler/transform/head.ts +++ b/packages/astro/src/compiler/transform/head.ts @@ -1,5 +1,5 @@ import type { Transformer, TransformOptions } from '../../@types/transformer'; -import type { TemplateNode } from 'astro-parser'; +import type { TemplateNode } from '@astrojs/parser'; /** If there are hydrated components, inject styles for [data-astro-root] and [data-astro-children] */ export default function (opts: TransformOptions): Transformer { diff --git a/packages/astro/src/compiler/transform/index.ts b/packages/astro/src/compiler/transform/index.ts index 9df050ee5..c9943cc5f 100644 --- a/packages/astro/src/compiler/transform/index.ts +++ b/packages/astro/src/compiler/transform/index.ts @@ -1,4 +1,4 @@ -import type { Ast, TemplateNode } from 'astro-parser'; +import type { Ast, TemplateNode } from '@astrojs/parser'; import type { NodeVisitor, TransformOptions, Transformer, VisitorFn } from '../../@types/transformer'; import { walk } from 'estree-walker'; diff --git a/packages/astro/src/compiler/transform/prism.ts b/packages/astro/src/compiler/transform/prism.ts index 0439b3a36..0afb8194b 100644 --- a/packages/astro/src/compiler/transform/prism.ts +++ b/packages/astro/src/compiler/transform/prism.ts @@ -1,5 +1,5 @@ import type { Transformer } from '../../@types/transformer'; -import type { Script, TemplateNode } from 'astro-parser'; +import type { Script, TemplateNode } from '@astrojs/parser'; import { getAttrValue } from '../../ast.js'; export const PRISM_IMPORT = `import Prism from 'astro/components/Prism.astro';`; diff --git a/packages/astro/src/compiler/transform/styles.ts b/packages/astro/src/compiler/transform/styles.ts index 70d573003..1e459bb7f 100644 --- a/packages/astro/src/compiler/transform/styles.ts +++ b/packages/astro/src/compiler/transform/styles.ts @@ -1,5 +1,5 @@ import type { TransformOptions, Transformer } from '../../@types/transformer'; -import type { TemplateNode } from 'astro-parser'; +import type { TemplateNode } from '@astrojs/parser'; import crypto from 'crypto'; import { createRequire } from 'module'; diff --git a/packages/astro/src/logger.ts b/packages/astro/src/logger.ts index 84572e86e..a7531f9a3 100644 --- a/packages/astro/src/logger.ts +++ b/packages/astro/src/logger.ts @@ -1,5 +1,5 @@ import 'source-map-support/register.js'; -import type { CompileError } from 'astro-parser'; +import type { CompileError } from '@astrojs/parser'; import { bold, blue, red, grey, underline } from 'kleur/colors'; import { Writable } from 'stream'; import { format as utilFormat } from 'util'; diff --git a/packages/astro/src/runtime.ts b/packages/astro/src/runtime.ts index bd5171f06..db1e15b12 100644 --- a/packages/astro/src/runtime.ts +++ b/packages/astro/src/runtime.ts @@ -8,7 +8,7 @@ import { fileURLToPath, pathToFileURL } from 'url'; import { posix as path } from 'path'; import { performance } from 'perf_hooks'; import { SnowpackDevServer, ServerRuntime as SnowpackServerRuntime, SnowpackConfig, NotFoundError } from 'snowpack'; -import { CompileError } from 'astro-parser'; +import { CompileError } from '@astrojs/parser'; import { loadConfiguration, logger as snowpackLogger, startServer as startSnowpackServer } from 'snowpack'; import { canonicalURL, getSrcPath, stopTimer } from './build/util.js'; import { debug, info } from './logger.js'; diff --git a/tools/prettier-plugin-astro/index.js b/tools/prettier-plugin-astro/index.js index 8bfdcd3e8..f67476028 100644 --- a/tools/prettier-plugin-astro/index.js +++ b/tools/prettier-plugin-astro/index.js @@ -3,7 +3,7 @@ const { builders: { concat, hardline }, }, } = require('prettier'); -const { parse } = require('astro-parser'); +const { parse } = require('@astrojs/parser'); /** @type {Partial[]} */ module.exports.languages = [ diff --git a/tools/prettier-plugin-astro/package.json b/tools/prettier-plugin-astro/package.json index 0edf73d80..5dc8875a7 100644 --- a/tools/prettier-plugin-astro/package.json +++ b/tools/prettier-plugin-astro/package.json @@ -10,6 +10,6 @@ }, "dependencies": { "prettier": "^2.2.1", - "astro-parser": "0.11.0" + "@astrojs/parser": "^0.12.0" } }