@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.
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +36 -791
- package/dist/commands/create.js.map +1 -1
- package/dist/utils/component-helpers.d.ts +1 -1
- package/dist/utils/component-helpers.d.ts.map +1 -1
- package/dist/utils/component-helpers.js +13 -65
- package/dist/utils/component-helpers.js.map +1 -1
- package/dist/utils/observer-runtime.d.ts.map +1 -1
- package/dist/utils/observer-runtime.js +2 -37
- package/dist/utils/observer-runtime.js.map +1 -1
- package/dist/utils/template.d.ts +8 -0
- package/dist/utils/template.d.ts.map +1 -0
- package/dist/utils/template.js +24 -0
- package/dist/utils/template.js.map +1 -0
- package/package.json +3 -2
- package/templates/add/component.css +13 -0
- package/templates/add/component.tsx +12 -0
- package/templates/add/section.css +17 -0
- package/templates/add/section.tsx +14 -0
- package/templates/create/CLAUDE.md +258 -0
- package/templates/create/README.md +50 -0
- package/templates/create/cursorrules +108 -0
- package/templates/create/gitignore +5 -0
- package/templates/create/ikas.config.json +95 -0
- package/templates/create/mcp.json +10 -0
- package/templates/create/package.json +21 -0
- package/templates/create/src/components/ExampleComponent/index.tsx +22 -0
- package/templates/create/src/components/ExampleComponent/styles.css +36 -0
- package/templates/create/src/components/ExampleComponent/types.ts +7 -0
- package/templates/create/src/components/ExampleSection/index.tsx +14 -0
- package/templates/create/src/components/ExampleSection/styles.css +29 -0
- package/templates/create/src/components/ExampleSection/types.ts +6 -0
- package/templates/create/src/components/index.ts +2 -0
- package/templates/create/src/global-types.ts +5 -0
- package/templates/create/src/global.css +12 -0
- package/templates/create/src/ikas-component-utils.d.ts +3 -0
- package/templates/create/tsconfig.json +30 -0
- package/templates/create/vite.config.ts +15 -0
- package/templates/observer-runtime.js +34 -0
|
@@ -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,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
|
+
}
|