Skip to content

Commit

Permalink
fix config path and tasks script
Browse files Browse the repository at this point in the history
  • Loading branch information
yyyyaaa committed Sep 14, 2024
1 parent 607de15 commit 2d6fc4a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions compiler/plugins/vue.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const { parse } = require("@babel/parser");
const traverse = require("@babel/traverse").default;
const generate = require("@babel/generator").default;
const t = require("@babel/types");
const { vueCodemod } = require("../../packages/vue-codemod");

/**
* @type {import('@builder.io/mitosis').Plugin}
Expand All @@ -20,7 +19,7 @@ module.exports = function vueCompilerPlugin() {
code: {
// Happens before formatting
pre: (codeStr) => {
return [fixVueClassName, vueCodemod].reduce((acc, transform) => {
return [fixVueClassName].reduce((acc, transform) => {
acc = transform(acc);
return acc;
}, codeStr);
Expand Down
6 changes: 5 additions & 1 deletion packages/compiler/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ interface CompileOptions {
extension: string;
state: string;
styles: string;
api?: string;
isDev?: boolean;
customReplace?: (props: CustomReplaceProps) => void;
}
Expand Down Expand Up @@ -310,6 +311,8 @@ export async function compile(rawOptions: CompileParams): Promise<void> {
const to =
options.target === "webcomponents" ? "webcomponent" : options.target;

const configPath = path.resolve(__dirname, "./mitosis.config.js");

await compileCommand.run({
parameters: {
options: {
Expand All @@ -319,8 +322,9 @@ export async function compile(rawOptions: CompileParams): Promise<void> {
force: true,
state: options.state,
styles: options.styles,
api: options.api,
outFile: outPath,
config: "./mitosis.config.js",
config: configPath,
},
array: [filepath],
},
Expand Down
13 changes: 5 additions & 8 deletions packages/compiler/src/plugins/vue.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { parse } = require("@babel/parser");
const traverse = require("@babel/traverse").default;
const generate = require("@babel/generator").default;
const t = require("@babel/types");
const vueCodemod = require("@interchain-ui/vue-codemod");
import vueCodemod from "@interchain-ui/vue-codemod";

/**
* @type {import('@builder.io/mitosis').Plugin}
Expand All @@ -20,13 +20,10 @@ module.exports = function vueCompilerPlugin() {
code: {
// Happens before formatting
pre: (codeStr) => {
return [fixVueClassName, vueCodemod.default].reduce(
(acc, transform) => {
acc = transform(acc);
return acc;
},
codeStr,
);
return [fixVueClassName, vueCodemod].reduce((acc, transform) => {
acc = transform(acc);
return acc;
}, codeStr);
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/src/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const shouldSkipBundling = process.env.NO_BUILD === "true";
title: `Compile ${platform}`,
task: () =>
execa(
`node ./compiler/frameworks/${platform}.compile.js ${
`tsx packages/compiler/src/frameworks/${platform}.compile.ts ${
cliConfig.elements
? `--elements ${cliConfig.elements.join(" ")}`
: ""
Expand Down

0 comments on commit 2d6fc4a

Please sign in to comment.