@ikas/component-cli 0.82.0 → 0.85.0

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 (39) hide show
  1. package/dist/commands/create.d.ts.map +1 -1
  2. package/dist/commands/create.js +36 -791
  3. package/dist/commands/create.js.map +1 -1
  4. package/dist/utils/component-helpers.d.ts +1 -1
  5. package/dist/utils/component-helpers.d.ts.map +1 -1
  6. package/dist/utils/component-helpers.js +13 -65
  7. package/dist/utils/component-helpers.js.map +1 -1
  8. package/dist/utils/observer-runtime.d.ts.map +1 -1
  9. package/dist/utils/observer-runtime.js +2 -37
  10. package/dist/utils/observer-runtime.js.map +1 -1
  11. package/dist/utils/template.d.ts +8 -0
  12. package/dist/utils/template.d.ts.map +1 -0
  13. package/dist/utils/template.js +24 -0
  14. package/dist/utils/template.js.map +1 -0
  15. package/package.json +3 -2
  16. package/templates/add/component.css +13 -0
  17. package/templates/add/component.tsx +12 -0
  18. package/templates/add/section.css +17 -0
  19. package/templates/add/section.tsx +14 -0
  20. package/templates/create/CLAUDE.md +258 -0
  21. package/templates/create/README.md +50 -0
  22. package/templates/create/cursorrules +108 -0
  23. package/templates/create/gitignore +5 -0
  24. package/templates/create/ikas.config.json +95 -0
  25. package/templates/create/mcp.json +10 -0
  26. package/templates/create/package.json +21 -0
  27. package/templates/create/src/components/ExampleComponent/index.tsx +22 -0
  28. package/templates/create/src/components/ExampleComponent/styles.css +36 -0
  29. package/templates/create/src/components/ExampleComponent/types.ts +7 -0
  30. package/templates/create/src/components/ExampleSection/index.tsx +14 -0
  31. package/templates/create/src/components/ExampleSection/styles.css +29 -0
  32. package/templates/create/src/components/ExampleSection/types.ts +6 -0
  33. package/templates/create/src/components/index.ts +2 -0
  34. package/templates/create/src/global-types.ts +5 -0
  35. package/templates/create/src/global.css +12 -0
  36. package/templates/create/src/ikas-component-utils.d.ts +3 -0
  37. package/templates/create/tsconfig.json +30 -0
  38. package/templates/create/vite.config.ts +15 -0
  39. package/templates/observer-runtime.js +34 -0
@@ -0,0 +1,6 @@
1
+ // Auto-generated types based on ikas.config.json props
2
+ export interface Props {
3
+ heading: string;
4
+ subtitle?: string;
5
+ backgroundColor?: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ export { ExampleComponent } from "./ExampleComponent/index";
2
+ export { ExampleSection } from "./ExampleSection/index";
@@ -0,0 +1,5 @@
1
+ // Auto-generated global type definitions for ikas code components.
2
+ // Custom enum types from the editor will appear here.
3
+ // This file is regenerated automatically — do not edit manually.
4
+
5
+ export {};
@@ -0,0 +1,12 @@
1
+ /*
2
+ * Global styles for your ikas code components project.
3
+ * These styles are NOT scoped — they apply across all components.
4
+ * Use this for CSS resets, base typography, utility classes, or CSS variables.
5
+ *
6
+ * Loading order:
7
+ * 1. Global CSS (this file) — lowest specificity
8
+ * 2. Shared chunk CSS — multi-scope (.cc_a .sel, .cc_b .sel)
9
+ * 3. Component CSS — single scope (.cc_id .sel) — highest specificity
10
+ *
11
+ * Component-scoped styles naturally override these globals.
12
+ */
@@ -0,0 +1,3 @@
1
+ declare module "@ikas/component-utils" {
2
+ export function observer<T extends (props: any) => any>(component: T): T;
3
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": [
5
+ "DOM",
6
+ "DOM.Iterable",
7
+ "ES2022"
8
+ ],
9
+ "module": "ESNext",
10
+ "moduleResolution": "bundler",
11
+ "jsx": "react-jsx",
12
+ "jsxImportSource": "preact",
13
+ "strict": true,
14
+ "esModuleInterop": true,
15
+ "skipLibCheck": true,
16
+ "forceConsistentCasingInFileNames": true,
17
+ "resolveJsonModule": true,
18
+ "declaration": true,
19
+ "declarationMap": true,
20
+ "outDir": "./dist",
21
+ "rootDir": "./src"
22
+ },
23
+ "include": [
24
+ "src/**/*"
25
+ ],
26
+ "exclude": [
27
+ "node_modules",
28
+ "dist"
29
+ ]
30
+ }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from "vite";
2
+ import preact from "@preact/preset-vite";
3
+
4
+ export default defineConfig({
5
+ plugins: [preact()],
6
+ build: {
7
+ lib: {
8
+ entry: "./src/components/index.ts",
9
+ formats: ["es"]
10
+ },
11
+ rollupOptions: {
12
+ external: ["preact", "preact/hooks", "@ikas/component-utils"]
13
+ }
14
+ }
15
+ });
@@ -0,0 +1,34 @@
1
+ import { Reaction } from "mobx";
2
+ import { useRef, useState, useEffect } from "preact/hooks";
3
+
4
+ export function observer(Component) {
5
+ var wrapped = function(props) {
6
+ var hookState = useState(0);
7
+ var setTick = hookState[1];
8
+ var reactionRef = useRef(null);
9
+
10
+ if (!reactionRef.current) {
11
+ reactionRef.current = new Reaction(
12
+ "observer(" + (Component.displayName || Component.name || "Component") + ")",
13
+ function() { setTick(function(t) { return t + 1; }); }
14
+ );
15
+ }
16
+
17
+ useEffect(function() {
18
+ return function() {
19
+ if (reactionRef.current) {
20
+ reactionRef.current.dispose();
21
+ reactionRef.current = null;
22
+ }
23
+ };
24
+ }, []);
25
+
26
+ var result;
27
+ reactionRef.current.track(function() {
28
+ result = Component(props);
29
+ });
30
+ return result;
31
+ };
32
+ wrapped.displayName = "observer(" + (Component.displayName || Component.name || "Component") + ")";
33
+ return wrapped;
34
+ }