Skip to content

Commit 3b0a064

Browse files
committed
chore: 🤖 Merged main
2 parents 3646c34 + 94d37e3 commit 3b0a064

Some content is hidden

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

74 files changed

+4613
-2770
lines changed

.eslintrc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ module.exports = {
2525
},
2626
plugins: ['prettier', 'jest', 'react', 'jasmine'],
2727
settings: {
28-
ecmascript: 2020,
28+
ecmascript: 2022,
2929
jsx: true,
3030
react: {
3131
version: '18',
3232
},
3333
},
3434
parserOptions: {
3535
sourceType: 'module',
36-
ecmaVersion: 11,
36+
ecmaVersion: 13,
3737
},
3838
env: {
39+
[`es2022`]: true,
3940
browser: true,
4041
node: true,
4142
es6: true,

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
runs-on: ubuntu-latest
8181
strategy:
8282
matrix:
83-
preview: ['preact', 'uhtml', 'svelte', 'vanilla']
83+
preview: ['preact', 'vanilla']
8484

8585
steps:
8686
- uses: actions/checkout@v3

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
/packages/*/dist
88
/packages/*/lib
99
/packages/*/coverage
10-
/packages/*/node_modules
10+
/packages/*/node_modules
11+
/packages/cli/bin/merkur.mjs

package-lock.json

Lines changed: 2565 additions & 2465 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/.npmignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/coverage
2+
.babelrc
3+
.eslintrc.js
4+
.gitignore
5+
.npmignore
6+
.npmrc
7+
.prettierignore
8+
.travis.yml
9+
.DS_Store
10+
README.md
11+
CHANGELOG.md
12+
commitlint.config.js
13+
rollup.config.js
14+
babel.config.js
15+
jest.config.js
16+
setupJest.js

packages/cli/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
registry = "https://registry.npmjs.org/"

packages/cli/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5+

packages/cli/LICENSE

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Copyright 2024 Miroslav Jancarik [email protected]
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8+
git s

packages/cli/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Merkur - CLI
2+
3+
## About Merkur
4+
5+
The [Merkur](https://merkur.js.org/) is tiny extensible javascript library for front-end microservices. It allows by default server side rendering for loading performance boost. You can connect it with other frameworks or languages because merkur defines easy API. You can use one of four predefined template's library [Preact](https://preactjs.com/), [µhtml](https://github.com/WebReflection/uhtml#readme), [Svelte](https://svelte.dev/) and [vanilla](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) but you can easily extend for others.

packages/cli/bin/merkur.mjs

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env node
2+
import { Command } from 'commander';
3+
import { dev } from '../src/commands/dev.mjs';
4+
import { build } from '../src/commands/build.mjs';
5+
import { start } from '../src/commands/start.mjs';
6+
import { test } from '../src/commands/test.mjs';
7+
import { COMMAND_NAME } from '../src/commands/constant.mjs';
8+
9+
// eslint-disable-next-line
10+
import packageFile from '../package.json' with { type: 'json' };
11+
12+
const program = new Command();
13+
14+
program
15+
.name('merkur')
16+
.description('CLI for Merkur framework.')
17+
.option('--writeToDisk', 'Write built files to disk.')
18+
.option('--runTask [runTask...]', 'Run only defined task.')
19+
.option('--outFile <string>', 'Server out file configuration to es-build.')
20+
.option('--port <number>', 'Widget server port.')
21+
.option('--devServerPort <number>', 'Dev server port.')
22+
.option('--projectFolder <string>', 'Project folder.')
23+
.option('--buildFolder <string>', 'Build folder.')
24+
.option('--staticFolder <string>', 'Static folder.')
25+
.option('--staticPath <string>', 'The static path for dev server and widget server.')
26+
.option('--inspect', 'Debugging widget server')
27+
.option('--verbose', 'Verbose mode which show debug information.')
28+
.version(packageFile.version);
29+
30+
program.command(COMMAND_NAME.DEV).description('Dev command').action(async (options, cmd) => {
31+
const args = { ...{ writeToDisk: false, watch: true, runTask: ['node', 'es13'] }, ...cmd.optsWithGlobals(), ...options };
32+
process.env.NODE_ENV = process.env.NODE_ENV ?? 'development';
33+
34+
dev({ args, command: COMMAND_NAME.DEV });
35+
});
36+
37+
program.command(COMMAND_NAME.BUILD).action(async (options, cmd) => {
38+
const args = {
39+
...{ writeToDisk: true, watch: false, forceLegacy: true }, ...cmd.optsWithGlobals(), ...options
40+
};
41+
process.env.NODE_ENV = process.env.NODE_ENV ?? 'production';
42+
43+
await build({ args, command: COMMAND_NAME.BUILD });
44+
});
45+
46+
program.command(COMMAND_NAME.START).action(async (options, cmd) => {
47+
const args = {
48+
...{ watch: false }, ...cmd.optsWithGlobals(), ...options
49+
};
50+
process.env.NODE_ENV = process.env.NODE_ENV ?? 'production';
51+
52+
await start({ args, command: COMMAND_NAME.START});
53+
});
54+
55+
program.command(COMMAND_NAME.TEST).allowUnknownOption().action(async (options, cmd) => {
56+
process.env.NODE_ENV = process.env.NODE_ENV ?? 'test';
57+
58+
await test({ args: cmd.args, command: COMMAND_NAME.TEST });
59+
});
60+
61+
program.parse(process.argv);

0 commit comments

Comments
 (0)