Skip to content

Commit ae94633

Browse files
authored
Release/1.1.0 [in progress] (#77)
* update some packages * update more packages * update more packages * add verbose flag * migrate to modules * update linting packages * update schema packages * upgrade more packages * Update mitosis version * improve mount on avatar element * remove mount for other elements if possible * fix #75 * Fix some small issues compiling * v1.1.0-alpha.0 * update versions * add version as variable * v1.1.0-alpha.1 * fix some typings * fix vue packages * add api to vue compiler * update vue types * inject types in vue files * inject dependencies * move prop types to interfaces * inject inerfaces * fix some imports * get needed files * clean vue imports * add more steps to inject * Improve some vue interfaces * improve performance of vue types * Fix types in columns * support generic types in vue * fix rollup for vue * fix vue declarations * fix some types * v1.1.0-alpha.3 * Create new alpha package * fix setting version * update version * v1.1.0-alpha.4 * v1.1.0-alpha.5 * remove unused packages * make breakpoint interface optional * Fix react typings * v1.1.0-alpha.6 * v1.1.0-alpha.7 * fix some typings * fix classnames * v1.1.0-alpha.9 * remove root classes * start fixing vue problems in watchers * v1.1.0-alpha.10 * fix vue bugs from mitosis * v1.1.0-alpha.11 * fix qwik * update readme with examples * edit readmes * v1.1.0-alpha.12 * update packages * Fix svelte problems * v1.1.0-alpha.13 * v1.1.0-alpha.14 * add src to solid * remove src * v1.1.0-alpha.15 * add variables * fix solid imports * v1.1.0-alpha.16 * fix solid classname * v1.1.0-alpha.17 * v1.1.0-alpha.17 * add ofetch * update some packages * update more dependencies * v1.1.0-alpha.18 * fix qwik classes * v1.1.0-alpha.19 * v1.1.0 * updte version
1 parent 56ed9dd commit ae94633

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+5594
-4449
lines changed

.eslintrc.js .eslintrc.cjs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const DISABLED = 0;
22
const WARNING = 1;
33
const ERROR = 2;
4+
45
module.exports = {
56
parser: '@typescript-eslint/parser',
67
// Specifies the ESLint parser

.ncurc.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"reject": [
3+
"mini-css-extract-plugin",
4+
"ora",
5+
"typescript"
6+
]
7+
}

.prettierrc.js

-9
This file was deleted.

.prettierrc.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"semi": true,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"bracketSpacing": true,
6+
"trailingComma": "none",
7+
"printWidth": 120,
8+
"endOfLine": "auto"
9+
}

.storybook/main.js .storybook/main.cjs

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ module.exports = {
2424
use.unshift(MiniCssExtractPlugin.loader);
2525
cssRule.use = use.filter((x) => !x?.loader?.includes('style-loader'));
2626

27+
config.module.rules.push({
28+
test: /\.mjs$/,
29+
include: /node_modules/,
30+
type: 'javascript/auto'
31+
});
32+
2733
config.module.rules.push({
2834
test: /code\.tsx$/,
2935
loader: 'string-replace-loader',

.storybook/storybook.css

-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ button.sidebar-item.sidebar-item ~ div > a {
136136
@mixin background-opacity var(--pa-color-primary-brightest), 0.25;
137137
color: var(--pa-color-primary-darkest);
138138
padding: 0.25rem;
139-
justify-content: center;
140139

141140
&.is-highlighted {
142141
@mixin background-opacity var(--pa-color-primary-brightest), 0.8;

.stylelintrc

+7-17
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,30 @@
11
{
22
"extends": "stylelint-prettier/recommended",
3-
"ignoreFiles": ["**/*.html", "**/*.js", "**/*.ts"],
3+
"ignoreFiles": [
4+
"**/*.html",
5+
"**/*.js",
6+
"**/*.ts"
7+
],
48
"plugins": [
59
"stylelint-prettier",
610
],
711
"rules": {
812
"prettier/prettier": true,
913
"at-rule-no-unknown": null,
1014
"font-family-no-missing-generic-family-keyword": null,
11-
"no-missing-end-of-source-newline": null,
1215
"no-empty-source": null,
1316
"shorthand-property-no-redundant-values": null,
1417
"block-no-empty": null,
15-
"indentation": 2,
16-
"string-quotes": "single",
1718
"no-duplicate-selectors": true,
1819
"color-hex-length": "long",
1920
"color-named": "never",
2021
"selector-no-qualifying-type": true,
21-
"selector-combinator-space-after": "always",
2222
"selector-attribute-quotes": "always",
23-
"selector-attribute-operator-space-before": "never",
24-
"declaration-block-trailing-semicolon": "always",
25-
"declaration-colon-space-before": "never",
26-
"declaration-colon-space-after": "always",
2723
"property-no-vendor-prefix": true,
2824
"value-no-vendor-prefix": true,
2925
"at-rule-no-vendor-prefix": true,
3026
"selector-pseudo-element-colon-notation": "single",
3127
"selector-no-vendor-prefix": true,
32-
"media-feature-range-operator-space-before": "always",
33-
"media-feature-range-operator-space-after": "always",
34-
"media-feature-parentheses-space-inside": "never",
35-
"media-feature-name-no-vendor-prefix": true,
36-
"media-feature-colon-space-before": "never",
37-
"media-feature-colon-space-after": "always",
38-
"max-empty-lines": null,
28+
"media-feature-name-no-vendor-prefix": true
3929
}
40-
}
30+
}

CHANGELOG.md

+78
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,84 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
# [1.1.0](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.19...v1.1.0) (2023-04-03)
7+
8+
**Note:** Version bump only for package papanasi
9+
10+
# [1.1.0-alpha.19](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.18...v1.1.0-alpha.19) (2023-04-03)
11+
12+
**Note:** Version bump only for package papanasi
13+
14+
# [1.1.0-alpha.18](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.17...v1.1.0-alpha.18) (2023-04-03)
15+
16+
**Note:** Version bump only for package papanasi
17+
18+
**Note:** Version bump only for package papanasi
19+
20+
# [1.1.0-alpha.17](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.16...v1.1.0-alpha.17) (2023-04-02)
21+
22+
**Note:** Version bump only for package papanasi
23+
24+
# [1.1.0-alpha.16](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.15...v1.1.0-alpha.16) (2023-04-02)
25+
26+
**Note:** Version bump only for package papanasi
27+
28+
# [1.1.0-alpha.15](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.14...v1.1.0-alpha.15) (2023-04-01)
29+
30+
**Note:** Version bump only for package papanasi
31+
32+
# [1.1.0-alpha.14](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.13...v1.1.0-alpha.14) (2023-04-01)
33+
34+
**Note:** Version bump only for package papanasi
35+
36+
# [1.1.0-alpha.13](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.12...v1.1.0-alpha.13) (2023-03-28)
37+
38+
**Note:** Version bump only for package papanasi
39+
40+
# [1.1.0-alpha.12](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.11...v1.1.0-alpha.12) (2023-03-25)
41+
42+
**Note:** Version bump only for package papanasi
43+
44+
# [1.1.0-alpha.11](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.10...v1.1.0-alpha.11) (2023-03-22)
45+
46+
**Note:** Version bump only for package papanasi
47+
48+
# [1.1.0-alpha.10](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.9...v1.1.0-alpha.10) (2023-03-22)
49+
50+
**Note:** Version bump only for package papanasi
51+
52+
# [1.1.0-alpha.9](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.7...v1.1.0-alpha.9) (2023-03-21)
53+
54+
**Note:** Version bump only for package papanasi
55+
56+
# [1.1.0-alpha.7](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.6...v1.1.0-alpha.7) (2023-03-21)
57+
58+
**Note:** Version bump only for package papanasi
59+
60+
# [1.1.0-alpha.6](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.5...v1.1.0-alpha.6) (2023-03-21)
61+
62+
**Note:** Version bump only for package papanasi
63+
64+
# [1.1.0-alpha.5](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.4...v1.1.0-alpha.5) (2023-03-20)
65+
66+
**Note:** Version bump only for package papanasi
67+
68+
# [1.1.0-alpha.4](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.3...v1.1.0-alpha.4) (2023-03-20)
69+
70+
**Note:** Version bump only for package papanasi
71+
72+
# [1.1.0-alpha.3](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.1...v1.1.0-alpha.3) (2023-03-20)
73+
74+
**Note:** Version bump only for package papanasi
75+
76+
# [1.1.0-alpha.1](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.0...v1.1.0-alpha.1) (2023-03-19)
77+
78+
**Note:** Version bump only for package papanasi
79+
80+
# [1.1.0-alpha.0](https://github.com/CKGrafico/papanasi/compare/v1.0.2...v1.1.0-alpha.0) (2023-03-19)
81+
82+
**Note:** Version bump only for package papanasi
83+
684
## [1.0.2](https://github.com/CKGrafico/papanasi/compare/v1.0.1...v1.0.2) (2022-12-29)
785

886
**Note:** Version bump only for package papanasi

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<img src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/qwik.svg" width="50" title="Qwik"> <br/>
3939
<strong>Qwik</strong> <br/>
4040
<sub>
41-
<a href="https://stackblitz.com/edit/qwik-starter-i6prxe" target="_blank"><img src="https://img.shields.io/badge/Stackblitz-Qwik-5048d7?logoColor=white&logo=stackblitz" alt="Qwik Sandbox" /></a>
41+
<a href="https://stackblitz.com/edit/qwik-starter-45qzw4" target="_blank"><img src="https://img.shields.io/badge/Stackblitz-Qwik-5048d7?logoColor=white&logo=stackblitz" alt="Qwik Sandbox" /></a>
4242
<a href="https://www.npmjs.com/package/@papanasi/qwik" target="_blank"><img src="https://img.shields.io/npm/dw/@papanasi/qwik?label=Installs&color=blue&logoColor=white&logo=qwiklabs" alt="Qwik downloads" /></a>
4343
</sub>
4444
</td>
@@ -109,21 +109,21 @@
109109
<img src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/svelte-icon.svg" width="41" title="Svelte Kit"> <br/>
110110
<strong>Svelte Kit</strong> <br/>
111111
<sub>
112-
<a href="https://codesandbox.io/p/sandbox/cranky-lamport-2t12j5" target="_blank"><img src="https://img.shields.io/badge/Demo-FF3E00?logoColor=white&logo=svelte" alt="Svelte Kit Demo" /></a>
112+
<a href="https://codesandbox.io/p/sandbox/papanasi-sveltekit-demo-papanasi-svelte-fz7ody" target="_blank"><img src="https://img.shields.io/badge/Demo-FF3E00?logoColor=white&logo=svelte" alt="Svelte Kit Demo" /></a>
113113
</sub>
114114
</td>
115115
<td align="center" width="140">
116116
<img src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/solidjs-icon.svg" width="41" title="Solid Create"> <br/>
117117
<strong>Solid Start</strong> <br/>
118118
<sub>
119-
<a href="https://codesandbox.io/p/github/CKGrafico/solid-start-simple/draft/loving-drake?file=%2Fsrc%2Froutes%2Findex.tsx" target="_blank"><img src="https://img.shields.io/badge/Demo-2e5593?logoColor=white&logo=solid" alt="Solid Start Demo" /></a>
119+
<a href="https://codesandbox.io/p/sandbox/solid-este-si-4mpxrp" target="_blank"><img src="https://img.shields.io/badge/Demo-2e5593?logoColor=white&logo=solid" alt="Solid Start Demo" /></a>
120120
</sub>
121121
</td>
122122
<td align="center" width="140">
123123
<img src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/qwik.svg" width="41" title="Qwik City"> <br/>
124124
<strong>Qwik City</strong> <br/>
125125
<sub>
126-
<a href="https://stackblitz.com/edit/qwik-starter-tudfze" target="_blank"><img src="https://img.shields.io/badge/Demo-5048d7?logoColor=white&logo=qwiklabs" alt="Svelte Kit Demo" /></a>
126+
<a href="https://stackblitz.com/edit/qwik-starter-tudfze" target="_blank"><img src="https://img.shields.io/badge/Demo-5048d7?logoColor=white&logo=qwiklabs" alt="Qwik Demo" /></a>
127127
</sub>
128128
</td>
129129
</tr>

compiler/base.compiler.js

+26-15
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
const glob = require('glob');
2-
const fs = require('fs-extra');
3-
const path = require('path');
4-
const postcss = require('postcss');
5-
const postcssConfig = require('../postcss.config');
6-
const filesystemTools = require('gluegun/filesystem');
7-
const stringTools = require('gluegun/strings');
8-
const printTools = require('gluegun/print');
9-
const commandLineArgs = require('command-line-args');
10-
const ora = require('ora');
11-
const compileCommand = require('@builder.io/mitosis-cli/dist/commands/compile');
1+
import compileCommand from '@builder.io/mitosis-cli/dist/commands/compile.js';
2+
import commandLineArgs from 'command-line-args';
3+
import fs from 'fs-extra';
4+
import glob from 'glob';
5+
import filesystemTools from 'gluegun/filesystem.js';
6+
import printTools from 'gluegun/print.js';
7+
import stringTools from 'gluegun/strings.js';
8+
import ora from 'ora';
9+
import path from 'path';
10+
import postcss from 'postcss';
1211

1312
const DEFAULT_OPTIONS = {
1413
elements: 'src/**/*.lite.tsx',
@@ -17,6 +16,7 @@ const DEFAULT_OPTIONS = {
1716
target: '',
1817
extension: '',
1918
state: '',
19+
api: '',
2020
styles: '',
2121
customReplace: (outFile, isFirstCompilation) => null
2222
};
@@ -85,7 +85,9 @@ async function compile(defaultOptions) {
8585
.map((fileName) => {
8686
const file = path.parse(fileName);
8787
const name = file.name.replace('.lite', '');
88-
return `export { default as ${pascalName(name)} } from './${file.dir.replace('src/', '')}';`;
88+
return `export { default as ${pascalName(name)} } from './${file.dir
89+
.replace(/\\/g, '/')
90+
.replace('src/', '')}';`;
8991
})
9092
.join('\n');
9193
}
@@ -94,6 +96,7 @@ async function compile(defaultOptions) {
9496
const indexResult = indexData
9597
// Export only needed components
9698
.replace(/(\/\/ Init Components)(.+?)(\/\/ End Components)/s, `$1\n${fileExports}\n$3`)
99+
// Set the current platform
97100
.replace(/Platform.Default/g, `Platform.${pascalName(options.target)}`);
98101

99102
fs.writeFileSync(`${outPath}/src/index.ts`, indexResult, 'utf8');
@@ -103,13 +106,17 @@ async function compile(defaultOptions) {
103106
const file = path.parse(filepath);
104107
const outFile = `${outPath}/${file.dir}/${file.name.replace('.lite', '')}.${options.extension}`;
105108

109+
let to = options.target === 'webcomponents' ? 'webcomponent' : options.target;
110+
to = to === 'vue' ? 'vue3' : to;
111+
106112
await compileCommand.run({
107113
parameters: {
108114
options: {
109115
from: 'mitosis',
110-
to: options.target === 'webcomponents' ? 'webcomponent' : options.target,
116+
to,
111117
out: outFile,
112118
force: true,
119+
api: options.api,
113120
state: options.state,
114121
styles: options.styles
115122
},
@@ -135,6 +142,8 @@ async function compile(defaultOptions) {
135142
}
136143

137144
async function compileCssFileForOutputSrc(outFile) {
145+
const postcssConfig = (await import('../postcss.config.cjs')).default;
146+
138147
const name = outFile.replace(/\..*/, '.css');
139148
const data = fs.readFileSync(name, 'utf8');
140149
const result = await postcss(postcssConfig.plugins).process(data, { from: name, to: name });
@@ -144,19 +153,21 @@ async function compile(defaultOptions) {
144153
for (const fileName of files) {
145154
const file = path.parse(fileName);
146155
const isFirstCompilation = !fs.existsSync(`${outPath}/src`) || options.isDev;
156+
const name = file.name.replace('.lite', '');
157+
const namePascal = pascalName(name);
147158

148159
spinner.text = fileName;
149160

150161
copyBasicFilesOnFirstCompilation(isFirstCompilation, fileName);
151162
const { outFile } = await compileMitosisComponent(fileName);
152163
replacePropertiesFromCompiledFiles(outFile);
153-
options.customReplace({ file, outFile, outPath, isFirstCompilation });
164+
options.customReplace({ name, pascalName: namePascal, file, outFile, outPath, isFirstCompilation });
154165
await compileCssFileForOutputSrc(outFile);
155166

156167
spinner.stop();
157168
}
158169
}
159170

160-
module.exports = {
171+
export default {
161172
compile
162173
};

compiler/compiler.tasks.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const { Listr } = require('listr2');
2-
const commandLineArgs = require('command-line-args');
1+
import commandLineArgs from 'command-line-args';
2+
import { Listr } from 'listr2';
33

44
const optionDefinitions = [
55
{ name: 'elements', alias: 'e', type: String, multiple: true },
@@ -93,7 +93,7 @@ const optionDefinitions = [
9393
title: `Bundle Packages: ${cliConfig.platforms?.join(', ') || ''}`,
9494
task: () =>
9595
execa(
96-
`yarn lerna --scope=@papanasi/${
96+
`yarn lerna --verbose --scope=@papanasi/${
9797
cliConfig.platforms.length > 1 ? `{${cliConfig.platforms?.join(',')}}` : cliConfig.platforms
9898
} build`
9999
).catch((error) => {

compiler/dev.tasks.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const { Listr } = require('listr2');
2-
const chokidar = require('chokidar');
3-
const path = require('path');
4-
const ora = require('ora');
1+
import chokidar from 'chokidar';
2+
import { Listr } from 'listr2';
3+
import ora from 'ora';
4+
import path from 'path';
55

66
(async () => {
77
const execa = (await import('execa')).command;
@@ -31,7 +31,7 @@ const ora = require('ora');
3131
{
3232
title: 'Bundle React',
3333
task: () =>
34-
execa('yarn lerna --scope=@papanasi/react build').catch((error) => {
34+
execa('yarn lerna --verbose --scope=@papanasi/react build').catch((error) => {
3535
throw new Error('Error bundling React ' + error);
3636
})
3737
},
@@ -51,7 +51,7 @@ const ora = require('ora');
5151

5252
try {
5353
await execa('node ./compiler/platforms/react --dev');
54-
await execa('yarn lerna --scope=@papanasi/react build');
54+
await execa('yarn lerna --verbose --scope=@papanasi/react build');
5555
} catch (e) {
5656
spinner.text = `Error compiling ${e.message}.`;
5757
spinner.fail();

compiler/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
require('./compiler.tasks');
1+
import './compiler.tasks.js';

0 commit comments

Comments
 (0)