dxf-json 0.0.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 (167) hide show
  1. package/.github/FUNDING.yml +1 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  3. package/.github/ISSUE_TEMPLATE/custom.md +10 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  5. package/.github/pull_request_template.md +23 -0
  6. package/.github/workflows/npm-publish.yml +55 -0
  7. package/.swcrc +8 -0
  8. package/LICENSE +674 -0
  9. package/README.md +567 -0
  10. package/jest.config.js +20 -0
  11. package/package.json +56 -0
  12. package/src/consts/block.ts +22 -0
  13. package/src/consts/color.ts +6 -0
  14. package/src/consts/config.ts +2 -0
  15. package/src/consts/dimension.ts +69 -0
  16. package/src/consts/hatch.ts +52 -0
  17. package/src/consts/header.ts +10 -0
  18. package/src/consts/index.ts +9 -0
  19. package/src/consts/lineweight.ts +5 -0
  20. package/src/consts/measurement.ts +4 -0
  21. package/src/consts/obscuredLineTypes.ts +21 -0
  22. package/src/consts/scene.ts +2 -0
  23. package/src/consts/viewport.ts +62 -0
  24. package/src/index.ts +6 -0
  25. package/src/parser/AutoCadColorIndex.ts +265 -0
  26. package/src/parser/DxfArrayScanner.ts +161 -0
  27. package/src/parser/DxfParser.ts +108 -0
  28. package/src/parser/ParseHelpers.ts +124 -0
  29. package/src/parser/blocks/blocks.test.ts +97 -0
  30. package/src/parser/blocks/index.ts +88 -0
  31. package/src/parser/blocks/types.ts +15 -0
  32. package/src/parser/entities/arc/index.ts +2 -0
  33. package/src/parser/entities/arc/parser.ts +67 -0
  34. package/src/parser/entities/arc/types.ts +13 -0
  35. package/src/parser/entities/attdef/consts.ts +12 -0
  36. package/src/parser/entities/attdef/index.ts +3 -0
  37. package/src/parser/entities/attdef/parser.ts +119 -0
  38. package/src/parser/entities/attdef/types.ts +19 -0
  39. package/src/parser/entities/attribute/consts.ts +6 -0
  40. package/src/parser/entities/attribute/index.ts +3 -0
  41. package/src/parser/entities/attribute/parser.ts +198 -0
  42. package/src/parser/entities/attribute/types.ts +31 -0
  43. package/src/parser/entities/circle/index.ts +2 -0
  44. package/src/parser/entities/circle/parser.ts +58 -0
  45. package/src/parser/entities/circle/types.ts +11 -0
  46. package/src/parser/entities/dimension/common.ts +98 -0
  47. package/src/parser/entities/dimension/index.ts +24 -0
  48. package/src/parser/entities/dimension/types.ts +65 -0
  49. package/src/parser/entities/ellipse/index.ts +2 -0
  50. package/src/parser/entities/ellipse/parser.ts +66 -0
  51. package/src/parser/entities/ellipse/types.ts +13 -0
  52. package/src/parser/entities/entities.test.ts +86 -0
  53. package/src/parser/entities/hatch/boundaryPathData/edge.ts +190 -0
  54. package/src/parser/entities/hatch/boundaryPathData/index.ts +27 -0
  55. package/src/parser/entities/hatch/boundaryPathData/polyline.ts +43 -0
  56. package/src/parser/entities/hatch/boundaryPathData/shared.ts +16 -0
  57. package/src/parser/entities/hatch/index.ts +189 -0
  58. package/src/parser/entities/hatch/patternData.ts +57 -0
  59. package/src/parser/entities/hatch/types/boundaryPath.ts +72 -0
  60. package/src/parser/entities/hatch/types/definitionLine.ts +14 -0
  61. package/src/parser/entities/hatch/types/hatch.ts +47 -0
  62. package/src/parser/entities/hatch/types/index.ts +3 -0
  63. package/src/parser/entities/index.ts +87 -0
  64. package/src/parser/entities/insert/index.ts +2 -0
  65. package/src/parser/entities/insert/parser.ts +106 -0
  66. package/src/parser/entities/insert/types.ts +19 -0
  67. package/src/parser/entities/leader/consts.ts +6 -0
  68. package/src/parser/entities/leader/index.ts +3 -0
  69. package/src/parser/entities/leader/parser.ts +119 -0
  70. package/src/parser/entities/leader/types.ts +24 -0
  71. package/src/parser/entities/line/index.ts +2 -0
  72. package/src/parser/entities/line/parser.ts +55 -0
  73. package/src/parser/entities/line/types.ts +11 -0
  74. package/src/parser/entities/lwpolyline/consts.ts +4 -0
  75. package/src/parser/entities/lwpolyline/index.ts +3 -0
  76. package/src/parser/entities/lwpolyline/parser.ts +122 -0
  77. package/src/parser/entities/lwpolyline/types.ts +21 -0
  78. package/src/parser/entities/mtext/consts.ts +5 -0
  79. package/src/parser/entities/mtext/index.ts +3 -0
  80. package/src/parser/entities/mtext/parser.ts +195 -0
  81. package/src/parser/entities/mtext/types.ts +34 -0
  82. package/src/parser/entities/point/index.ts +2 -0
  83. package/src/parser/entities/point/parser.ts +60 -0
  84. package/src/parser/entities/point/types.ts +10 -0
  85. package/src/parser/entities/polyline/consts.ts +17 -0
  86. package/src/parser/entities/polyline/index.ts +3 -0
  87. package/src/parser/entities/polyline/parser.ts +126 -0
  88. package/src/parser/entities/polyline/types.ts +20 -0
  89. package/src/parser/entities/section/index.ts +2 -0
  90. package/src/parser/entities/section/parser.ts +104 -0
  91. package/src/parser/entities/section/types.ts +20 -0
  92. package/src/parser/entities/shared.ts +166 -0
  93. package/src/parser/entities/solid/index.ts +2 -0
  94. package/src/parser/entities/solid/parser.ts +56 -0
  95. package/src/parser/entities/solid/types.ts +10 -0
  96. package/src/parser/entities/spline/consts.ts +8 -0
  97. package/src/parser/entities/spline/index.ts +3 -0
  98. package/src/parser/entities/spline/parser.ts +121 -0
  99. package/src/parser/entities/spline/types.ts +22 -0
  100. package/src/parser/entities/text/consts.ts +21 -0
  101. package/src/parser/entities/text/index.ts +3 -0
  102. package/src/parser/entities/text/parser.ts +117 -0
  103. package/src/parser/entities/text/types.ts +21 -0
  104. package/src/parser/entities/vertex/consts.ts +10 -0
  105. package/src/parser/entities/vertex/index.ts +3 -0
  106. package/src/parser/entities/vertex/parser.ts +90 -0
  107. package/src/parser/entities/vertex/types.ts +17 -0
  108. package/src/parser/entities/viewport/index.ts +178 -0
  109. package/src/parser/entities/viewport/types.ts +58 -0
  110. package/src/parser/filterDummyBlocks.ts +49 -0
  111. package/src/parser/header/index.ts +30 -0
  112. package/src/parser/objects/common.ts +55 -0
  113. package/src/parser/objects/dictionary.ts +61 -0
  114. package/src/parser/objects/index.ts +45 -0
  115. package/src/parser/objects/layout.ts +136 -0
  116. package/src/parser/objects/plotSettings.ts +231 -0
  117. package/src/parser/objects/treefy.ts +53 -0
  118. package/src/parser/objects/types.ts +17 -0
  119. package/src/parser/shared/index.ts +21 -0
  120. package/src/parser/shared/parsePoint.ts +37 -0
  121. package/src/parser/shared/parserGenerator.test.ts +164 -0
  122. package/src/parser/shared/parserGenerator.ts +180 -0
  123. package/src/parser/shared/xdata/index.ts +3 -0
  124. package/src/parser/shared/xdata/interpreter.test.ts +85 -0
  125. package/src/parser/shared/xdata/interpreter.ts +65 -0
  126. package/src/parser/shared/xdata/parser.test.ts +66 -0
  127. package/src/parser/shared/xdata/parser.ts +140 -0
  128. package/src/parser/shared/xdata/types.ts +22 -0
  129. package/src/parser/tables/blockRecord/index.ts +2 -0
  130. package/src/parser/tables/blockRecord/parser.ts +49 -0
  131. package/src/parser/tables/blockRecord/types.ts +11 -0
  132. package/src/parser/tables/dimStyle/consts.ts +428 -0
  133. package/src/parser/tables/dimStyle/index.ts +3 -0
  134. package/src/parser/tables/dimStyle/parser.ts +37 -0
  135. package/src/parser/tables/dimStyle/types.ts +164 -0
  136. package/src/parser/tables/index.ts +2 -0
  137. package/src/parser/tables/layer/index.ts +2 -0
  138. package/src/parser/tables/layer/parser.ts +58 -0
  139. package/src/parser/tables/layer/types.ts +14 -0
  140. package/src/parser/tables/ltype/consts.ts +6 -0
  141. package/src/parser/tables/ltype/index.ts +3 -0
  142. package/src/parser/tables/ltype/parser.ts +110 -0
  143. package/src/parser/tables/ltype/types.ts +23 -0
  144. package/src/parser/tables/parser.ts +100 -0
  145. package/src/parser/tables/shared.ts +32 -0
  146. package/src/parser/tables/style/index.ts +2 -0
  147. package/src/parser/tables/style/parser.ts +70 -0
  148. package/src/parser/tables/style/types.ts +15 -0
  149. package/src/parser/tables/types.ts +15 -0
  150. package/src/parser/tables/vport/index.ts +2 -0
  151. package/src/parser/tables/vport/parser.ts +205 -0
  152. package/src/parser/tables/vport/types.ts +48 -0
  153. package/src/parser/types.ts +30 -0
  154. package/src/types/color.ts +5 -0
  155. package/src/types/dxfHeader.ts +21 -0
  156. package/src/types/entity.ts +7 -0
  157. package/src/types/index.ts +30 -0
  158. package/src/utils/binarySearch.ts +20 -0
  159. package/src/utils/disjointSet.ts +52 -0
  160. package/src/utils/flooding.ts +37 -0
  161. package/src/utils/functional.ts +124 -0
  162. package/src/utils/graph.ts +53 -0
  163. package/src/utils/index.ts +102 -0
  164. package/src/utils/queue.ts +77 -0
  165. package/src/utils/triangle.ts +28 -0
  166. package/tsconfig.json +34 -0
  167. package/webpack.config.js +46 -0
@@ -0,0 +1 @@
1
+ github: [dotoritos-kim]
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: Custom issue template
3
+ about: Describe this issue template's purpose here.
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,23 @@
1
+ ## Overview
2
+ <!---- Please briefly describe the changes and related issues. Please explain what and why you modified it rather than how. -->
3
+
4
+ <!---- Resolves: #(Isuue Number) -->
5
+
6
+ ## PR category
7
+ What changes?
8
+
9
+ - [ ] Add new features
10
+ - [ ] Bug fix
11
+ - [ ] Changes that do not affect the code (correct typos, change tab size, change variable names)
12
+ - [ ] Code refactoring
13
+ - [ ] Add and edit comments
14
+ - [ ] Edit document
15
+ - [ ] Add tests, refactor tests
16
+ - [ ] Edit the build part or package manager
17
+ - [ ] Edit file or folder name
18
+ - [ ] Delete file or folder
19
+
20
+ ## PR Checklist
21
+ Make sure your PR meets the following requirements:
22
+
23
+ - [ ] Tested the changes (bug fixes/tested features).
@@ -0,0 +1,55 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: dxf-json package
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v3
16
+ - uses: actions/setup-node@v3
17
+ with:
18
+ node-version: 18
19
+ - run: npm ci
20
+ - run: npm run test:parser
21
+ setup-build-deploy:
22
+ needs: build
23
+ name: Setup, Build, and Deploy
24
+ runs-on: ubuntu-latest
25
+ permissions:
26
+ packages: write
27
+ contents: write
28
+ id-token: write
29
+
30
+ steps:
31
+ - name: Bump version and push tag
32
+ id: tag_version
33
+ uses: mathieudutour/github-tag-action@v6.1
34
+ with:
35
+ github_token: ${{ secrets.GITHUB_TOKEN }}
36
+
37
+ - name: Create a GitHub release
38
+ uses: ncipollo/release-action@v1
39
+ with:
40
+ tag: ${{ steps.tag_version.outputs.new_tag }}
41
+ name: Release ${{ steps.tag_version.outputs.new_tag }}
42
+ body: ${{ steps.tag_version.outputs.changelog }}
43
+ - uses: actions/checkout@v3
44
+ - uses: actions/setup-node@v3
45
+ with:
46
+ node-version: 18
47
+ registry-url: https://registry.npmjs.org
48
+ - run: npm ci
49
+ - run: git config --global user.name "${{ github.actor }}"
50
+ - run: git config --global user.email "github-action-${{ github.actor }}@users.noreply.github.com"
51
+ - run: npm run build
52
+ - run: npm version ${{ steps.tag_version.outputs.new_tag }}
53
+ - run: npm publish
54
+ env:
55
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/.swcrc ADDED
@@ -0,0 +1,8 @@
1
+ {
2
+ "jsc": {
3
+ "parser": {
4
+ "syntax": "typescript"
5
+ },
6
+ "target": "es2019"
7
+ }
8
+ }