@mapples/cli 0.0.3 → 0.0.6
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/dist/commands/assets.d.ts +2 -2
- package/dist/commands/global.d.ts +2 -2
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/pages.d.ts +2 -2
- package/dist/commands/style.d.ts +2 -2
- package/dist/index.js +86 -46
- package/dist/index.js.map +1 -1
- package/dist/utils/config.d.ts +3 -2
- package/package.json +1 -1
- package/templates/PageTemplate/.donotedit +8 -1
- package/templates/PageTemplate/index.ts.tmpl +1 -1
- package/templates/PageTemplate/{{PageName}}Mapplet.tsx.tmpl +23 -0
- package/templates/PageTemplate/{{PageName}}Component.tsx.tmpl +0 -8
package/dist/utils/config.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface MapplesConfig {
|
|
|
12
12
|
}
|
|
13
13
|
export declare const DEFAULT_CONFIG: Omit<MapplesConfig, 'apiKey'>;
|
|
14
14
|
export declare const CONFIG_FILE_PATH = ".mapplesrc.json";
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
15
|
+
export declare const findConfigFile: (startPath?: string) => string | null;
|
|
16
|
+
export declare const readConfig: (configPath?: string) => MapplesConfig | null;
|
|
17
|
+
export declare const writeConfig: (config: MapplesConfig, configPath?: string) => void;
|
|
17
18
|
export declare const updateGitignore: () => void;
|
package/package.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RenderComponent } from '@mapples/render';
|
|
2
|
+
import { MappletType } from '@mapples/types';
|
|
3
|
+
import ActionProvider from '@mapples/action';
|
|
4
|
+
import StateProvider from '@mapples/state';
|
|
5
|
+
|
|
6
|
+
import { root } from './{{PageName}}.json';
|
|
7
|
+
|
|
8
|
+
// @todo: This Mapplet can be updated
|
|
9
|
+
// read docs of how you can customize it: https://docs.com
|
|
10
|
+
export type {{PageName}}MappletProps<T extends object> = MappletType<T> & {};
|
|
11
|
+
|
|
12
|
+
export default function {{PageName}}Mapplet<State extends object = object>({
|
|
13
|
+
state,
|
|
14
|
+
onAction,
|
|
15
|
+
}: HomeMappletProps<State>) {
|
|
16
|
+
return (
|
|
17
|
+
<StateProvider state={state}>
|
|
18
|
+
<ActionProvider onAction={onAction}>
|
|
19
|
+
<RenderComponent {...root} />
|
|
20
|
+
</ActionProvider>
|
|
21
|
+
</StateProvider>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { RenderComponent, RenderComponentType } from '@mapples/render'
|
|
2
|
-
import data from './{{PageName}}.json'
|
|
3
|
-
|
|
4
|
-
const {{PageName}}Component: RenderComponentType = ({ handlers }) => {
|
|
5
|
-
return <RenderComponent handlers={handlers} {...data} />
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default {{PageName}}Component;
|