Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sveltejs/svelte-eslint-parser
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.27.0
Choose a base ref
...
head repository: sveltejs/svelte-eslint-parser
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.28.0
Choose a head ref
  • 5 commits
  • 11 files changed
  • 4 contributors

Commits on May 2, 2023

  1. Copy the full SHA
    894f65e View commit details

Commits on May 9, 2023

  1. chore(deps): update dependency typescript-eslint-parser-for-extra-fil…

    …es to ^0.5.0 (#331)
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored May 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c09cc4b View commit details
  2. chore(deps): update dependency eslint-plugin-node-dependencies to ^0.…

    …11.0 (#330)
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored May 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    7fc5b69 View commit details
  3. feat: export meta object (#329)

    * feat: export meta object
    
    * fix: script
    
    * Create olive-birds-sort.md
    
    * update
    
    * chore: refactor
    ota-meshi authored May 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    45c958e View commit details
  4. chore: release svelte-eslint-parser (#332)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored May 9, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5cfccf9 View commit details
Showing with 93 additions and 8 deletions.
  1. +5 −0 .env-cmdrc
  2. +2 −0 .github/workflows/Release.yml
  3. +6 −0 CHANGELOG.md
  4. +1 −1 explorer-v2/src/app.html
  5. +9 −5 package.json
  6. +2 −2 src/index.ts
  7. +5 −0 src/meta.ts
  8. +13 −0 tests/src/meta.ts
  9. +11 −0 tools/lib/changesets-util.ts
  10. +38 −0 tools/update-meta.ts
  11. +1 −0 tsconfig.json
5 changes: 5 additions & 0 deletions .env-cmdrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version-ci": {
"IN_VERSION_CI_SCRIPT": "true"
}
}
2 changes: 2 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -33,6 +33,8 @@ jobs:
id: changesets
uses: changesets/action@v1
with:
# this expects you to have a npm script called version that runs some logic and then calls `changeset version`.
version: yarn version:ci
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
commit: "chore: release svelte-eslint-parser"
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# svelte-eslint-parser

## 0.28.0

### Minor Changes

- [#329](https://github.com/sveltejs/svelte-eslint-parser/pull/329) [`45c958e`](https://github.com/sveltejs/svelte-eslint-parser/commit/45c958e752ed2ea1b7d8df3fe21ffc0f7a664275) Thanks [@ota-meshi](https://github.com/ota-meshi)! - feat: export meta object

## 0.27.0

### Minor Changes
2 changes: 1 addition & 1 deletion explorer-v2/src/app.html
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />

%sveltekit.head%
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.37.1/min/vs/loader.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.38.0/min/vs/loader.min.js"></script>
</head>
<body>
<div id="svelte">%sveltekit.body%</div>
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-eslint-parser",
"version": "0.27.0",
"version": "0.28.0",
"description": "Svelte parser for ESLint",
"repository": "git+https://github.com/sveltejs/svelte-eslint-parser.git",
"homepage": "https://github.com/sveltejs/svelte-eslint-parser#readme",
@@ -26,7 +26,9 @@
],
"scripts": {
"benchmark": "yarn ts benchmark/index.ts",
"build": "tsc --project ./tsconfig.build.json",
"build": "yarn build:meta && yarn build:tsc",
"build:meta": "yarn ts ./tools/update-meta.ts",
"build:tsc": "tsc --project ./tsconfig.build.json",
"clean": "rimraf .nyc_output lib coverage",
"cover": "nyc --reporter=lcov yarn test",
"debug": "yarn mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
@@ -40,7 +42,8 @@
"release": "changeset publish",
"test": "yarn mocha \"tests/src/**/*.ts\" --reporter dot --timeout 60000",
"ts": "node -r esbuild-register",
"update-fixtures": "yarn ts ./tools/update-fixtures.ts"
"update-fixtures": "yarn ts ./tools/update-fixtures.ts",
"version:ci": "env-cmd -e version-ci yarn build:meta && changeset version"
},
"peerDependencies": {
"svelte": "^3.37.0"
@@ -71,6 +74,7 @@
"@typescript-eslint/parser": "~5.59.0",
"benchmark": "^2.1.4",
"chai": "^4.3.4",
"env-cmd": "^10.1.0",
"esbuild": "^0.17.0",
"esbuild-register": "^3.3.3",
"eslint": "^8.2.0",
@@ -79,7 +83,7 @@
"eslint-plugin-json-schema-validator": "^4.0.0",
"eslint-plugin-jsonc": "^2.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-node-dependencies": "^0.10.0",
"eslint-plugin-node-dependencies": "^0.11.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-regexp": "^1.5.0",
"eslint-plugin-svelte": "^2.0.0",
@@ -100,7 +104,7 @@
"svelte": "^3.57.0",
"svelte2tsx": "^0.6.11",
"typescript": "~5.0.0",
"typescript-eslint-parser-for-extra-files": "^0.4.0",
"typescript-eslint-parser-for-extra-files": "^0.5.0",
"vue-eslint-parser": "^9.0.0"
},
"publishConfig": {
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -3,11 +3,11 @@ import * as AST from "./ast";
import { traverseNodes } from "./traverse";
import { KEYS } from "./visitor-keys";
import { ParseError } from "./errors";
export * as meta from "./meta";
export { name } from "./meta";

export { AST, ParseError };

export const name = "svelte-eslint-parser";

// parser
export { parseForESLint };
// Keys
5 changes: 5 additions & 0 deletions src/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// IMPORTANT!
// This file has been automatically generated,
// in order to update its content execute "yarn build:meta"
export const name = "svelte-eslint-parser" as const;
export const version = "0.28.0" as const;
13 changes: 13 additions & 0 deletions tests/src/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import assert from "assert";
import * as parser from "../../src";
import { version } from "../../package.json";
const expectedMeta = {
name: "svelte-eslint-parser",
version,
};

describe("Test for meta object", () => {
it("A parser should have a meta object.", () => {
assert.deepStrictEqual(parser.meta, expectedMeta);
});
});
11 changes: 11 additions & 0 deletions tools/lib/changesets-util.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import getReleasePlan from "@changesets/get-release-plan";
import path from "path";

/** Get new version string from changesets */
export async function getNewVersion(): Promise<string> {
const releasePlan = await getReleasePlan(path.resolve(__dirname, "../.."));

return releasePlan.releases.find(
({ name }) => name === "svelte-eslint-parser"
)!.newVersion;
}
38 changes: 38 additions & 0 deletions tools/update-meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import fs from "fs";
import path from "path";
import { ESLint } from "eslint";
import { name, version } from "../package.json";
import { getNewVersion } from "./lib/changesets-util";

const META_PATH = path.join(__dirname, "../src/meta.ts");

void main();

/** main */
async function main() {
if (!fs.existsSync(META_PATH)) {
fs.writeFileSync(META_PATH, "", "utf8");
}
const eslint = new ESLint({ fix: true });
const [result] = await eslint.lintText(
`/*
* IMPORTANT!
* This file has been automatically generated,
* in order to update its content execute "yarn build:meta"
*/
export const name = ${JSON.stringify(name)} as const;
export const version = ${JSON.stringify(await getVersion())} as const;
`,
{ filePath: META_PATH }
);
fs.writeFileSync(META_PATH, result.output!);
}

/** Get version */
function getVersion() {
// eslint-disable-next-line no-process-env -- ignore
if (process.env.IN_VERSION_CI_SCRIPT) {
return getNewVersion();
}
return version;
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"esModuleInterop": true,
"resolveJsonModule": true,

"skipLibCheck": true
},