Skip to content

Commit

Permalink
Release/1.1.0 [in progress] (CKGrafico#77)
Browse files Browse the repository at this point in the history
* 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 CKGrafico#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
  • Loading branch information
CKGrafico authored Apr 3, 2023
1 parent 56ed9dd commit ae94633
Show file tree
Hide file tree
Showing 96 changed files with 5,594 additions and 4,449 deletions.
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

0 comments on commit ae94633

Please sign in to comment.