@hubol/smooch 1.0.0-beta.6 → 1.0.0-beta.7

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.
Files changed (3) hide show
  1. package/index.js +22 -8956
  2. package/package.json +1 -1
  3. package/template-api.d.ts +147 -34
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubol/smooch",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0-beta.7",
4
4
  "description": "Generate texture atlases, browser-compatible audio, and source code from directories",
5
5
  "bin": {
6
6
  "smooch": "index.js"
package/template-api.d.ts CHANGED
@@ -1,3 +1,149 @@
1
+ declare namespace Boundary_Prettier {
2
+ interface PrinterOptions {
3
+ /**
4
+ * Specify the line length that the printer will wrap on.
5
+ * @default 80
6
+ */
7
+ printWidth: number;
8
+ /**
9
+ * Specify the number of spaces per indentation-level.
10
+ * @default 2
11
+ */
12
+ tabWidth: number;
13
+ /**
14
+ * Indent lines with tabs instead of spaces
15
+ * @default false
16
+ */
17
+ useTabs?: boolean;
18
+ parentParser?: string | undefined;
19
+ __embeddedInHtml?: boolean | undefined;
20
+ }
21
+ type LiteralUnion<T extends U, U = string> = T | (Pick<U, never> & {
22
+ _?: never | undefined;
23
+ });
24
+ export type BuiltInParserName = "acorn" | "angular" | "babel-flow" | "babel-ts" | "babel" | "css" | "espree" | "flow" | "glimmer" | "graphql" | "html" | "json-stringify" | "json" | "json5" | "less" | "lwc" | "markdown" | "mdx" | "meriyah" | "scss" | "typescript" | "vue" | "yaml";
25
+ export interface Options extends PrinterOptions {
26
+ /**
27
+ * Print semicolons at the ends of statements.
28
+ * @default true
29
+ */
30
+ semi: boolean;
31
+ /**
32
+ * Use single quotes instead of double quotes.
33
+ * @default false
34
+ */
35
+ singleQuote: boolean;
36
+ /**
37
+ * Use single quotes in JSX.
38
+ * @default false
39
+ */
40
+ jsxSingleQuote: boolean;
41
+ /**
42
+ * Print trailing commas wherever possible.
43
+ * @default "all"
44
+ */
45
+ trailingComma: "none" | "es5" | "all";
46
+ /**
47
+ * Print spaces between brackets in object literals.
48
+ * @default true
49
+ */
50
+ bracketSpacing: boolean;
51
+ /**
52
+ * Put the `>` of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being
53
+ * alone on the next line (does not apply to self closing elements).
54
+ * @default false
55
+ */
56
+ bracketSameLine: boolean;
57
+ /**
58
+ * Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
59
+ * @default false
60
+ * @deprecated use bracketSameLine instead
61
+ */
62
+ jsxBracketSameLine: boolean;
63
+ /**
64
+ * Format only a segment of a file.
65
+ * @default 0
66
+ */
67
+ rangeStart: number;
68
+ /**
69
+ * Format only a segment of a file.
70
+ * @default Number.POSITIVE_INFINITY
71
+ */
72
+ rangeEnd: number;
73
+ /**
74
+ * Specify which parser to use.
75
+ */
76
+ parser: LiteralUnion<BuiltInParserName>;
77
+ /**
78
+ * Specify the input filepath. This will be used to do parser inference.
79
+ */
80
+ filepath: string;
81
+ /**
82
+ * Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file.
83
+ * This is very useful when gradually transitioning large, unformatted codebases to prettier.
84
+ * @default false
85
+ */
86
+ requirePragma: boolean;
87
+ /**
88
+ * Prettier can insert a special @format marker at the top of files specifying that
89
+ * the file has been formatted with prettier. This works well when used in tandem with
90
+ * the --require-pragma option. If there is already a docblock at the top of
91
+ * the file then this option will add a newline to it with the @format marker.
92
+ * @default false
93
+ */
94
+ insertPragma: boolean;
95
+ /**
96
+ * By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer.
97
+ * In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out.
98
+ * @default "preserve"
99
+ */
100
+ proseWrap: "always" | "never" | "preserve";
101
+ /**
102
+ * Include parentheses around a sole arrow function parameter.
103
+ * @default "always"
104
+ */
105
+ arrowParens: "avoid" | "always";
106
+ /**
107
+ * Provide ability to support new languages to prettier.
108
+ */
109
+ plugins: Array<string | Plugin>;
110
+ /**
111
+ * How to handle whitespaces in HTML.
112
+ * @default "css"
113
+ */
114
+ htmlWhitespaceSensitivity: "css" | "strict" | "ignore";
115
+ /**
116
+ * Which end of line characters to apply.
117
+ * @default "lf"
118
+ */
119
+ endOfLine: "auto" | "lf" | "crlf" | "cr";
120
+ /**
121
+ * Change when properties in objects are quoted.
122
+ * @default "as-needed"
123
+ */
124
+ quoteProps: "as-needed" | "consistent" | "preserve";
125
+ /**
126
+ * Whether or not to indent the code inside <script> and <style> tags in Vue files.
127
+ * @default false
128
+ */
129
+ vueIndentScriptAndStyle: boolean;
130
+ /**
131
+ * Control whether Prettier formats quoted code embedded in the file.
132
+ * @default "auto"
133
+ */
134
+ embeddedLanguageFormatting: "auto" | "off";
135
+ /**
136
+ * Enforce single attribute per line in HTML, Vue and JSX.
137
+ * @default false
138
+ */
139
+ singleAttributePerLine: boolean;
140
+ }
141
+ export interface Api {
142
+ format(source: string, options?: Options): Promise<string>;
143
+ }
144
+ export {};
145
+ }
146
+
1
147
  interface Options {
2
148
  splitRegexp?: RegExp | RegExp[];
3
149
  stripRegexp?: RegExp | RegExp[];
@@ -9,46 +155,13 @@ declare function pascalCase(input: string, options?: Options): string;
9
155
 
10
156
  declare function camelCase(input: string, options?: Options): string;
11
157
 
12
- declare function jsBeautify(source: string, options?: JSBeautifyOptions): string;
13
- interface CoreBeautifyOptions {
14
- disabled?: boolean | undefined;
15
- eol?: string | undefined;
16
- end_with_newline?: boolean | undefined;
17
- indent_size?: number | undefined;
18
- indent_char?: string | undefined;
19
- indent_level?: number | undefined;
20
- preserve_newlines?: boolean | undefined;
21
- max_preserve_newlines?: number | undefined;
22
- indent_with_tabs?: boolean | undefined;
23
- wrap_line_length?: number | undefined;
24
- indent_empty_lines?: boolean | undefined;
25
- templating?: string[] | undefined;
26
- }
27
- interface JSBeautifyOptions extends CoreBeautifyOptions {
28
- brace_style?: 'collapse' | 'expand' | 'end-expand' | 'none' | 'preserve-inline' | undefined;
29
- unindent_chained_methods?: boolean | undefined;
30
- break_chained_methods?: boolean | undefined;
31
- space_in_paren?: boolean | undefined;
32
- space_in_empty_paren?: boolean | undefined;
33
- jslint_happy?: boolean | undefined;
34
- space_after_anon_function?: boolean | undefined;
35
- space_after_named_function?: boolean | undefined;
36
- keep_array_indentation?: boolean | undefined;
37
- space_before_conditional?: boolean | undefined;
38
- unescape_strings?: boolean | undefined;
39
- e4x?: boolean | undefined;
40
- comma_first?: boolean | undefined;
41
- operator_position?: 'before-newline' | 'after-newline' | 'preserve-newline' | undefined;
42
- test_output_raw?: boolean | undefined;
43
- }
44
-
45
158
  declare const utils: {
46
159
  camel: typeof camelCase;
47
160
  pascal: typeof pascalCase;
48
161
  noext: (string: string) => string;
49
162
  json: (object: any) => string;
50
163
  oneline: (string: string) => string;
51
- beautify: typeof jsBeautify;
164
+ format: (source: string, options?: Boundary_Prettier.Options | undefined) => Promise<string>;
52
165
  };
53
166
  type Utils = typeof utils;
54
167