@preact-mvc/cli 0.1.1 → 0.1.2
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.
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/cli.mjs +2 -2
- package/src/commands/generate.mjs +1 -1
- package/src/commands/new.mjs +2 -2
- package/src/commands/run.mjs +1 -1
- package/src/commands/update.mjs +1 -1
- package/src/templates.mjs +1 -1
package/README.md
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
[](https://badge.socket.dev/npm/package/@preact-mvc/cli)
|
|
6
6
|
|
|
7
7
|
The `pmvc` binary — scaffolding, generators, dev/build/test delegation,
|
|
8
|
-
and dependency maintenance for
|
|
8
|
+
and dependency maintenance for PreactMVC projects.
|
|
9
9
|
|
|
10
|
-
**[
|
|
10
|
+
**[PreactMVC — CLI documentation](https://jwhenry3.github.io/preact-mvc/docs/cli/)**
|
|
11
11
|
|
|
12
12
|
## Install
|
|
13
13
|
|
package/package.json
CHANGED
package/src/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* pmvc — the
|
|
3
|
+
* pmvc — the PreactMVC CLI. Angular-CLI-shaped: new / generate /
|
|
4
4
|
* serve / build / test / add / update / version / docs.
|
|
5
5
|
*
|
|
6
6
|
* Dependency-free on purpose: the CLI must run before a project has
|
|
@@ -13,7 +13,7 @@ import { cmdNew } from './commands/new.mjs';
|
|
|
13
13
|
import { cmdGenerate } from './commands/generate.mjs';
|
|
14
14
|
import { cmdBuild, cmdServe, cmdTest } from './commands/run.mjs';
|
|
15
15
|
import { cmdAdd, cmdUpdate } from './commands/update.mjs';
|
|
16
|
-
const HELP = `pmvc — the
|
|
16
|
+
const HELP = `pmvc — the PreactMVC CLI
|
|
17
17
|
|
|
18
18
|
Usage: pmvc <command> [args] [flags]
|
|
19
19
|
|
|
@@ -97,7 +97,7 @@ export function cmdGenerate(a) {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
const found = findProjectRoot();
|
|
100
|
-
if (!found) fail('not inside a
|
|
100
|
+
if (!found) fail('not inside a PreactMVC project (no @preact-mvc/core dependency found)');
|
|
101
101
|
const name = featureName(rawName);
|
|
102
102
|
|
|
103
103
|
if (schematic === 'island') {
|
package/src/commands/new.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `pmvc new <dir>` — scaffold a
|
|
2
|
+
* `pmvc new <dir>` — scaffold a PreactMVC application, the `ng new`
|
|
3
3
|
* equivalent. Flags: --islands, --tailwind, --skip-install,
|
|
4
4
|
* --skip-tests, -d/--dry-run, --force (overwrite existing files).
|
|
5
5
|
*/
|
|
@@ -119,7 +119,7 @@ export function cmdNew(argv) {
|
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
log(`\nScaffolding a
|
|
122
|
+
log(`\nScaffolding a PreactMVC app in ${root}\n`);
|
|
123
123
|
for (const [rel, contents] of Object.entries(files)) {
|
|
124
124
|
writeFile(root, rel, contents, opts);
|
|
125
125
|
}
|
package/src/commands/run.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { findProjectRoot, readJson, run, fail } from '../lib.mjs';
|
|
|
10
10
|
|
|
11
11
|
function projectRoot() {
|
|
12
12
|
const found = findProjectRoot();
|
|
13
|
-
if (!found) fail('not inside a
|
|
13
|
+
if (!found) fail('not inside a PreactMVC project (no @preact-mvc/core dependency found)');
|
|
14
14
|
return found.root;
|
|
15
15
|
}
|
|
16
16
|
|
package/src/commands/update.mjs
CHANGED
|
@@ -24,7 +24,7 @@ import * as T from '../templates.mjs';
|
|
|
24
24
|
|
|
25
25
|
function project() {
|
|
26
26
|
const found = findProjectRoot();
|
|
27
|
-
if (!found) fail('not inside a
|
|
27
|
+
if (!found) fail('not inside a PreactMVC project (no @preact-mvc/core dependency found)');
|
|
28
28
|
return found;
|
|
29
29
|
}
|
|
30
30
|
|
package/src/templates.mjs
CHANGED
|
@@ -104,7 +104,7 @@ save-exact=true
|
|
|
104
104
|
|
|
105
105
|
export const T_README = `# %%NAME%%
|
|
106
106
|
|
|
107
|
-
A [
|
|
107
|
+
A [PreactMVC](https://github.com/jwhenry3/preact-mvc) application —
|
|
108
108
|
Angular-style modules, DI, and MVC on class-based JSX views rendered by
|
|
109
109
|
Preact, with signal reactivity.
|
|
110
110
|
|