create-zephyr-apps 0.0.6 → 0.0.8

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.
Files changed (80) hide show
  1. package/.github/workflows/pull_request.yml +56 -0
  2. package/.vscode/settings.json +75 -0
  3. package/biome.json +37 -0
  4. package/dist/index.cjs +135 -89
  5. package/dist/index.mjs +133 -87
  6. package/dist/package/utils/constants.d.ts +1 -1
  7. package/dist/package/utils/end.d.ts +1 -1
  8. package/package/index.ts +178 -113
  9. package/package/utils/constants.ts +64 -58
  10. package/package/utils/end.ts +19 -13
  11. package/package/utils/types.ts +1 -1
  12. package/package.json +33 -20
  13. package/rslib.config.ts +36 -37
  14. package/tsconfig.json +1 -2
  15. package/vite-mf/host/README.md +0 -50
  16. package/vite-mf/host/eslint.config.js +0 -25
  17. package/vite-mf/host/index.html +0 -13
  18. package/vite-mf/host/package.json +0 -31
  19. package/vite-mf/host/public/vite.svg +0 -1
  20. package/vite-mf/host/src/App.css +0 -42
  21. package/vite-mf/host/src/App.tsx +0 -37
  22. package/vite-mf/host/src/assets/react.svg +0 -1
  23. package/vite-mf/host/src/bootstrap.tsx +0 -10
  24. package/vite-mf/host/src/index.css +0 -68
  25. package/vite-mf/host/src/main.tsx +0 -8
  26. package/vite-mf/host/src/vite-env.d.ts +0 -1
  27. package/vite-mf/host/tsconfig.app.json +0 -24
  28. package/vite-mf/host/tsconfig.json +0 -4
  29. package/vite-mf/host/tsconfig.node.json +0 -22
  30. package/vite-mf/host/vite.config.ts +0 -40
  31. package/vite-mf/image.png +0 -0
  32. package/vite-mf/package.json +0 -12
  33. package/vite-mf/pnpm-lock.yaml +0 -9440
  34. package/vite-mf/pnpm-workspace.yaml +0 -2
  35. package/vite-mf/readme.md +0 -17
  36. package/vite-mf/remote/eslint.config.js +0 -25
  37. package/vite-mf/remote/index.html +0 -13
  38. package/vite-mf/remote/package.json +0 -31
  39. package/vite-mf/remote/public/vite.svg +0 -1
  40. package/vite-mf/remote/src/App.css +0 -38
  41. package/vite-mf/remote/src/App.tsx +0 -24
  42. package/vite-mf/remote/src/Button.css +0 -9
  43. package/vite-mf/remote/src/Button.tsx +0 -20
  44. package/vite-mf/remote/src/assets/react.svg +0 -1
  45. package/vite-mf/remote/src/bootstrap.tsx +0 -10
  46. package/vite-mf/remote/src/index.css +0 -68
  47. package/vite-mf/remote/src/main.tsx +0 -10
  48. package/vite-mf/remote/src/vite-env.d.ts +0 -1
  49. package/vite-mf/remote/tsconfig.app.json +0 -24
  50. package/vite-mf/remote/tsconfig.json +0 -4
  51. package/vite-mf/remote/tsconfig.node.json +0 -22
  52. package/vite-mf/remote/vite.config.ts +0 -25
  53. package/vite-mf/rspack/.babelrc +0 -6
  54. package/vite-mf/rspack/compilation.config.js +0 -31
  55. package/vite-mf/rspack/package.json +0 -32
  56. package/vite-mf/rspack/postcss.config.js +0 -6
  57. package/vite-mf/rspack/rspack.config.js +0 -110
  58. package/vite-mf/rspack/src/App.tsx +0 -21
  59. package/vite-mf/rspack/src/Image.tsx +0 -18
  60. package/vite-mf/rspack/src/assets/rspack-logo.png +0 -0
  61. package/vite-mf/rspack/src/global.d.ts +0 -4
  62. package/vite-mf/rspack/src/index.css +0 -7
  63. package/vite-mf/rspack/src/index.html +0 -12
  64. package/vite-mf/rspack/src/index.tsx +0 -1
  65. package/vite-mf/rspack/tailwind.config.js +0 -11
  66. package/vite-mf/rspack/tsconfig.json +0 -29
  67. package/vite-mf/webpack/.babelrc +0 -13
  68. package/vite-mf/webpack/compilation.config.js +0 -31
  69. package/vite-mf/webpack/package.json +0 -46
  70. package/vite-mf/webpack/postcss.config.js +0 -6
  71. package/vite-mf/webpack/src/App.tsx +0 -16
  72. package/vite-mf/webpack/src/Image.tsx +0 -18
  73. package/vite-mf/webpack/src/assets/webpack-logo.png +0 -0
  74. package/vite-mf/webpack/src/global.d.ts +0 -4
  75. package/vite-mf/webpack/src/index.html +0 -12
  76. package/vite-mf/webpack/src/index.scss +0 -7
  77. package/vite-mf/webpack/src/index.ts +0 -1
  78. package/vite-mf/webpack/tailwind.config.js +0 -11
  79. package/vite-mf/webpack/tsconfig.json +0 -29
  80. package/vite-mf/webpack/webpack.config.js +0 -91
@@ -1,29 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES6", // Specify ECMAScript target version
4
- "outDir": "dist",
5
- "lib": ["dom", "dom.iterable", "esnext"], // List of library files to be included in the compilation
6
- "allowJs": true, // Allow JavaScript files to be compiled
7
- "skipLibCheck": true, // Skip type checking of all declaration files
8
- "esModuleInterop": true, // Disables namespace imports (import * as fs from "fs") and enables CJS/AMD/UMD style imports (import fs from "fs")
9
- "allowSyntheticDefaultImports": true, // Allow default imports from modules with no default export
10
- "strict": true, // Enable all strict type checking options
11
- "forceConsistentCasingInFileNames": true, // Disallow inconsistently-cased references to the same file.
12
- "module": "esnext", // Specify module code generation
13
- "moduleResolution": "node", // Resolve modules using Node.js style
14
- "isolatedModules": true, // Unconditionally emit imports for unresolved files
15
- "resolveJsonModule": true, // Include modules imported with .json extension
16
- "noEmit": true, // Do not emit output (meaning do not compile code, only perform type checking)
17
- "jsx": "react", // Support JSX in .tsx files
18
- "sourceMap": true, // Generate corrresponding .map file
19
- "declaration": true, // Generate corresponding .d.ts file
20
- "noUnusedLocals": true, // Report errors on unused locals
21
- "noUnusedParameters": true, // Report errors on unused parameters
22
- "incremental": true, // Enable incremental compilation by reading/writing information from prior compilations to a file on disk
23
- "noFallthroughCasesInSwitch": true // Report errors for fallthrough cases in switch statement
24
- },
25
- "include": [
26
- "src/**/*" // *** The files TypeScript should type check ***
27
- ],
28
- "exclude": ["node_modules", "build", "dist"]
29
- }
@@ -1,13 +0,0 @@
1
- {
2
- "presets": [
3
- ["@babel/preset-env"],
4
- "@babel/preset-typescript",
5
- [
6
- "@babel/preset-react",
7
- {
8
- "runtime": "automatic" // Enables the new JSX transform in React 17+
9
- }
10
- ]
11
- ],
12
- "plugins": ["@babel/plugin-transform-runtime", "@babel/plugin-syntax-dynamic-import"]
13
- }
@@ -1,31 +0,0 @@
1
- const printCompilationMessage = (status, port) => {
2
- let messageColor, messageType, browserMessage;
3
-
4
- switch (status) {
5
- case 'success':
6
- messageColor = '\x1b[32m';
7
- messageType = 'Compiled successfully!';
8
- browserMessage = 'You can now view';
9
- break;
10
- case 'failure':
11
- messageColor = '\x1b[31m';
12
- messageType = 'Compilation Failed!';
13
- browserMessage = "You can't now view";
14
- break;
15
- case 'compiling':
16
- messageColor = '\x1b[94m';
17
- messageType = 'Compiling...';
18
- browserMessage = 'Compiling the';
19
- break;
20
- }
21
-
22
- console.log(`\n\n
23
- ${messageColor}${messageType}\x1b[0m\n
24
- ${browserMessage} \x1b[1mRemote\x1b[0m in the browser.
25
- ${messageColor}${messageType}\x1b[0m\n
26
- \x1b[1mLocal\x1b[0m: http://localhost:\x1b[1m${port}\x1b[0m
27
- \x1b[1mLocal\x1b[0m: http://localhost:\x1b[1m${port}\x1b[0m\n\n
28
- `);
29
- };
30
-
31
- module.exports = printCompilationMessage;
@@ -1,46 +0,0 @@
1
- {
2
- "name": "vite_webpack",
3
- "version": "1.0.0",
4
- "scripts": {
5
- "build": "webpack --mode production",
6
- "build:dev": "webpack --mode development",
7
- "build:start": "cd dist && PORT=8080 npx serve",
8
- "start": "webpack serve --mode development",
9
- "start:live": "webpack serve --mode development --live-reload --hot"
10
- },
11
- "license": "MIT",
12
- "author": {
13
- "name": "Jack Herrington",
14
- "email": "jherr@pobox.com"
15
- },
16
- "devDependencies": {
17
- "@babel/core": "^7.15.8",
18
- "@babel/plugin-transform-runtime": "^7.15.8",
19
- "@babel/preset-env": "^7.15.8",
20
- "@babel/preset-react": "^7.14.5",
21
- "@babel/preset-typescript": "^7.10.4",
22
- "@babel/runtime": "7.25.6",
23
- "@module-federation/enhanced": "0.6.3",
24
- "@types/react": "^18.2.0",
25
- "@types/react-dom": "^18.2.0",
26
- "autoprefixer": "^10.1.0",
27
- "babel-loader": "^8.2.2",
28
- "css-loader": "^6.3.0",
29
- "dotenv-webpack": "^8.0.1",
30
- "html-webpack-plugin": "^5.3.2",
31
- "postcss": "^8.2.1",
32
- "postcss-loader": "^4.1.0",
33
- "style-loader": "^3.3.0",
34
- "tailwindcss": "^3.4.1",
35
- "typescript": "^4.5.2",
36
- "webpack": "^5.57.1",
37
- "webpack-cli": "^4.10.0",
38
- "webpack-dev-server": "^4.3.1",
39
- "zephyr-webpack-plugin": "^0.0.30"
40
- },
41
- "dependencies": {
42
- "@babel/plugin-syntax-dynamic-import": "^7.8.3",
43
- "react": "^18.3.1",
44
- "react-dom": "^18.3.1"
45
- }
46
- }
@@ -1,6 +0,0 @@
1
- const autoprefixer = require('autoprefixer');
2
- const tailwindcss = require('tailwindcss');
3
-
4
- module.exports = {
5
- plugins: [tailwindcss, autoprefixer],
6
- };
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom/client';
3
- import WebpackImage from './Image';
4
- import './index.scss';
5
-
6
- const App = () => (
7
- <div className="mt-10 text-3xl bg-black h-[80vh] mx-auto max-w-6xl">
8
- <WebpackImage />
9
- </div>
10
- );
11
- const rootElement = document.getElementById('app');
12
- if (!rootElement) throw new Error('Failed to find the root element');
13
-
14
- const root = ReactDOM.createRoot(rootElement as HTMLElement);
15
-
16
- root.render(<App />);
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- import { useState } from 'react';
3
- import logo from './assets/webpack-logo.png';
4
-
5
- const WebpackImage = () => {
6
- const [count, setCount] = useState(0);
7
- return (
8
- <div>
9
- <p className="text-white text-base">This is a component from Webpack.</p>{' '}
10
- <button className="border rounded-md text-base text-white py-1 px-2" onClick={() => setCount(count + 1)}>
11
- Webpack Button - Count: {count}
12
- </button>
13
- <img src={logo} />
14
- </div>
15
- );
16
- };
17
-
18
- export default WebpackImage;
@@ -1,4 +0,0 @@
1
- declare module '*.png' {
2
- const value: string;
3
- export default value;
4
- }
@@ -1,12 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>webpack</title>
7
- </head>
8
-
9
- <body>
10
- <div id="app"></div>
11
- </body>
12
- </html>
@@ -1,7 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- body {
6
- font-family: Arial, Helvetica, sans-serif;
7
- }
@@ -1 +0,0 @@
1
- import('./App');
@@ -1,11 +0,0 @@
1
- module.exports = {
2
- content: ['./src/**/*.{js,jsx,ts,tsx}'],
3
- darkMode: false, // or 'media' or 'class'
4
- theme: {
5
- extend: {},
6
- },
7
- variants: {
8
- extend: {},
9
- },
10
- plugins: [],
11
- };
@@ -1,29 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES6", // Specify ECMAScript target version
4
- "outDir": "dist",
5
- "lib": ["dom", "dom.iterable", "esnext"], // List of library files to be included in the compilation
6
- "allowJs": true, // Allow JavaScript files to be compiled
7
- "skipLibCheck": true, // Skip type checking of all declaration files
8
- "esModuleInterop": true, // Disables namespace imports (import * as fs from "fs") and enables CJS/AMD/UMD style imports (import fs from "fs")
9
- "allowSyntheticDefaultImports": true, // Allow default imports from modules with no default export
10
- "strict": true, // Enable all strict type checking options
11
- "forceConsistentCasingInFileNames": true, // Disallow inconsistently-cased references to the same file.
12
- "module": "esnext", // Specify module code generation
13
- "moduleResolution": "node", // Resolve modules using Node.js style
14
- "isolatedModules": true, // Unconditionally emit imports for unresolved files
15
- "resolveJsonModule": true, // Include modules imported with .json extension
16
- "noEmit": true, // Do not emit output (meaning do not compile code, only perform type checking)
17
- "jsx": "react", // Support JSX in .tsx files
18
- "sourceMap": true, // Generate corrresponding .map file
19
- "declaration": true, // Generate corresponding .d.ts file
20
- "noUnusedLocals": true, // Report errors on unused locals
21
- "noUnusedParameters": true, // Report errors on unused parameters
22
- "incremental": true, // Enable incremental compilation by reading/writing information from prior compilations to a file on disk
23
- "noFallthroughCasesInSwitch": true // Report errors for fallthrough cases in switch statement
24
- },
25
- "include": [
26
- "src/**/*" // *** The files TypeScript should type check ***
27
- ],
28
- "exclude": ["node_modules", "build", "dist"]
29
- }
@@ -1,91 +0,0 @@
1
- const HtmlWebPackPlugin = require('html-webpack-plugin');
2
- //const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
3
- const path = require('path');
4
- const Dotenv = require('dotenv-webpack');
5
- const { withZephyr } = require('zephyr-webpack-plugin');
6
- const { ModuleFederationPlugin } = require('@module-federation/enhanced/webpack');
7
-
8
- const deps = require('./package.json').dependencies;
9
-
10
- const printCompilationMessage = require('./compilation.config.js');
11
-
12
- module.exports = (_, argv) =>
13
- withZephyr()({
14
- output: {
15
- publicPath: 'auto',
16
- },
17
-
18
- resolve: {
19
- extensions: ['.tsx', '.ts', '.jsx', '.js', '.json'],
20
- },
21
-
22
- devServer: {
23
- port: 8080,
24
- historyApiFallback: true,
25
- watchFiles: [path.resolve(__dirname, 'src')],
26
- onListening: function (devServer) {
27
- const port = devServer.server.address().port;
28
-
29
- printCompilationMessage('compiling', port);
30
-
31
- devServer.compiler.hooks.done.tap('OutputMessagePlugin', (stats) => {
32
- setImmediate(() => {
33
- if (stats.hasErrors()) {
34
- printCompilationMessage('failure', port);
35
- } else {
36
- printCompilationMessage('success', port);
37
- }
38
- });
39
- });
40
- },
41
- },
42
-
43
- module: {
44
- rules: [
45
- {
46
- test: /\.(svg|png)$/,
47
- type: 'asset',
48
- },
49
- {
50
- test: /\.m?js/,
51
- type: 'javascript/auto',
52
- resolve: {
53
- fullySpecified: false,
54
- },
55
- },
56
- {
57
- test: /\.(css|s[ac]ss)$/i,
58
- use: ['style-loader', 'css-loader', 'postcss-loader'],
59
- },
60
- {
61
- test: /\.(ts|tsx|js|jsx)$/,
62
- exclude: /node_modules/,
63
- use: {
64
- loader: 'babel-loader',
65
- },
66
- },
67
- ],
68
- },
69
-
70
- plugins: [
71
- new ModuleFederationPlugin({
72
- name: 'vite_webpack',
73
- filename: 'remoteEntry.js',
74
- exposes: {
75
- './Image': './src/Image',
76
- },
77
- shared: {
78
- react: {
79
- singleton: true,
80
- },
81
- 'react-dom': {
82
- singleton: true,
83
- },
84
- },
85
- }),
86
- new HtmlWebPackPlugin({
87
- template: './src/index.html',
88
- }),
89
- new Dotenv(),
90
- ],
91
- });