@chanmeng666/archlang 0.1.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/LICENSE +22 -0
- package/README.md +169 -0
- package/dist/chunk-J5DEA2KQ.js +997 -0
- package/dist/chunk-J5DEA2KQ.js.map +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +85 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +141 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/examples/studio.arch +37 -0
- package/examples/studio.svg +73 -0
- package/examples/two-bed.arch +39 -0
- package/examples/two-bed.svg +84 -0
- package/package.json +64 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="769.58" viewBox="-1901 -1901 13802 11802" font-family="Helvetica, Arial, sans-serif">
|
|
2
|
+
<defs><pattern id="poche" patternUnits="userSpaceOnUse" width="133.9" height="133.9" patternTransform="rotate(45)"><rect width="133.9" height="133.9" fill="#e9e4db"/><line x1="0" y1="0" x2="0" y2="133.9" stroke="#b9b1a4" stroke-width="11.54"/></pattern></defs>
|
|
3
|
+
<rect x="-1901" y="-1901" width="13802" height="11802" fill="#ffffff"/>
|
|
4
|
+
<polygon points="0,0 4000,0 4000,5000 0,5000" fill="#fbfaf7"/>
|
|
5
|
+
<polygon points="4000,0 10000,0 10000,5000 4000,5000" fill="#fbfaf7"/>
|
|
6
|
+
<polygon points="0,5000 4000,5000 4000,8000 0,8000" fill="#fbfaf7"/>
|
|
7
|
+
<polygon points="4000,5000 7000,5000 7000,8000 4000,8000" fill="#fbfaf7"/>
|
|
8
|
+
<polygon points="7000,5000 10000,5000 10000,8000 7000,8000" fill="#fbfaf7"/>
|
|
9
|
+
<polygon points="5000,300 6800,300 6800,2400 5000,2400" fill="#f4f2ee" stroke="#a8a29a" stroke-width="16.48"/>
|
|
10
|
+
<text x="5900" y="1350" font-size="175.1" fill="#9a948c" text-anchor="middle" dominant-baseline="central">Bed</text>
|
|
11
|
+
<polygon points="300,5300 1700,5300 1700,7300 300,7300" fill="#f4f2ee" stroke="#a8a29a" stroke-width="16.48"/>
|
|
12
|
+
<text x="1000" y="6300" font-size="175.1" fill="#9a948c" text-anchor="middle" dominant-baseline="central">Bed</text>
|
|
13
|
+
<polygon points="-150,150 10150,150 10150,-150 -150,-150" fill="url(#poche)"/>
|
|
14
|
+
<polygon points="9850,-150 9850,8150 10150,8150 10150,-150" fill="url(#poche)"/>
|
|
15
|
+
<polygon points="10150,7850 -150,7850 -150,8150 10150,8150" fill="url(#poche)"/>
|
|
16
|
+
<polygon points="150,8150 150,-150 -150,-150 -150,8150" fill="url(#poche)"/>
|
|
17
|
+
<polygon points="3950,-50 3950,5050 4050,5050 4050,-50" fill="url(#poche)"/>
|
|
18
|
+
<polygon points="3950,5050 10050,5050 10050,4950 3950,4950" fill="url(#poche)"/>
|
|
19
|
+
<polygon points="6950,4950 6950,8050 7050,8050 7050,4950" fill="url(#poche)"/>
|
|
20
|
+
<line x1="0" y1="150" x2="10000" y2="150" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
21
|
+
<line x1="0" y1="-150" x2="10000" y2="-150" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
22
|
+
<line x1="9850" y1="0" x2="9850" y2="8000" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
23
|
+
<line x1="10150" y1="0" x2="10150" y2="8000" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
24
|
+
<line x1="10000" y1="7850" x2="0" y2="7850" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
25
|
+
<line x1="10000" y1="8150" x2="0" y2="8150" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
26
|
+
<line x1="150" y1="8000" x2="150" y2="0" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
27
|
+
<line x1="-150" y1="8000" x2="-150" y2="0" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
28
|
+
<line x1="3950" y1="0" x2="3950" y2="5000" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
29
|
+
<line x1="4050" y1="0" x2="4050" y2="5000" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
30
|
+
<line x1="4000" y1="5050" x2="10000" y2="5050" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
31
|
+
<line x1="4000" y1="4950" x2="10000" y2="4950" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
32
|
+
<line x1="6950" y1="5000" x2="6950" y2="8000" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
33
|
+
<line x1="7050" y1="5000" x2="7050" y2="8000" stroke="#1b1b1b" stroke-width="28.84" stroke-linecap="square"/>
|
|
34
|
+
<polygon points="3921.16,2050 3921.16,2950 4078.84,2950 4078.84,2050" fill="#ffffff"/>
|
|
35
|
+
<line x1="4000" y1="2050" x2="3100" y2="2050" stroke="#555555" stroke-width="21.42"/>
|
|
36
|
+
<path d="M 3100,2050 A 900 900 0 0 1 4000,2950" fill="none" stroke="#555555" stroke-width="16.48" stroke-dasharray="65.92 49.44"/>
|
|
37
|
+
<polygon points="5100,5078.84 5900,5078.84 5900,4921.16 5100,4921.16" fill="#ffffff"/>
|
|
38
|
+
<line x1="5100" y1="5000" x2="5100" y2="5800" stroke="#555555" stroke-width="21.42"/>
|
|
39
|
+
<path d="M 5100,5800 A 800 800 0 0 1 5900,5000" fill="none" stroke="#555555" stroke-width="16.48" stroke-dasharray="65.92 49.44"/>
|
|
40
|
+
<polygon points="6921.16,6050 6921.16,6950 7078.84,6950 7078.84,6050" fill="#ffffff"/>
|
|
41
|
+
<line x1="7000" y1="6950" x2="6100" y2="6950" stroke="#555555" stroke-width="21.42"/>
|
|
42
|
+
<path d="M 6100,6950 A 900 900 0 0 0 7000,6050" fill="none" stroke="#555555" stroke-width="16.48" stroke-dasharray="65.92 49.44"/>
|
|
43
|
+
<polygon points="1000,178.84 3000,178.84 3000,-178.84 1000,-178.84" fill="#ffffff"/>
|
|
44
|
+
<line x1="1000" y1="150" x2="3000" y2="150" stroke="#1b1b1b" stroke-width="16.48"/>
|
|
45
|
+
<line x1="1000" y1="-150" x2="3000" y2="-150" stroke="#1b1b1b" stroke-width="16.48"/>
|
|
46
|
+
<line x1="1000" y1="0" x2="3000" y2="0" stroke="#3a6ea5" stroke-width="16.48"/>
|
|
47
|
+
<polygon points="6800,178.84 9200,178.84 9200,-178.84 6800,-178.84" fill="#ffffff"/>
|
|
48
|
+
<line x1="6800" y1="150" x2="9200" y2="150" stroke="#1b1b1b" stroke-width="16.48"/>
|
|
49
|
+
<line x1="6800" y1="-150" x2="9200" y2="-150" stroke="#1b1b1b" stroke-width="16.48"/>
|
|
50
|
+
<line x1="6800" y1="0" x2="9200" y2="0" stroke="#3a6ea5" stroke-width="16.48"/>
|
|
51
|
+
<polygon points="178.84,3750 178.84,2250 -178.84,2250 -178.84,3750" fill="#ffffff"/>
|
|
52
|
+
<line x1="150" y1="3750" x2="150" y2="2250" stroke="#1b1b1b" stroke-width="16.48"/>
|
|
53
|
+
<line x1="-150" y1="3750" x2="-150" y2="2250" stroke="#1b1b1b" stroke-width="16.48"/>
|
|
54
|
+
<line x1="0" y1="3750" x2="0" y2="2250" stroke="#3a6ea5" stroke-width="16.48"/>
|
|
55
|
+
<polygon points="9821.16,2250 9821.16,3750 10178.84,3750 10178.84,2250" fill="#ffffff"/>
|
|
56
|
+
<line x1="9850" y1="2250" x2="9850" y2="3750" stroke="#1b1b1b" stroke-width="16.48"/>
|
|
57
|
+
<line x1="10150" y1="2250" x2="10150" y2="3750" stroke="#1b1b1b" stroke-width="16.48"/>
|
|
58
|
+
<line x1="10000" y1="2250" x2="10000" y2="3750" stroke="#3a6ea5" stroke-width="16.48"/>
|
|
59
|
+
<text x="2000" y="2438.2" font-size="309" fill="#222222" text-anchor="middle" dominant-baseline="central" font-weight="600">Kitchen / Living</text>
|
|
60
|
+
<text x="2000" y="2778.1" font-size="226.6" fill="#7a7a7a" text-anchor="middle" dominant-baseline="central">20.0 m²</text>
|
|
61
|
+
<text x="7000" y="2438.2" font-size="309" fill="#222222" text-anchor="middle" dominant-baseline="central" font-weight="600">Master Bedroom</text>
|
|
62
|
+
<text x="7000" y="2778.1" font-size="226.6" fill="#7a7a7a" text-anchor="middle" dominant-baseline="central">30.0 m²</text>
|
|
63
|
+
<text x="2000" y="6438.2" font-size="309" fill="#222222" text-anchor="middle" dominant-baseline="central" font-weight="600">Bedroom 2</text>
|
|
64
|
+
<text x="2000" y="6778.1" font-size="226.6" fill="#7a7a7a" text-anchor="middle" dominant-baseline="central">12.0 m²</text>
|
|
65
|
+
<text x="5500" y="6438.2" font-size="309" fill="#222222" text-anchor="middle" dominant-baseline="central" font-weight="600">Bathroom</text>
|
|
66
|
+
<text x="5500" y="6778.1" font-size="226.6" fill="#7a7a7a" text-anchor="middle" dominant-baseline="central">9.0 m²</text>
|
|
67
|
+
<text x="8500" y="6438.2" font-size="309" fill="#222222" text-anchor="middle" dominant-baseline="central" font-weight="600">Hall</text>
|
|
68
|
+
<text x="8500" y="6778.1" font-size="226.6" fill="#7a7a7a" text-anchor="middle" dominant-baseline="central">9.0 m²</text>
|
|
69
|
+
<line x1="0" y1="8000" x2="0" y2="8700" stroke="#0E5484" stroke-width="11.54"/>
|
|
70
|
+
<line x1="10000" y1="8000" x2="10000" y2="8700" stroke="#0E5484" stroke-width="11.54"/>
|
|
71
|
+
<line x1="0" y1="8700" x2="10000" y2="8700" stroke="#0E5484" stroke-width="16.48"/>
|
|
72
|
+
<line x1="87.4" y1="8787.4" x2="-87.4" y2="8612.6" stroke="#0E5484" stroke-width="16.48"/>
|
|
73
|
+
<line x1="10087.4" y1="8787.4" x2="9912.6" y2="8612.6" stroke="#0E5484" stroke-width="16.48"/>
|
|
74
|
+
<text x="5000" y="8844.2" font-size="206" fill="#0E5484" text-anchor="middle" dominant-baseline="central" transform="rotate(0 5000 8844.2)">10000</text>
|
|
75
|
+
<line x1="0" y1="0" x2="-700" y2="0" stroke="#0E5484" stroke-width="11.54"/>
|
|
76
|
+
<line x1="0" y1="8000" x2="-700" y2="8000" stroke="#0E5484" stroke-width="11.54"/>
|
|
77
|
+
<line x1="-700" y1="0" x2="-700" y2="8000" stroke="#0E5484" stroke-width="16.48"/>
|
|
78
|
+
<line x1="-787.4" y1="87.4" x2="-612.6" y2="-87.4" stroke="#0E5484" stroke-width="16.48"/>
|
|
79
|
+
<line x1="-787.4" y1="8087.4" x2="-612.6" y2="7912.6" stroke="#0E5484" stroke-width="16.48"/>
|
|
80
|
+
<text x="-844.2" y="4000" font-size="206" fill="#0E5484" text-anchor="middle" dominant-baseline="central" transform="rotate(90 -844.2 4000)">8000</text>
|
|
81
|
+
<g><polygon points="9686.5,-1576.55 9454.75,-834.95 9686.5,-997.18 9918.25,-834.95" fill="#333333" transform="rotate(90 9686.5 -1113.05)"/><text x="10364.24" y="-1113.05" font-size="267.8" fill="#333333" text-anchor="middle" dominant-baseline="central">N</text></g>
|
|
82
|
+
<g><rect x="-150" y="9113.05" width="1000" height="144.2" fill="#333333"/><rect x="850" y="9113.05" width="1000" height="144.2" fill="none" stroke="#333333" stroke-width="16.48"/><text x="-150" y="9463.25" font-size="206" fill="#333333" text-anchor="start" dominant-baseline="central">0</text><text x="1850" y="9463.25" font-size="206" fill="#333333" text-anchor="middle" dominant-baseline="central">2 m</text></g>
|
|
83
|
+
<g><rect x="6648" y="8412.65" width="3502" height="1435.82" fill="none" stroke="#333333" stroke-width="16.48"/><text x="6823.1" y="8592.13" font-size="156.56" fill="#888888" dominant-baseline="central">PROJECT</text><text x="9974.9" y="8592.13" font-size="195.7" fill="#333333" text-anchor="end" dominant-baseline="central">Two-Bedroom Flat</text><text x="6823.1" y="8951.08" font-size="156.56" fill="#888888" dominant-baseline="central">DRAWN BY</text><text x="9974.9" y="8951.08" font-size="195.7" fill="#333333" text-anchor="end" dominant-baseline="central">ArchCanvas</text><line x1="6648" y1="8771.61" x2="10150" y2="8771.61" stroke="#333333" stroke-width="8.24"/><text x="6823.1" y="9310.04" font-size="156.56" fill="#888888" dominant-baseline="central">DATE</text><text x="9974.9" y="9310.04" font-size="195.7" fill="#333333" text-anchor="end" dominant-baseline="central">2026-06-25</text><line x1="6648" y1="9130.56" x2="10150" y2="9130.56" stroke="#333333" stroke-width="8.24"/><text x="6823.1" y="9668.99" font-size="156.56" fill="#888888" dominant-baseline="central">SCALE</text><text x="9974.9" y="9668.99" font-size="195.7" fill="#333333" text-anchor="end" dominant-baseline="central">1:100</text><line x1="6648" y1="9489.52" x2="10150" y2="9489.52" stroke="#333333" stroke-width="8.24"/></g>
|
|
84
|
+
</svg>
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chanmeng666/archlang",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A small declarative language that compiles to professional SVG floor plans — like Typst/LaTeX, but for architecture.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"architecture",
|
|
7
|
+
"floor-plan",
|
|
8
|
+
"dsl",
|
|
9
|
+
"compiler",
|
|
10
|
+
"svg",
|
|
11
|
+
"cad",
|
|
12
|
+
"typst",
|
|
13
|
+
"parametric",
|
|
14
|
+
"language"
|
|
15
|
+
],
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"author": "Chan Meng <chanmeng.dev@gmail.com>",
|
|
18
|
+
"homepage": "https://github.com/chanmeng666/archlang#readme",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/chanmeng666/archlang.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/chanmeng666/archlang/issues"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"module": "./dist/index.js",
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"import": "./dist/index.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"bin": {
|
|
37
|
+
"arch": "./dist/cli.js"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"examples",
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE"
|
|
44
|
+
],
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "tsup",
|
|
50
|
+
"dev": "tsup --watch",
|
|
51
|
+
"typecheck": "tsc --noEmit",
|
|
52
|
+
"test": "vitest run",
|
|
53
|
+
"test:watch": "vitest",
|
|
54
|
+
"cli": "tsx src/cli.ts",
|
|
55
|
+
"prepublishOnly": "npm run build && npm run test"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "^22.20.0",
|
|
59
|
+
"tsup": "^8.3.5",
|
|
60
|
+
"tsx": "^4.19.2",
|
|
61
|
+
"typescript": "^5.7.2",
|
|
62
|
+
"vitest": "^2.1.8"
|
|
63
|
+
}
|
|
64
|
+
}
|