@esmate/prettier 0.0.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,23 +1 @@
1
- # Rslib project
2
-
3
- ## Setup
4
-
5
- Install the dependencies:
6
-
7
- ```bash
8
- pnpm install
9
- ```
10
-
11
- ## Get started
12
-
13
- Build the library:
14
-
15
- ```bash
16
- pnpm build
17
- ```
18
-
19
- Build the library in watch mode:
20
-
21
- ```bash
22
- pnpm dev
23
- ```
1
+ # @esmate/prettier
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@esmate/prettier",
3
3
  "type": "module",
4
- "version": "0.0.2",
4
+ "version": "1.0.0",
5
5
  "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/viendinhcom/esmate.git"
9
+ },
6
10
  "exports": {
7
11
  ".": {
8
12
  "types": "./dist/index.d.ts",
@@ -13,16 +17,6 @@
13
17
  "files": [
14
18
  "dist"
15
19
  ],
16
- "scripts": {
17
- "build": "rslib build",
18
- "watch": "rslib build --watch",
19
- "prepack": "rslib build",
20
- "lint": "eslint",
21
- "lint:fix": "eslint --fix"
22
- },
23
- "peerDependencies": {
24
- "prettier": "^3.5.3"
25
- },
26
20
  "dependencies": {
27
21
  "make-synchronized": "^0.7.2",
28
22
  "prettier-plugin-astro": "^0.14.1",
@@ -32,9 +26,17 @@
32
26
  "devDependencies": {
33
27
  "@rslib/core": "^0.7.1",
34
28
  "@types/node": "^22.8.1",
29
+ "eslint": "^9.27.0",
30
+ "prettier": "^3.5.3",
35
31
  "typescript": "^5.8.3"
36
32
  },
37
33
  "publishConfig": {
38
34
  "access": "public"
35
+ },
36
+ "scripts": {
37
+ "build": "rslib build",
38
+ "dev": "rslib build --watch",
39
+ "fix": "prettier --write . && eslint --fix .",
40
+ "check": "tsc && prettier --check . && eslint ."
39
41
  }
40
- }
42
+ }
package/dist/index.d.ts DELETED
@@ -1,32 +0,0 @@
1
- import type { Config } from "prettier";
2
- import type { AstroOptions } from "./plugins/astro";
3
- import type { SvelteOptions } from "./plugins/svelte";
4
- import type { TailwindOptions } from "./plugins/tailwind";
5
- interface Options {
6
- /**
7
- * Enable Astro support.
8
- *
9
- * http://npm.im/prettier-plugin-astro
10
- */
11
- astro?: boolean | AstroOptions;
12
- /**
13
- * Ignores files from formatting.
14
- *
15
- * So you don't have to use .prettierignore file.
16
- */
17
- ignores?: string[];
18
- /**
19
- * Enable Svelte support.
20
- *
21
- * http://npm.im/prettier-plugin-svelte
22
- */
23
- svelte?: boolean | SvelteOptions;
24
- /**
25
- * Enable TailwindCSS support.
26
- *
27
- * http://npm.im/prettier-plugin-tailwindcss
28
- */
29
- tailwind?: boolean | TailwindOptions;
30
- }
31
- export declare function defineConfig(options?: Options, config?: Config): Config;
32
- export {};
package/dist/index.js DELETED
@@ -1,63 +0,0 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__ from "./utils.js";
2
- function defineConfig(options, config) {
3
- const defaultConfig = {
4
- semi: true,
5
- tabWidth: 2,
6
- useTabs: false,
7
- printWidth: 120,
8
- endOfLine: "auto",
9
- singleQuote: false,
10
- proseWrap: "always",
11
- trailingComma: "all"
12
- };
13
- const configs = [
14
- config || {}
15
- ];
16
- const plugins = config?.plugins || [];
17
- const overrides = config?.overrides || [];
18
- {
19
- const ignores = [
20
- "pnpm-lock.yaml"
21
- ];
22
- if (options?.ignores) ignores.push(...options.ignores);
23
- overrides.push({
24
- files: ignores,
25
- options: {
26
- requirePragma: true
27
- }
28
- });
29
- }
30
- if (options?.astro) {
31
- plugins.push((0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.importPlugin)("astro"));
32
- configs.push(true === options.astro ? {} : options.astro);
33
- overrides.push({
34
- files: "*.astro",
35
- options: {
36
- parser: "astro"
37
- }
38
- });
39
- }
40
- if (options?.svelte) {
41
- plugins.push((0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.importPlugin)("svelte"));
42
- configs.push(true === options.svelte ? {} : options.svelte);
43
- overrides.push({
44
- files: "*.svelte",
45
- options: {
46
- parser: "svelte"
47
- }
48
- });
49
- }
50
- if (options?.tailwind) {
51
- plugins.push((0, __WEBPACK_EXTERNAL_MODULE__utils_js_d88b7fe1__.importPlugin)("tailwind"));
52
- configs.push(true === options.tailwind ? {} : options.tailwind);
53
- }
54
- return {
55
- ...configs.reduce((prev, curr)=>({
56
- ...prev,
57
- ...curr
58
- }), defaultConfig),
59
- plugins,
60
- overrides
61
- };
62
- }
63
- export { defineConfig };
@@ -1,5 +0,0 @@
1
- export * from "prettier-plugin-astro";
2
- export interface AstroOptions {
3
- astroAllowShorthand?: boolean;
4
- astroSkipFrontmatter?: boolean;
5
- }
@@ -1 +0,0 @@
1
- export * from "prettier-plugin-astro";
@@ -1,2 +0,0 @@
1
- export * from "prettier-plugin-svelte";
2
- export type { PluginConfig as SvelteOptions } from "prettier-plugin-svelte";
@@ -1 +0,0 @@
1
- export * from "prettier-plugin-svelte";
@@ -1,2 +0,0 @@
1
- export * from "prettier-plugin-tailwindcss";
2
- export type { PluginOptions as TailwindOptions } from "prettier-plugin-tailwindcss";
@@ -1 +0,0 @@
1
- export * from "prettier-plugin-tailwindcss";
package/dist/utils.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import type { Config } from "prettier";
2
- declare const _default: (defaultConfig?: Config | undefined) => Config;
3
- export default _default;
4
- export declare function importPlugin(plugin: string): string;
package/dist/utils.js DELETED
@@ -1,19 +0,0 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
2
- import * as __WEBPACK_EXTERNAL_MODULE_make_synchronized_25569d3e__ from "make-synchronized";
3
- import * as __WEBPACK_EXTERNAL_MODULE_prettier__ from "prettier";
4
- const utils = (0, __WEBPACK_EXTERNAL_MODULE_make_synchronized_25569d3e__["default"])(import.meta, async (defaultConfig = {})=>{
5
- const configFile = await (0, __WEBPACK_EXTERNAL_MODULE_prettier__.resolveConfigFile)();
6
- if (configFile) {
7
- const userConfig = await (0, __WEBPACK_EXTERNAL_MODULE_prettier__.resolveConfig)(configFile);
8
- return {
9
- ...defaultConfig,
10
- ...userConfig
11
- };
12
- }
13
- return defaultConfig;
14
- });
15
- function importPlugin(plugin) {
16
- const __dirname = new URL(".", import.meta.url).pathname;
17
- return __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(__dirname, "plugins", `${plugin}.js`);
18
- }
19
- export { utils as default, importPlugin };