@plumeria/core 0.3.0 → 0.3.1

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 (2) hide show
  1. package/bin/css.mjs +40 -0
  2. package/package.json +6 -1
package/bin/css.mjs ADDED
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execSync } from 'child_process';
4
+ import path from 'path';
5
+ import { styleText } from 'util';
6
+
7
+ const checkMark = styleText('greenBright', '✓');
8
+
9
+ try {
10
+ const typecheck = process.argv.includes('--type-check');
11
+ if (typecheck) {
12
+ execSync('npx tsc --noEmit --incremental false', {
13
+ stdio: 'inherit',
14
+ cwd: process.cwd(),
15
+ });
16
+ }
17
+
18
+ const compilerPath = findCompilerPath();
19
+
20
+ const argv = process.argv.includes('--log') ? ' --log' : '';
21
+ execSync(`npx tsx ${path.join(compilerPath, 'src/index.ts')}${argv}`, {
22
+ stdio: 'inherit',
23
+ cwd: compilerPath,
24
+ });
25
+
26
+ const completed = typecheck ? 'Type-check completed' : '';
27
+ console.log(` ${checkMark} Compiled... ${completed}`);
28
+ } catch (error) {
29
+ console.error('Compilation failed:', error.message);
30
+ process.exit(1);
31
+ }
32
+
33
+ function findCompilerPath() {
34
+ try {
35
+ const compilerMain = require.resolve('@plumeria/compiler');
36
+ return path.dirname(compilerMain);
37
+ } catch (error) {
38
+ throw new Error('Could not resolve @plumeria/compiler package');
39
+ }
40
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/core",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Near Zero-runtime CSS-in-JS for efficient design systems.",
5
5
  "keywords": [
6
6
  "react",
@@ -15,9 +15,14 @@
15
15
  "main": "dist/index.js",
16
16
  "types": "dist/index.d.ts",
17
17
  "files": [
18
+ "bin",
18
19
  "dist"
19
20
  ],
21
+ "bin": {
22
+ "css": "./bin/css.mjs"
23
+ },
20
24
  "dependencies": {
25
+ "@plumeria/compiler": "^0.3.0",
21
26
  "@plumeria/collection": "^0.1.2",
22
27
  "zss-engine": "^0.2.3"
23
28
  },