Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/1.1.0 [in progress] #77

Merged
merged 80 commits into from
Apr 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
c00401b
update some packages
CKGrafico Mar 18, 2023
51dfebc
update more packages
CKGrafico Mar 18, 2023
5fa03c4
update more packages
CKGrafico Mar 18, 2023
a71922f
add verbose flag
CKGrafico Mar 18, 2023
f031be7
migrate to modules
CKGrafico Mar 18, 2023
0ac2c3e
update linting packages
CKGrafico Mar 18, 2023
f7dc070
update schema packages
CKGrafico Mar 18, 2023
04a0d0d
upgrade more packages
CKGrafico Mar 18, 2023
e961c4e
Update mitosis version
CKGrafico Mar 18, 2023
dde6e6e
improve mount on avatar element
CKGrafico Mar 18, 2023
b7252fa
remove mount for other elements if possible
CKGrafico Mar 18, 2023
7a619b7
fix #75
CKGrafico Mar 18, 2023
d89bfae
Fix some small issues compiling
CKGrafico Mar 19, 2023
72d2cbc
v1.1.0-alpha.0
CKGrafico Mar 19, 2023
5aae6f9
update versions
CKGrafico Mar 19, 2023
474cae5
add version as variable
CKGrafico Mar 19, 2023
6674bd7
v1.1.0-alpha.1
CKGrafico Mar 19, 2023
845e549
fix some typings
CKGrafico Mar 19, 2023
b24766e
fix vue packages
CKGrafico Mar 19, 2023
f3df2d0
add api to vue compiler
CKGrafico Mar 19, 2023
eb2f662
update vue types
CKGrafico Mar 19, 2023
4d934d9
inject types in vue files
CKGrafico Mar 19, 2023
8f7446a
inject dependencies
CKGrafico Mar 19, 2023
eeb0a50
move prop types to interfaces
CKGrafico Mar 19, 2023
a85147b
inject inerfaces
CKGrafico Mar 19, 2023
0743bca
fix some imports
CKGrafico Mar 19, 2023
913e922
get needed files
CKGrafico Mar 19, 2023
5181492
clean vue imports
CKGrafico Mar 19, 2023
90f23e2
add more steps to inject
CKGrafico Mar 19, 2023
c95dcf6
Improve some vue interfaces
CKGrafico Mar 20, 2023
cfb0589
improve performance of vue types
CKGrafico Mar 20, 2023
ab7f782
Fix types in columns
CKGrafico Mar 20, 2023
69ce39e
support generic types in vue
CKGrafico Mar 20, 2023
2dc83d3
fix rollup for vue
CKGrafico Mar 20, 2023
1c31523
fix vue declarations
CKGrafico Mar 20, 2023
5211d1f
fix some types
CKGrafico Mar 20, 2023
9a8d3ab
v1.1.0-alpha.3
CKGrafico Mar 20, 2023
69b079b
Create new alpha package
CKGrafico Mar 20, 2023
dec6a24
fix setting version
CKGrafico Mar 20, 2023
a4f8894
update version
CKGrafico Mar 20, 2023
97d6d7f
v1.1.0-alpha.4
CKGrafico Mar 20, 2023
b2aa551
v1.1.0-alpha.5
CKGrafico Mar 20, 2023
74e4a7a
remove unused packages
CKGrafico Mar 20, 2023
7e4bc2a
make breakpoint interface optional
CKGrafico Mar 21, 2023
869558c
Fix react typings
CKGrafico Mar 21, 2023
b457623
v1.1.0-alpha.6
CKGrafico Mar 21, 2023
7ab9199
v1.1.0-alpha.7
CKGrafico Mar 21, 2023
4f89ddf
fix some typings
CKGrafico Mar 21, 2023
2d20082
fix classnames
CKGrafico Mar 21, 2023
792e369
v1.1.0-alpha.9
CKGrafico Mar 21, 2023
da27c14
remove root classes
CKGrafico Mar 21, 2023
e2ec566
start fixing vue problems in watchers
CKGrafico Mar 21, 2023
346ab54
v1.1.0-alpha.10
CKGrafico Mar 22, 2023
7097599
fix vue bugs from mitosis
CKGrafico Mar 22, 2023
76c2d85
v1.1.0-alpha.11
CKGrafico Mar 22, 2023
7dd13b0
fix qwik
CKGrafico Mar 22, 2023
0ab2955
update readme with examples
CKGrafico Mar 22, 2023
18f844c
edit readmes
CKGrafico Mar 22, 2023
8625d62
v1.1.0-alpha.12
CKGrafico Mar 25, 2023
5b8bfea
update packages
CKGrafico Mar 25, 2023
bd844cb
Fix svelte problems
CKGrafico Mar 28, 2023
3e271bf
v1.1.0-alpha.13
CKGrafico Mar 28, 2023
cd8b4be
v1.1.0-alpha.14
CKGrafico Apr 1, 2023
abd47c9
add src to solid
CKGrafico Apr 1, 2023
9ef10eb
remove src
CKGrafico Apr 1, 2023
54c50b8
v1.1.0-alpha.15
CKGrafico Apr 1, 2023
43c0853
add variables
CKGrafico Apr 1, 2023
b6aab70
fix solid imports
CKGrafico Apr 2, 2023
050e20b
v1.1.0-alpha.16
CKGrafico Apr 2, 2023
f64f526
fix solid classname
CKGrafico Apr 2, 2023
a0f5b2a
v1.1.0-alpha.17
CKGrafico Apr 2, 2023
03721e1
v1.1.0-alpha.17
CKGrafico Apr 2, 2023
44d2c15
add ofetch
CKGrafico Apr 3, 2023
c0af99b
update some packages
CKGrafico Apr 3, 2023
a06682f
update more dependencies
CKGrafico Apr 3, 2023
4e26b95
v1.1.0-alpha.18
CKGrafico Apr 3, 2023
2910f39
fix qwik classes
CKGrafico Apr 3, 2023
b17f2f1
v1.1.0-alpha.19
CKGrafico Apr 3, 2023
cfb6f82
v1.1.0
CKGrafico Apr 3, 2023
1f0d2ab
updte version
CKGrafico Apr 3, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const DISABLED = 0;
const WARNING = 1;
const ERROR = 2;

module.exports = {
parser: '@typescript-eslint/parser',
// Specifies the ESLint parser
Expand Down
7 changes: 7 additions & 0 deletions .ncurc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"reject": [
"mini-css-extract-plugin",
"ora",
"typescript"
]
}
9 changes: 0 additions & 9 deletions .prettierrc.js

This file was deleted.

9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"bracketSpacing": true,
"trailingComma": "none",
"printWidth": 120,
"endOfLine": "auto"
}
6 changes: 6 additions & 0 deletions .storybook/main.js → .storybook/main.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ module.exports = {
use.unshift(MiniCssExtractPlugin.loader);
cssRule.use = use.filter((x) => !x?.loader?.includes('style-loader'));

config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto'
});

config.module.rules.push({
test: /code\.tsx$/,
loader: 'string-replace-loader',
Expand Down
1 change: 0 additions & 1 deletion .storybook/storybook.css
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ button.sidebar-item.sidebar-item ~ div > a {
@mixin background-opacity var(--pa-color-primary-brightest), 0.25;
color: var(--pa-color-primary-darkest);
padding: 0.25rem;
justify-content: center;

&.is-highlighted {
@mixin background-opacity var(--pa-color-primary-brightest), 0.8;
Expand Down
24 changes: 7 additions & 17 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,40 +1,30 @@
{
"extends": "stylelint-prettier/recommended",
"ignoreFiles": ["**/*.html", "**/*.js", "**/*.ts"],
"ignoreFiles": [
"**/*.html",
"**/*.js",
"**/*.ts"
],
"plugins": [
"stylelint-prettier",
],
"rules": {
"prettier/prettier": true,
"at-rule-no-unknown": null,
"font-family-no-missing-generic-family-keyword": null,
"no-missing-end-of-source-newline": null,
"no-empty-source": null,
"shorthand-property-no-redundant-values": null,
"block-no-empty": null,
"indentation": 2,
"string-quotes": "single",
"no-duplicate-selectors": true,
"color-hex-length": "long",
"color-named": "never",
"selector-no-qualifying-type": true,
"selector-combinator-space-after": "always",
"selector-attribute-quotes": "always",
"selector-attribute-operator-space-before": "never",
"declaration-block-trailing-semicolon": "always",
"declaration-colon-space-before": "never",
"declaration-colon-space-after": "always",
"property-no-vendor-prefix": true,
"value-no-vendor-prefix": true,
"at-rule-no-vendor-prefix": true,
"selector-pseudo-element-colon-notation": "single",
"selector-no-vendor-prefix": true,
"media-feature-range-operator-space-before": "always",
"media-feature-range-operator-space-after": "always",
"media-feature-parentheses-space-inside": "never",
"media-feature-name-no-vendor-prefix": true,
"media-feature-colon-space-before": "never",
"media-feature-colon-space-after": "always",
"max-empty-lines": null,
"media-feature-name-no-vendor-prefix": true
}
}
}
78 changes: 78 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,84 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [1.1.0](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.19...v1.1.0) (2023-04-03)

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

# [1.1.0-alpha.19](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.18...v1.1.0-alpha.19) (2023-04-03)

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

# [1.1.0-alpha.18](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.17...v1.1.0-alpha.18) (2023-04-03)

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

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

# [1.1.0-alpha.17](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.16...v1.1.0-alpha.17) (2023-04-02)

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

# [1.1.0-alpha.16](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.15...v1.1.0-alpha.16) (2023-04-02)

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

# [1.1.0-alpha.15](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.14...v1.1.0-alpha.15) (2023-04-01)

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

# [1.1.0-alpha.14](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.13...v1.1.0-alpha.14) (2023-04-01)

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

# [1.1.0-alpha.13](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.12...v1.1.0-alpha.13) (2023-03-28)

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

# [1.1.0-alpha.12](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.11...v1.1.0-alpha.12) (2023-03-25)

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

# [1.1.0-alpha.11](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.10...v1.1.0-alpha.11) (2023-03-22)

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

# [1.1.0-alpha.10](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.9...v1.1.0-alpha.10) (2023-03-22)

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

# [1.1.0-alpha.9](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.7...v1.1.0-alpha.9) (2023-03-21)

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

# [1.1.0-alpha.7](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.6...v1.1.0-alpha.7) (2023-03-21)

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

# [1.1.0-alpha.6](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.5...v1.1.0-alpha.6) (2023-03-21)

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

# [1.1.0-alpha.5](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.4...v1.1.0-alpha.5) (2023-03-20)

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

# [1.1.0-alpha.4](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.3...v1.1.0-alpha.4) (2023-03-20)

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

# [1.1.0-alpha.3](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.1...v1.1.0-alpha.3) (2023-03-20)

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

# [1.1.0-alpha.1](https://github.com/CKGrafico/papanasi/compare/v1.1.0-alpha.0...v1.1.0-alpha.1) (2023-03-19)

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

# [1.1.0-alpha.0](https://github.com/CKGrafico/papanasi/compare/v1.0.2...v1.1.0-alpha.0) (2023-03-19)

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

## [1.0.2](https://github.com/CKGrafico/papanasi/compare/v1.0.1...v1.0.2) (2022-12-29)

**Note:** Version bump only for package papanasi
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<img src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/qwik.svg" width="50" title="Qwik"> <br/>
<strong>Qwik</strong> <br/>
<sub>
<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>
<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>
<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>
</sub>
</td>
Expand Down Expand Up @@ -109,21 +109,21 @@
<img src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/svelte-icon.svg" width="41" title="Svelte Kit"> <br/>
<strong>Svelte Kit</strong> <br/>
<sub>
<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>
<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>
</sub>
</td>
<td align="center" width="140">
<img src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/solidjs-icon.svg" width="41" title="Solid Create"> <br/>
<strong>Solid Start</strong> <br/>
<sub>
<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>
<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>
</sub>
</td>
<td align="center" width="140">
<img src="https://raw.githubusercontent.com/gilbarbara/logos/master/logos/qwik.svg" width="41" title="Qwik City"> <br/>
<strong>Qwik City</strong> <br/>
<sub>
<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>
<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>
</sub>
</td>
</tr>
Expand Down
41 changes: 26 additions & 15 deletions compiler/base.compiler.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const glob = require('glob');
const fs = require('fs-extra');
const path = require('path');
const postcss = require('postcss');
const postcssConfig = require('../postcss.config');
const filesystemTools = require('gluegun/filesystem');
const stringTools = require('gluegun/strings');
const printTools = require('gluegun/print');
const commandLineArgs = require('command-line-args');
const ora = require('ora');
const compileCommand = require('@builder.io/mitosis-cli/dist/commands/compile');
import compileCommand from '@builder.io/mitosis-cli/dist/commands/compile.js';
import commandLineArgs from 'command-line-args';
import fs from 'fs-extra';
import glob from 'glob';
import filesystemTools from 'gluegun/filesystem.js';
import printTools from 'gluegun/print.js';
import stringTools from 'gluegun/strings.js';
import ora from 'ora';
import path from 'path';
import postcss from 'postcss';

const DEFAULT_OPTIONS = {
elements: 'src/**/*.lite.tsx',
Expand All @@ -17,6 +16,7 @@ const DEFAULT_OPTIONS = {
target: '',
extension: '',
state: '',
api: '',
styles: '',
customReplace: (outFile, isFirstCompilation) => null
};
Expand Down Expand Up @@ -85,7 +85,9 @@ async function compile(defaultOptions) {
.map((fileName) => {
const file = path.parse(fileName);
const name = file.name.replace('.lite', '');
return `export { default as ${pascalName(name)} } from './${file.dir.replace('src/', '')}';`;
return `export { default as ${pascalName(name)} } from './${file.dir
.replace(/\\/g, '/')
.replace('src/', '')}';`;
})
.join('\n');
}
Expand All @@ -94,6 +96,7 @@ async function compile(defaultOptions) {
const indexResult = indexData
// Export only needed components
.replace(/(\/\/ Init Components)(.+?)(\/\/ End Components)/s, `$1\n${fileExports}\n$3`)
// Set the current platform
.replace(/Platform.Default/g, `Platform.${pascalName(options.target)}`);

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

let to = options.target === 'webcomponents' ? 'webcomponent' : options.target;
to = to === 'vue' ? 'vue3' : to;

await compileCommand.run({
parameters: {
options: {
from: 'mitosis',
to: options.target === 'webcomponents' ? 'webcomponent' : options.target,
to,
out: outFile,
force: true,
api: options.api,
state: options.state,
styles: options.styles
},
Expand All @@ -135,6 +142,8 @@ async function compile(defaultOptions) {
}

async function compileCssFileForOutputSrc(outFile) {
const postcssConfig = (await import('../postcss.config.cjs')).default;

const name = outFile.replace(/\..*/, '.css');
const data = fs.readFileSync(name, 'utf8');
const result = await postcss(postcssConfig.plugins).process(data, { from: name, to: name });
Expand All @@ -144,19 +153,21 @@ async function compile(defaultOptions) {
for (const fileName of files) {
const file = path.parse(fileName);
const isFirstCompilation = !fs.existsSync(`${outPath}/src`) || options.isDev;
const name = file.name.replace('.lite', '');
const namePascal = pascalName(name);

spinner.text = fileName;

copyBasicFilesOnFirstCompilation(isFirstCompilation, fileName);
const { outFile } = await compileMitosisComponent(fileName);
replacePropertiesFromCompiledFiles(outFile);
options.customReplace({ file, outFile, outPath, isFirstCompilation });
options.customReplace({ name, pascalName: namePascal, file, outFile, outPath, isFirstCompilation });
await compileCssFileForOutputSrc(outFile);

spinner.stop();
}
}

module.exports = {
export default {
compile
};
6 changes: 3 additions & 3 deletions compiler/compiler.tasks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Listr } = require('listr2');
const commandLineArgs = require('command-line-args');
import commandLineArgs from 'command-line-args';
import { Listr } from 'listr2';

const optionDefinitions = [
{ name: 'elements', alias: 'e', type: String, multiple: true },
Expand Down Expand Up @@ -93,7 +93,7 @@ const optionDefinitions = [
title: `Bundle Packages: ${cliConfig.platforms?.join(', ') || ''}`,
task: () =>
execa(
`yarn lerna --scope=@papanasi/${
`yarn lerna --verbose --scope=@papanasi/${
cliConfig.platforms.length > 1 ? `{${cliConfig.platforms?.join(',')}}` : cliConfig.platforms
} build`
).catch((error) => {
Expand Down
12 changes: 6 additions & 6 deletions compiler/dev.tasks.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { Listr } = require('listr2');
const chokidar = require('chokidar');
const path = require('path');
const ora = require('ora');
import chokidar from 'chokidar';
import { Listr } from 'listr2';
import ora from 'ora';
import path from 'path';

(async () => {
const execa = (await import('execa')).command;
Expand Down Expand Up @@ -31,7 +31,7 @@ const ora = require('ora');
{
title: 'Bundle React',
task: () =>
execa('yarn lerna --scope=@papanasi/react build').catch((error) => {
execa('yarn lerna --verbose --scope=@papanasi/react build').catch((error) => {
throw new Error('Error bundling React ' + error);
})
},
Expand All @@ -51,7 +51,7 @@ const ora = require('ora');

try {
await execa('node ./compiler/platforms/react --dev');
await execa('yarn lerna --scope=@papanasi/react build');
await execa('yarn lerna --verbose --scope=@papanasi/react build');
} catch (e) {
spinner.text = `Error compiling ${e.message}.`;
spinner.fail();
Expand Down
2 changes: 1 addition & 1 deletion compiler/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
require('./compiler.tasks');
import './compiler.tasks.js';
Loading