Skip to content

Commit

Permalink
Merge pull request #208 from gitKrystan/type-module
Browse files Browse the repository at this point in the history
  • Loading branch information
gitKrystan authored Dec 27, 2023
2 parents f9058c2 + 2598533 commit cd33b51
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions examples/bin/test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ const run = async () => {
'./node_modules/prettier/bin/prettier.cjs',
'.',
'--write',
'--plugin',
'prettier-plugin-ember-template-tag',
debug ? '--log-level' : null,
debug ? 'debug' : null,
].filter(Boolean),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"email": "[email protected]",
"name": "Krystan HuffMenne"
},
"type": "commonjs",
"type": "module",
"main": "dist/prettier-plugin-ember-template-tag.js",
"license": "MIT",
"repository": {
Expand Down
10 changes: 5 additions & 5 deletions src/parse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { Preprocessor } from 'content-tag';
import type { Parser } from 'prettier';
import { parsers as babelParsers } from 'prettier/plugins/babel.js';

import { PRINTER_NAME } from '../config';
import { PRINTER_NAME } from '../config.js';
import type { Options } from '../options.js';
import type { GlimmerTemplate, RawGlimmerTemplate } from '../types/glimmer';
import { isDefaultTemplate } from '../types/glimmer';
import { assert } from '../utils';
import { preprocessTemplateRange } from './preprocess';
import type { GlimmerTemplate, RawGlimmerTemplate } from '../types/glimmer.js';
import { isDefaultTemplate } from '../types/glimmer.js';
import { assert } from '../utils/index.js';
import { preprocessTemplateRange } from './preprocess.js';

const typescript = babelParsers['babel-ts'] as Parser<Node | undefined>;
const p = new Preprocessor();
Expand Down
2 changes: 1 addition & 1 deletion src/parse/preprocess.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RawGlimmerTemplate } from '../types/glimmer';
import type { RawGlimmerTemplate } from '../types/glimmer.js';

function replaceRange(
original: string,
Expand Down
11 changes: 7 additions & 4 deletions src/print/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ import type {
import { printers as estreePrinters } from 'prettier/plugins/estree.js';

import type { Options } from '../options.js';
import { getGlimmerTemplate, isGlimmerTemplate } from '../types/glimmer';
import { assert } from '../utils';
import { fixPreviousPrint, saveCurrentPrintOnSiblingNode } from './ambiguity';
import { printTemplateContent, printTemplateTag } from './template';
import { getGlimmerTemplate, isGlimmerTemplate } from '../types/glimmer.js';
import { assert } from '../utils/index.js';
import {
fixPreviousPrint,
saveCurrentPrintOnSiblingNode,
} from './ambiguity.js';
import { printTemplateContent, printTemplateTag } from './template.js';

const estreePrinter = estreePrinters['estree'] as Printer<Node | undefined>;

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"sourceMap": true,
"resolveJsonModule": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"noEmit": true,

"paths": {
Expand Down
4 changes: 1 addition & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-expect-error https://github.com/vitejs/vite/issues/11552

import { defineConfig } from 'vite';

export default defineConfig({
Expand All @@ -9,7 +7,7 @@ export default defineConfig({
},
lib: {
entry: 'src/main.ts',
formats: ['cjs'],
formats: ['es'],
},
minify: false,
},
Expand Down

0 comments on commit cd33b51

Please sign in to comment.