juo 0.3.0-alpha.6 → 0.3.0-alpha.7
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 +1 -1
- package/dist/commands/blocks/dev.d.ts +2 -2
- package/dist/commands/create.d.ts +4 -4
- package/dist/commands/create.js +32 -32
- package/dist/commands/generate.d.ts +5 -5
- package/dist/commands/publish/index.d.ts +2 -2
- package/dist/lib/index.js +1 -1
- package/dist/{packageGenerator-BwUFIvNN.js → packageGenerator-WVKFotEV.js} +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as BaseCommand } from "../../base-command-BQVnm_gK.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _oclif_core_interfaces10 from "@oclif/core/interfaces";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/blocks/dev.d.ts
|
|
5
5
|
declare class Dev extends BaseCommand<typeof Dev> {
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
port:
|
|
9
|
+
port: _oclif_core_interfaces10.OptionFlag<number, _oclif_core_interfaces10.CustomOptions>;
|
|
10
10
|
};
|
|
11
11
|
run(): Promise<void>;
|
|
12
12
|
private resolvePackageJsonPath;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command } from "@oclif/core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _oclif_core_interfaces5 from "@oclif/core/interfaces";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/create.d.ts
|
|
5
5
|
declare class Create extends Command {
|
|
6
6
|
static description: string;
|
|
7
7
|
static flags: {
|
|
8
|
-
quickstart:
|
|
9
|
-
storybook:
|
|
10
|
-
verbose:
|
|
8
|
+
quickstart: _oclif_core_interfaces5.BooleanFlag<boolean>;
|
|
9
|
+
storybook: _oclif_core_interfaces5.BooleanFlag<boolean>;
|
|
10
|
+
verbose: _oclif_core_interfaces5.BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
12
|
run(): Promise<void>;
|
|
13
13
|
private getProjectConfig;
|
package/dist/commands/create.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as BaseTemplateGenerator } from "../juoTemplateGenerator-RkinYN2l.js";
|
|
2
|
-
import { t as PackageGenerator } from "../packageGenerator-
|
|
2
|
+
import { t as PackageGenerator } from "../packageGenerator-WVKFotEV.js";
|
|
3
3
|
import { t as Generate } from "../generate-BiHo2p9_.js";
|
|
4
4
|
import { Command, Flags } from "@oclif/core";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
@@ -21,7 +21,7 @@ var ConfigFilesGenerator = class extends BaseTemplateGenerator {
|
|
|
21
21
|
var DevHarnessGenerator = class extends BaseTemplateGenerator {
|
|
22
22
|
generate(destDir, options) {
|
|
23
23
|
this.renderTemplate("dev", destDir, {
|
|
24
|
-
devtoolsVersion: "0.1.0-alpha.
|
|
24
|
+
devtoolsVersion: "0.1.0-alpha.6",
|
|
25
25
|
editorVersion: "0.25.0-alpha.0",
|
|
26
26
|
extensionsVersion: "1.12.0-alpha.0",
|
|
27
27
|
tailwind: options.tailwind
|
|
@@ -91,36 +91,6 @@ var StorybookGenerator = class extends BaseTemplateGenerator {
|
|
|
91
91
|
const storybookDir = path.join(destDir, ".storybook");
|
|
92
92
|
this.renderTemplate(".storybook", storybookDir, {});
|
|
93
93
|
}
|
|
94
|
-
/**
|
|
95
|
-
* Prepends an import to the Storybook preview file (preview.ts/preview.js),
|
|
96
|
-
* creating it if Storybook init didn't. No-ops when the import is already
|
|
97
|
-
* present so repeated runs stay idempotent.
|
|
98
|
-
*/
|
|
99
|
-
prependImportToPreview(destDir, importStatement) {
|
|
100
|
-
const storybookDir = path.join(destDir, ".storybook");
|
|
101
|
-
const previewTsPath = path.join(storybookDir, "preview.ts");
|
|
102
|
-
const previewJsPath = path.join(storybookDir, "preview.js");
|
|
103
|
-
const line = `${importStatement}\n`;
|
|
104
|
-
let targetPath;
|
|
105
|
-
if (existsSync(previewTsPath)) targetPath = previewTsPath;
|
|
106
|
-
else if (existsSync(previewJsPath)) targetPath = previewJsPath;
|
|
107
|
-
else {
|
|
108
|
-
mkdirSync(storybookDir, { recursive: true });
|
|
109
|
-
writeFileSync(previewTsPath, line);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const existingContent = readFileSync(targetPath, "utf8");
|
|
113
|
-
if (!existingContent.includes(importStatement)) writeFileSync(targetPath, line + existingContent);
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* The starter block renders `@juo/customer-ui` web components (`<juo-card>`,
|
|
117
|
-
* `<juo-text>`, `<juo-button>`). The dev harness registers them via the
|
|
118
|
-
* generated `register.ts`, but the Storybook preview has no such entry, so
|
|
119
|
-
* import the side-effecting bundle here to define the custom elements.
|
|
120
|
-
*/
|
|
121
|
-
registerWebComponents(destDir) {
|
|
122
|
-
this.prependImportToPreview(destDir, "import \"@juo/customer-ui/web-components\";");
|
|
123
|
-
}
|
|
124
94
|
injectViteFinal(content, isTs) {
|
|
125
95
|
const viteFinal = [
|
|
126
96
|
" viteFinal: async (config) => {",
|
|
@@ -167,6 +137,36 @@ var StorybookGenerator = class extends BaseTemplateGenerator {
|
|
|
167
137
|
}
|
|
168
138
|
}
|
|
169
139
|
/**
|
|
140
|
+
* Prepends an import to the Storybook preview file (preview.ts/preview.js),
|
|
141
|
+
* creating it if Storybook init didn't. No-ops when the import is already
|
|
142
|
+
* present so repeated runs stay idempotent.
|
|
143
|
+
*/
|
|
144
|
+
prependImportToPreview(destDir, importStatement) {
|
|
145
|
+
const storybookDir = path.join(destDir, ".storybook");
|
|
146
|
+
const previewTsPath = path.join(storybookDir, "preview.ts");
|
|
147
|
+
const previewJsPath = path.join(storybookDir, "preview.js");
|
|
148
|
+
const line = `${importStatement}\n`;
|
|
149
|
+
let targetPath;
|
|
150
|
+
if (existsSync(previewTsPath)) targetPath = previewTsPath;
|
|
151
|
+
else if (existsSync(previewJsPath)) targetPath = previewJsPath;
|
|
152
|
+
else {
|
|
153
|
+
mkdirSync(storybookDir, { recursive: true });
|
|
154
|
+
writeFileSync(previewTsPath, line);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const existingContent = readFileSync(targetPath, "utf8");
|
|
158
|
+
if (!existingContent.includes(importStatement)) writeFileSync(targetPath, line + existingContent);
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The starter block renders `@juo/customer-ui` web components (`<juo-card>`,
|
|
162
|
+
* `<juo-text>`, `<juo-button>`). The dev harness registers them via the
|
|
163
|
+
* generated `register.ts`, but the Storybook preview has no such entry, so
|
|
164
|
+
* import the side-effecting bundle here to define the custom elements.
|
|
165
|
+
*/
|
|
166
|
+
registerWebComponents(destDir) {
|
|
167
|
+
this.prependImportToPreview(destDir, "import \"@juo/customer-ui/web-components\";");
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
170
|
* Storybook init scaffolds example stories (Button/Header/Page) into
|
|
171
171
|
* `src/stories`. The CLI emits real block stories into the top-level
|
|
172
172
|
* `stories/` dir afterwards, so drop the scaffolding to avoid shipping
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Command } from "@oclif/core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _oclif_core_interfaces0 from "@oclif/core/interfaces";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/generate.d.ts
|
|
5
5
|
declare class Generate extends Command {
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
8
8
|
static flags: {
|
|
9
|
-
name:
|
|
10
|
-
tailwind:
|
|
11
|
-
type:
|
|
12
|
-
verbose:
|
|
9
|
+
name: _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
|
|
10
|
+
tailwind: _oclif_core_interfaces0.BooleanFlag<boolean>;
|
|
11
|
+
type: _oclif_core_interfaces0.OptionFlag<string, _oclif_core_interfaces0.CustomOptions>;
|
|
12
|
+
verbose: _oclif_core_interfaces0.BooleanFlag<boolean>;
|
|
13
13
|
};
|
|
14
14
|
static id: string;
|
|
15
15
|
run(): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as BaseCommand } from "../../base-command-BQVnm_gK.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _oclif_core_interfaces8 from "@oclif/core/interfaces";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/publish/index.d.ts
|
|
5
5
|
declare class Publish extends BaseCommand<typeof Publish> {
|
|
@@ -7,7 +7,7 @@ declare class Publish extends BaseCommand<typeof Publish> {
|
|
|
7
7
|
static description: string;
|
|
8
8
|
static examples: string[];
|
|
9
9
|
static flags: {
|
|
10
|
-
theme:
|
|
10
|
+
theme: _oclif_core_interfaces8.OptionFlag<string, _oclif_core_interfaces8.CustomOptions>;
|
|
11
11
|
};
|
|
12
12
|
getAllFiles(dirPath: string, basePath: string): string[];
|
|
13
13
|
run(): Promise<void>;
|
package/dist/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { n as StoryGenerator, r as BaseTemplateGenerator, t as JuoTemplateGenerator } from "../juoTemplateGenerator-RkinYN2l.js";
|
|
2
|
-
import { t as PackageGenerator } from "../packageGenerator-
|
|
2
|
+
import { t as PackageGenerator } from "../packageGenerator-WVKFotEV.js";
|
|
3
3
|
|
|
4
4
|
export { BaseTemplateGenerator, JuoTemplateGenerator, PackageGenerator, StoryGenerator };
|
|
@@ -81,7 +81,7 @@ var PackageGenerator = class {
|
|
|
81
81
|
const frameworkConfig = FRAMEWORK_CONFIGS[options.framework];
|
|
82
82
|
baseConfig.dependencies = {
|
|
83
83
|
"@juo/blocks": "1.13.0-alpha.0",
|
|
84
|
-
"@juo/customer-ui": "0.5.0-alpha.
|
|
84
|
+
"@juo/customer-ui": "0.5.0-alpha.0",
|
|
85
85
|
...baseConfig.dependencies,
|
|
86
86
|
...frameworkConfig.dependencies
|
|
87
87
|
};
|
package/oclif.manifest.json
CHANGED