@builder.io/mitosis 0.0.124 → 0.0.126
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/dist/src/generators/alpine/generate.js +4 -4
- package/dist/src/generators/context/react.js +1 -1
- package/dist/src/generators/context/rsc.js +1 -1
- package/dist/src/generators/context/solid.js +1 -1
- package/dist/src/generators/context/svelte.js +1 -1
- package/dist/src/generators/helpers/rsc.d.ts +2 -0
- package/dist/src/generators/helpers/rsc.js +39 -0
- package/dist/src/generators/lit/generate.js +4 -4
- package/dist/src/generators/marko/generate.js +5 -5
- package/dist/src/generators/mitosis.js +1 -1
- package/dist/src/generators/qwik/component-generator.js +1 -1
- package/dist/src/generators/react/blocks.js +2 -2
- package/dist/src/generators/react/generator.js +25 -16
- package/dist/src/generators/react/helpers.js +2 -2
- package/dist/src/generators/react/state.js +3 -3
- package/dist/src/generators/react-native/index.js +4 -4
- package/dist/src/generators/rsc.d.ts +0 -2
- package/dist/src/generators/rsc.js +3 -30
- package/dist/src/generators/solid/blocks.js +3 -3
- package/dist/src/generators/solid/index.js +5 -5
- package/dist/src/generators/stencil/generate.js +3 -3
- package/dist/src/generators/svelte/blocks.js +1 -1
- package/dist/src/generators/svelte/svelte.js +8 -8
- package/dist/src/generators/vue/blocks.js +2 -2
- package/dist/src/generators/vue/compositionApi.js +2 -2
- package/dist/src/generators/vue/helpers.js +4 -4
- package/dist/src/generators/vue/optionsApi.js +2 -2
- package/dist/src/generators/vue/vue.js +4 -4
- package/dist/src/helpers/component-file-extensions.d.ts +1 -1
- package/dist/src/helpers/component-file-extensions.js +1 -1
- package/dist/src/helpers/output.d.ts +1 -1
- package/dist/src/helpers/signals/signals.js +1 -1
- package/dist/src/helpers/typescript-project.js +6 -8
- package/dist/src/parsers/jsx/signals.d.ts +1 -1
- package/dist/src/parsers/jsx/signals.js +3 -3
- package/dist/src/plugins/compile-away-builder-components.d.ts +1 -1
- package/dist/src/types/mitosis-component.d.ts +2 -2
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +9 -5
|
@@ -28,10 +28,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
30
|
exports.componentToVue3 = exports.componentToVue2 = void 0;
|
|
31
|
-
var function_1 = require("fp-ts/lib/function");
|
|
32
|
-
var lodash_1 = require("lodash");
|
|
33
|
-
var standalone_1 = require("prettier/standalone");
|
|
34
|
-
var traverse_1 = __importDefault(require("traverse"));
|
|
35
31
|
var babel_transform_1 = require("../../helpers/babel-transform");
|
|
36
32
|
var bindings_1 = require("../../helpers/bindings");
|
|
37
33
|
var dedent_1 = require("../../helpers/dedent");
|
|
@@ -48,6 +44,10 @@ var replace_identifiers_1 = require("../../helpers/replace-identifiers");
|
|
|
48
44
|
var slots_1 = require("../../helpers/slots");
|
|
49
45
|
var strip_meta_properties_1 = require("../../helpers/strip-meta-properties");
|
|
50
46
|
var collect_css_1 = require("../../helpers/styles/collect-css");
|
|
47
|
+
var function_1 = require("fp-ts/lib/function");
|
|
48
|
+
var lodash_1 = require("lodash");
|
|
49
|
+
var standalone_1 = require("prettier/standalone");
|
|
50
|
+
var traverse_1 = __importDefault(require("traverse"));
|
|
51
51
|
var plugins_1 = require("../../modules/plugins");
|
|
52
52
|
var functions_1 = require("../helpers/functions");
|
|
53
53
|
var blocks_1 = require("./blocks");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MitosisConfig, Target } from '
|
|
1
|
+
import { MitosisConfig, Target } from '..';
|
|
2
2
|
export declare const COMPONENT_IMPORT_EXTENSIONS: string[];
|
|
3
3
|
export declare const checkIsSvelteComponentFilePath: (filePath: string) => boolean;
|
|
4
4
|
export declare const checkIsLiteComponentFilePath: (filePath: string) => boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getComponentFileExtensionForTarget = exports.renameImport = exports.renameComponentFile = exports.INPUT_EXTENSION_REGEX = exports.checkIsMitosisComponentFilePath = exports.checkIsLiteComponentFilePath = exports.checkIsSvelteComponentFilePath = exports.COMPONENT_IMPORT_EXTENSIONS = void 0;
|
|
4
|
-
var mitosis_1 = require("
|
|
4
|
+
var mitosis_1 = require("..");
|
|
5
5
|
var COMPONENT_EXTENSIONS = {
|
|
6
6
|
jsx: ['.lite.tsx', '.lite.jsx'],
|
|
7
7
|
svelte: ['.svelte'],
|
|
@@ -39,7 +39,7 @@ var getSignalImportName = function (code) {
|
|
|
39
39
|
path.parentPath.node.source.value === '@builder.io/mitosis') {
|
|
40
40
|
/**
|
|
41
41
|
* in case the import is aliased, we need to use the local name,
|
|
42
|
-
* e.g. `import { Signal as MySignal } from '
|
|
42
|
+
* e.g. `import { Signal as MySignal } from '../..'`
|
|
43
43
|
*/
|
|
44
44
|
signalImportName = path.node.local.name;
|
|
45
45
|
path.stop();
|
|
@@ -49,15 +49,13 @@ var getContextSymbols = function (ast) {
|
|
|
49
49
|
};
|
|
50
50
|
exports.getContextSymbols = getContextSymbols;
|
|
51
51
|
var getSignalSymbol = function (project) {
|
|
52
|
-
var
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (ts_morph_1.Node.isImportSpecifier(node)) {
|
|
58
|
-
signalSymbol = (_a = node.getSymbol()) === null || _a === void 0 ? void 0 : _a.getAliasedSymbol();
|
|
59
|
-
}
|
|
52
|
+
var mitosisRootExportFile = project.getSourceFiles().find(function (file) {
|
|
53
|
+
var filePath = file.getFilePath();
|
|
54
|
+
return (filePath.includes('mitosis/packages/core/dist/src/index') ||
|
|
55
|
+
// should only be needed for tests to work.
|
|
56
|
+
filePath.includes('mitosis/packages/core/src/index'));
|
|
60
57
|
});
|
|
58
|
+
var signalSymbol = mitosisRootExportFile === null || mitosisRootExportFile === void 0 ? void 0 : mitosisRootExportFile.getExportSymbols().find(function (Symbol) { return Symbol.getName() === 'Signal'; });
|
|
61
59
|
if (signalSymbol === undefined) {
|
|
62
60
|
throw new Error('Could not find the Mitosis Signal symbol in your TS project. Is `@builder.io/mitosis` installed correctly?');
|
|
63
61
|
}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.findSignals = void 0;
|
|
4
4
|
var ts_morph_1 = require("ts-morph");
|
|
5
5
|
var typescript_project_1 = require("../../helpers/typescript-project");
|
|
6
|
-
var findSignals = function (
|
|
7
|
-
var
|
|
8
|
-
var ast =
|
|
6
|
+
var findSignals = function (_a) {
|
|
7
|
+
var filePath = _a.filePath, signalSymbol = _a.signalSymbol, project = _a.project;
|
|
8
|
+
var ast = project.getSourceFileOrThrow(filePath);
|
|
9
9
|
if (ast === undefined) {
|
|
10
10
|
throw new Error('Could not find AST. Please provide a correct `filePath`.');
|
|
11
11
|
}
|
|
@@ -5,7 +5,7 @@ import { ComponentMetadata } from './metadata';
|
|
|
5
5
|
import { MitosisNode } from './mitosis-node';
|
|
6
6
|
/**
|
|
7
7
|
* @example
|
|
8
|
-
* // import core, { useState, someThing as someAlias } from '
|
|
8
|
+
* // import core, { useState, someThing as someAlias } from '..'
|
|
9
9
|
* {
|
|
10
10
|
* path: '@builder.io/mitosis',
|
|
11
11
|
* imports: {
|
|
@@ -16,7 +16,7 @@ import { MitosisNode } from './mitosis-node';
|
|
|
16
16
|
* }
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
|
-
* // import * as core from '
|
|
19
|
+
* // import * as core from '..'
|
|
20
20
|
* {
|
|
21
21
|
* path: '@builder.io/mitosis',
|
|
22
22
|
* imports: {
|