Move parser to the scoped package name (#319)

* Move parser to the scoped package name

* Prettier plugin should use 0.12 of the parser
This commit is contained in:
Matthew Phillips 2021-06-07 16:05:13 -04:00 committed by GitHub
parent cc532cddde
commit 5cc90f9dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 22 additions and 22 deletions

View file

@ -2,7 +2,7 @@
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json", "$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json",
"changelog": "@changesets/cli/changelog", "changelog": "@changesets/cli/changelog",
"commit": false, "commit": false,
"linked": [["astro", "astro-parser"]], "linked": [["astro", "@astrojs/parser"]],
"access": "public", "access": "public",
"baseBranch": "main", "baseBranch": "main",
"updateInternalDependencies": "patch", "updateInternalDependencies": "patch",

View file

@ -21,7 +21,7 @@ jobs:
- run: yarn --frozen-lockfile --ignore-engines - run: yarn --frozen-lockfile --ignore-engines
env: env:
CI: true CI: true
- run: yarn lerna run build --scope astro-parser - run: yarn lerna run build --scope @astrojs/parser
- run: yarn format - run: yarn format
- name: Commit changes - name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4 uses: stefanzweifel/git-auto-commit-action@v4

View file

@ -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. 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 ```shell
cd packages/astro cd packages/astro

View file

@ -6,9 +6,9 @@
"release": "yarn build && yarn changeset publish", "release": "yarn build && yarn changeset publish",
"benchmark": "yarn workspace astro run benchmark", "benchmark": "yarn workspace astro run benchmark",
"build": "yarn build:core", "build": "yarn build:core",
"build:core": "lerna run build --scope astro --scope astro-parser --scope @astrojs/markdown-support", "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 astro-parser", "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 astro-parser --parallel --stream", "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}\"", "format": "prettier -w \"**/*.{js,jsx,ts,tsx,md,json}\"",
"lint": "eslint \"packages/**/*.ts\"", "lint": "eslint \"packages/**/*.ts\"",
"test": "lerna run test --scope astro --stream", "test": "lerna run test --scope astro --stream",

View file

@ -1,4 +1,4 @@
# astro-parser # @astrojs/parser
## 0.12.1 ## 0.12.1

View file

@ -1,5 +1,5 @@
{ {
"name": "astro-parser", "name": "@astrojs/parser",
"version": "0.12.1", "version": "0.12.1",
"author": "Skypack", "author": "Skypack",
"license": "MIT", "license": "MIT",

View file

@ -37,6 +37,7 @@
}, },
"dependencies": { "dependencies": {
"@astrojs/markdown-support": "0.1.1", "@astrojs/markdown-support": "0.1.1",
"@astrojs/parser": "0.12.1",
"@astrojs/prism": "0.2.0", "@astrojs/prism": "0.2.0",
"@astrojs/renderer-preact": "0.1.0", "@astrojs/renderer-preact": "0.1.0",
"@astrojs/renderer-react": "0.1.0", "@astrojs/renderer-react": "0.1.0",
@ -51,7 +52,6 @@
"@snowpack/plugin-sass": "^1.4.0", "@snowpack/plugin-sass": "^1.4.0",
"acorn": "^7.4.0", "acorn": "^7.4.0",
"astring": "^1.7.4", "astring": "^1.7.4",
"astro-parser": "0.12.1",
"autoprefixer": "^10.2.5", "autoprefixer": "^10.2.5",
"cheerio": "^1.0.0-rc.6", "cheerio": "^1.0.0-rc.6",
"del": "^6.0.0", "del": "^6.0.0",

View file

@ -1,4 +1,4 @@
import type { TemplateNode } from 'astro-parser'; import type { TemplateNode } from '@astrojs/parser';
import type { CompileOptions } from './compiler'; import type { CompileOptions } from './compiler';
export type VisitorFn<T = TemplateNode> = (this: { skip: () => void; remove: () => void; replace: (node: T) => void }, node: T, parent: T, type: string, index: number) => void; export type VisitorFn<T = TemplateNode> = (this: { skip: () => void; remove: () => void; replace: (node: T) => void }, node: T, parent: T, type: string, index: number) => void;

View file

@ -1,5 +1,5 @@
import 'source-map-support/register.js'; import 'source-map-support/register.js';
import type { Attribute } from 'astro-parser'; import type { Attribute } from '@astrojs/parser';
// AST utility functions // AST utility functions

View file

@ -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 { CompileOptions } from '../../@types/compiler';
import type { AstroConfig, AstroMarkdownOptions, TransformResult, ComponentInfo, Components } from '../../@types/astro'; import type { AstroConfig, AstroMarkdownOptions, TransformResult, ComponentInfo, Components } from '../../@types/astro';
import type { ImportDeclaration, ExportNamedDeclaration, VariableDeclarator, Identifier, ImportDefaultSpecifier } from '@babel/types'; 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 eslexer from 'es-module-lexer';
import esbuild from 'esbuild'; import esbuild from 'esbuild';
import path from 'path'; import path from 'path';
import { parse } from 'astro-parser'; import { parse } from '@astrojs/parser';
import { walk, asyncWalk } from 'estree-walker'; import { walk, asyncWalk } from 'estree-walker';
import _babelGenerator from '@babel/generator'; import _babelGenerator from '@babel/generator';
import babelParser from '@babel/parser'; import babelParser from '@babel/parser';

View file

@ -5,7 +5,7 @@ import type { CompileOptions } from '../@types/compiler.js';
import path from 'path'; import path from 'path';
import { renderMarkdownWithFrontmatter } from '@astrojs/markdown-support'; import { renderMarkdownWithFrontmatter } from '@astrojs/markdown-support';
import { parse } from 'astro-parser'; import { parse } from '@astrojs/parser';
import { transform } from './transform/index.js'; import { transform } from './transform/index.js';
import { codegen } from './codegen/index.js'; import { codegen } from './codegen/index.js';

View file

@ -1,5 +1,5 @@
import type { Transformer, TransformOptions } from '../../@types/transformer'; 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] */ /** If there are hydrated components, inject styles for [data-astro-root] and [data-astro-children] */
export default function (opts: TransformOptions): Transformer { export default function (opts: TransformOptions): Transformer {

View file

@ -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 type { NodeVisitor, TransformOptions, Transformer, VisitorFn } from '../../@types/transformer';
import { walk } from 'estree-walker'; import { walk } from 'estree-walker';

View file

@ -1,5 +1,5 @@
import type { Transformer } from '../../@types/transformer'; 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'; import { getAttrValue } from '../../ast.js';
export const PRISM_IMPORT = `import Prism from 'astro/components/Prism.astro';`; export const PRISM_IMPORT = `import Prism from 'astro/components/Prism.astro';`;

View file

@ -1,5 +1,5 @@
import type { TransformOptions, Transformer } from '../../@types/transformer'; import type { TransformOptions, Transformer } from '../../@types/transformer';
import type { TemplateNode } from 'astro-parser'; import type { TemplateNode } from '@astrojs/parser';
import crypto from 'crypto'; import crypto from 'crypto';
import { createRequire } from 'module'; import { createRequire } from 'module';

View file

@ -1,5 +1,5 @@
import 'source-map-support/register.js'; 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 { bold, blue, red, grey, underline } from 'kleur/colors';
import { Writable } from 'stream'; import { Writable } from 'stream';
import { format as utilFormat } from 'util'; import { format as utilFormat } from 'util';

View file

@ -8,7 +8,7 @@ import { fileURLToPath, pathToFileURL } from 'url';
import { posix as path } from 'path'; import { posix as path } from 'path';
import { performance } from 'perf_hooks'; import { performance } from 'perf_hooks';
import { SnowpackDevServer, ServerRuntime as SnowpackServerRuntime, SnowpackConfig, NotFoundError } from 'snowpack'; 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 { loadConfiguration, logger as snowpackLogger, startServer as startSnowpackServer } from 'snowpack';
import { canonicalURL, getSrcPath, stopTimer } from './build/util.js'; import { canonicalURL, getSrcPath, stopTimer } from './build/util.js';
import { debug, info } from './logger.js'; import { debug, info } from './logger.js';

View file

@ -3,7 +3,7 @@ const {
builders: { concat, hardline }, builders: { concat, hardline },
}, },
} = require('prettier'); } = require('prettier');
const { parse } = require('astro-parser'); const { parse } = require('@astrojs/parser');
/** @type {Partial<import('prettier').SupportLanguage>[]} */ /** @type {Partial<import('prettier').SupportLanguage>[]} */
module.exports.languages = [ module.exports.languages = [

View file

@ -10,6 +10,6 @@
}, },
"dependencies": { "dependencies": {
"prettier": "^2.2.1", "prettier": "^2.2.1",
"astro-parser": "0.11.0" "@astrojs/parser": "^0.12.0"
} }
} }