Skip to content

Commit

Permalink
chore: copy stuff from embed
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Jan 29, 2025
1 parent bc589e5 commit b9a3bcb
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 86 deletions.
11 changes: 2 additions & 9 deletions .autorc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
"plugins": [
"npm",
"conventional-commits",
"first-time-contributor",
"released"
],
"plugins": ["npm", "conventional-commits", "first-time-contributor", "released"],
"baseBranch": "stable",
"prereleaseBranches": [
"next"
]
"prereleaseBranches": ["next"]
}
79 changes: 41 additions & 38 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,46 +1,44 @@
import tseslint from "@typescript-eslint/eslint-plugin";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import tsParser from "@typescript-eslint/parser";
import prettier from "eslint-plugin-prettier";
import prettierConfig from "eslint-config-prettier";
import prettierConfig from "eslint-plugin-prettier/recommended";
import globals from "globals";

delete globals.browser["AudioWorkletGlobalScope "];

/**
* @type {import('eslint').Linter.Config[]}
*/
export default [
{
ignores: ["build/**"],
ignores: ["prettier.config.js", "build/**", "coverage/**"],
},
prettierConfig,
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
files: ["**/*.{js,ts}"],
languageOptions: {
parser: tsParser,
parserOptions: {
project: "./tsconfig.json",
sourceType: "module",
project: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: ["**/*.{js,ts}"],
languageOptions: {
parser: tsParser,
globals: {
window: false,
document: false,
...globals.browser,
},
},
plugins: {
"@typescript-eslint": tseslint,
prettier: prettier,
},
rules: {
...tseslint.configs.recommended.rules,
"prettier/prettier": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
Expand All @@ -49,31 +47,36 @@ export default [
ignoreRestSiblings: true,
},
],
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/consistent-type-assertions": [
"error",
{
assertionStyle: "as",
objectLiteralTypeAssertions: "allow-as-parameter",
},
],
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/unbound-method": "off",
"@typescript-eslint/no-base-to-string": "off",
"@typescript-eslint/no-unnecessary-type-assertion": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-misused-promises": "off",
"linebreak-style": ["error", "unix"],
"no-irregular-whitespace": [
"error",
{
skipComments: true,
},
],
"no-irregular-whitespace": ["error", { skipComments: true }],
"no-alert": "error",
"prefer-const": "error",
"no-return-assign": "error",
"no-useless-call": "error",
"no-useless-concat": "error",
"no-console": "off",
"no-undef": "off",
"no-unreachable": "off",
"prefer-template": "error",
"no-unused-vars": "off",
// "no-undef": "off", // typescript takes care of this for us
"no-unreachable": "off", // typescript takes care of this for us
},
},
prettierConfig,
{
files: ["**/*.mjs"],
...tseslint.configs.disableTypeChecked,
},
];
29 changes: 26 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,30 @@
"@babel/plugin-transform-runtime": "^7.25.9",
"@babel/preset-env": "^7.26.0",
"@babel/preset-typescript": "^7.26.0",
"@eslint/js": "^9.19.0",
"@release-it/conventional-changelog": "^9.0.2",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.0",
"@rollup/plugin-terser": "^0.4.4",
"@typescript-eslint/eslint-plugin": "^8.22.0",
"@typescript-eslint/parser": "^8.22.0",
"browser-sync": "^3.0.3",
"concurrently": "^9.0.1",
"eslint": "^9.0.0",
"eslint": "^9.19.0",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-prettier": "^5.2.1",
"gh-pages": "^6.2.0",
"prettier": "^3.3.3",
"release-it": "^17.10.0",
"rollup": "^4.24.3",
"rimraf": "^6.0.1",
"rollup": "^4.24.3",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-ts": "^3.4.5",
"typescript": "~5.3.3",
"typescript-eslint": "^8.22.0",
"vega": "^5.30.0",
"vega-lite": "^5.21.0"
},
"peerDependencies": {
"vega": "*",
"vega-lite": "*"
},
"dependencies": {}
}
}
51 changes: 26 additions & 25 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import json from '@rollup/plugin-json';
import resolve from '@rollup/plugin-node-resolve';
import terser from '@rollup/plugin-terser';
import bundleSize from 'rollup-plugin-bundle-size';
import ts from 'rollup-plugin-ts';
import json from "@rollup/plugin-json";
import resolve from "@rollup/plugin-node-resolve";
import terser from "@rollup/plugin-terser";
import bundleSize from "rollup-plugin-bundle-size";
import ts from "rollup-plugin-ts";

import pkg from './package.json' with { type: 'json' };
import pkg from "./package.json" with { type: "json" };

const plugins = (browserslist, declaration) => [
resolve(),
Expand All @@ -13,41 +13,42 @@ const plugins = (browserslist, declaration) => [
tsconfig: (resolvedConfig) => ({
...resolvedConfig,
declaration,
declarationMap: declaration
declarationMap: declaration,
}),
transpiler: 'babel',
browserslist
transpiler: "babel",
browserslist,
}),
bundleSize()
bundleSize(),
];

const outputs = [
{
input: 'src/index.ts',
input: "src/index.ts",
output: {
file: pkg.module,
format: 'esm'
format: "esm",
},
plugins: plugins(false, true)
}, {
input: 'src/index.ts',
plugins: plugins(false, true),
},
{
input: "src/index.ts",
output: [
{
file: pkg.main,
format: 'umd',
name: 'vegaThemes',
exports: 'named'
format: "umd",
name: "vegaThemes",
exports: "named",
},
{
file: pkg.unpkg,
format: 'umd',
name: 'vegaThemes',
exports: 'named',
plugins: [terser()]
}
format: "umd",
name: "vegaThemes",
exports: "named",
plugins: [terser()],
},
],
plugins: plugins('defaults', false),
}
plugins: plugins("defaults", false),
},
];

export default outputs;
7 changes: 2 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,5 @@
"importHelpers": true,
"resolveJsonModule": true
},
"include": [
"src/**/*.ts",
"test/**/*.ts"
]
}
"include": ["src/**/*.ts", "test/**/*.ts"]
}

0 comments on commit b9a3bcb

Please sign in to comment.