wrapture 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 (44) hide show
  1. package/.browserslistrc +4 -0
  2. package/.editorconfig +10 -0
  3. package/.eslintrc +0 -0
  4. package/.github/FUNDING.yml +4 -0
  5. package/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  6. package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  7. package/.github/dependabot.yml +25 -0
  8. package/.github/labeler.yml +72 -0
  9. package/.github/labels.yml +24 -0
  10. package/.github/workflows/auto-assign.yml +19 -0
  11. package/.github/workflows/check.yml +72 -0
  12. package/.github/workflows/label.yml +16 -0
  13. package/.github/workflows/publish.yml +66 -0
  14. package/.github/workflows/triage.yml +18 -0
  15. package/.markdownlint.json +7 -0
  16. package/.prettierrc +7 -0
  17. package/.release-it.json +67 -0
  18. package/CHANGELOG.md +8 -0
  19. package/CODE_OF_CONDUCT.md +128 -0
  20. package/CONTRIBUTING.md +200 -0
  21. package/LICENSE +21 -0
  22. package/README.md +182 -0
  23. package/SECURITY.md +16 -0
  24. package/api/README.md +35 -0
  25. package/api/utils/convert.md +96 -0
  26. package/api/utils/generate-wrapper.md +91 -0
  27. package/api/wrapture.md +31 -0
  28. package/bin/wrapture.js +148 -0
  29. package/custom-typedoc-plugin.js +55 -0
  30. package/eslint.config.mjs +16 -0
  31. package/package.json +74 -0
  32. package/public/docs/README.md +1 -0
  33. package/python/convert.py +72 -0
  34. package/python/scripts/basic_model.py +20 -0
  35. package/scripts/test.ts +11 -0
  36. package/src/utils/__tests__/convert.unit.ts +47 -0
  37. package/src/utils/__tests__/generate-wrapper.unit.ts +29 -0
  38. package/src/utils/convert.ts +98 -0
  39. package/src/utils/generate-wrapper.ts +107 -0
  40. package/src/wrapture.ts +51 -0
  41. package/test/fixtures/basic_model.pt +0 -0
  42. package/tsconfig.json +27 -0
  43. package/tsup.config.ts +14 -0
  44. package/typedoc.json +33 -0
@@ -0,0 +1,4 @@
1
+ > 5%
2
+ last 2 Firefox major versions
3
+ Firefox ESR
4
+ not dead
package/.editorconfig ADDED
@@ -0,0 +1,10 @@
1
+ root = true
2
+
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 2
6
+ end_of_line = lf
7
+ charset = utf-8
8
+ trim_trailing_whitespace = true
9
+ insert_final_newline = true
10
+
package/.eslintrc ADDED
File without changes
@@ -0,0 +1,4 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: phun-ky
4
+ custom: ["https://www.paypal.me/phunky"]
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: 'problems: bug'
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,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,25 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: 'npm'
4
+ directory: '/'
5
+ groups:
6
+ minor-and-patch:
7
+ applies-to: version-updates
8
+ update-types:
9
+ - 'minor'
10
+ - 'patch'
11
+ major-updates:
12
+ applies-to: version-updates
13
+ update-types:
14
+ - 'major'
15
+ schedule:
16
+ interval: 'weekly'
17
+ labels:
18
+ - 'mindless: 📦 dependencies'
19
+ - 'problems: security'
20
+ commit-message:
21
+ prefix: 'chore: 🤖 '
22
+ open-pull-requests-limit: 2
23
+ allow:
24
+ - dependency-type: direct
25
+ - dependency-type: production
@@ -0,0 +1,72 @@
1
+ 'section: workflows':
2
+ - any:
3
+ - changed-files:
4
+ - any-glob-to-any-file:
5
+ - .github/workflows/**
6
+ 'section: repo':
7
+ - any:
8
+ - changed-files:
9
+ - any-glob-to-any-file:
10
+ - '*'
11
+ 'experience: developer':
12
+ - any:
13
+ - changed-files:
14
+ - any-glob-to-any-file:
15
+ - '.editorconfig'
16
+ - '.eslintignore'
17
+ - '.eslintrc.json'
18
+ - '.eslintrc.js'
19
+ - '.gitignore'
20
+ - '.release-it.json'
21
+ - '.renovate.json'
22
+ - '.npmrc'
23
+ - '.prettierrc'
24
+ 'context: github':
25
+ - any:
26
+ - changed-files:
27
+ - any-glob-to-any-file:
28
+ - .github/**
29
+ 'context: docker':
30
+ - any:
31
+ - changed-files:
32
+ - any-glob-to-any-file:
33
+ - Dockerfile
34
+ 'context: npm':
35
+ - any:
36
+ - changed-files:
37
+ - any-glob-to-any-file:
38
+ - '.npmrc'
39
+ 'context: rollup':
40
+ - any:
41
+ - changed-files:
42
+ - any-glob-to-any-file:
43
+ - 'rollup.config.js'
44
+ - 'rollup.config.mjs'
45
+ - 'rollup.*.config.js'
46
+ - 'rollup.*.config.mjs'
47
+ 'mindless: ✏️ docs':
48
+ - any:
49
+ - head-branch: ['^docs', 'docs']
50
+ - changed-files:
51
+ - any-glob-to-any-file:
52
+ - '**/*.md'
53
+ 'mindless: dependencies':
54
+ - any:
55
+ - changed-files:
56
+ - any-glob-to-any-file:
57
+ - 'package-lock.json'
58
+ - 'yarn.lock'
59
+
60
+ # Add '✨ feature' label to any PR where the head branch name starts with `feat` or has a `feat` section in the name
61
+ '✨ feature':
62
+ - head-branch: ['^feat', 'feat']
63
+ 'problems: 🐛 bug':
64
+ - head-branch: ['^fix', 'fix']
65
+ 'mindless: 🤖 chore':
66
+ - head-branch: ['^chore', 'chore']
67
+ 'improvements: 💡 enhancement':
68
+ - head-branch: ['^improvements', 'improvements']
69
+
70
+ # Add 'release' label to any PR that is opened against the `main` branch
71
+ release:
72
+ - base-branch: 'main'
@@ -0,0 +1,24 @@
1
+ XS:
2
+ name: 'size: 👕 XS'
3
+ lines: 0
4
+ color: 3CBF00
5
+ S:
6
+ name: 'size: 👕 S'
7
+ lines: 10
8
+ color: 5D9801
9
+ M:
10
+ name: 'size: 👕 M'
11
+ lines: 30
12
+ color: 7F7203
13
+ L:
14
+ name: 'size: 👕 L'
15
+ lines: 100
16
+ color: A14C05
17
+ XL:
18
+ name: 'size: 👕 XL'
19
+ lines: 500
20
+ color: C32607
21
+ XXL:
22
+ name: 'size: 👕 XXL'
23
+ lines: 1000
24
+ color: E50009
@@ -0,0 +1,19 @@
1
+ name: Auto Assign
2
+ on:
3
+ issues:
4
+ types: [opened]
5
+ pull_request:
6
+ types: [opened]
7
+ jobs:
8
+ run:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ issues: write
12
+ pull-requests: write
13
+ steps:
14
+ - name: 'Auto-assign issue'
15
+ uses: pozil/auto-assign-issue@v1
16
+ with:
17
+ repo-token: ${{ secrets.GITHUB_TOKEN }}
18
+ assignees: phun-ky
19
+ numOfAssignee: 1
@@ -0,0 +1,72 @@
1
+ # This is a basic workflow to help you get started with Actions
2
+
3
+ name: Checks
4
+
5
+ # Controls when the workflow will run
6
+ on:
7
+ # Triggers the workflow on push or pull request events but only for the "main" branch
8
+ push:
9
+ branches: ['main']
10
+ paths:
11
+ - '.github/**'
12
+ - 'src/**'
13
+ - 'package.json'
14
+ - 'package-lock.json'
15
+ - 'rollup.config.js'
16
+ - 'tsconfig.json'
17
+ - '.npmrc'
18
+ pull_request:
19
+ branches: ['main']
20
+ types: [opened, synchronize] # Workflow triggering events
21
+ paths:
22
+ - '.github/**'
23
+ - 'src/**'
24
+ - 'package.json'
25
+ - 'package-lock.json'
26
+ - 'rollup.config.js'
27
+ - 'tsconfig.json'
28
+ - '.npmrc'
29
+
30
+ # Allows you to run this workflow manually from the Actions tab
31
+ workflow_dispatch:
32
+
33
+ # A workflow run is made up of one or more jobs that can run sequentially or in parallel
34
+ jobs:
35
+ # This workflow contains a single job called "check"
36
+ check:
37
+ # The type of runner that the job will run on
38
+ runs-on: ubuntu-latest
39
+
40
+ # Steps represent a sequence of tasks that will be executed as part of the job
41
+ steps:
42
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
43
+ - name: Checkout
44
+ uses: actions/checkout@v4
45
+ with:
46
+ fetch-depth: 0 # Checkout all branches and tags
47
+ - name: Setup Node.js environment
48
+ uses: actions/setup-node@v4
49
+ with:
50
+ node-version: '>=22.8.0'
51
+ - name: Install dependencies
52
+ run: | # Install and link dependencies
53
+ npm i
54
+ - name: Build # Build all packages
55
+ run: npm run build
56
+ - name: Test
57
+ run: npm run test:ci
58
+ - name: Upload coverage reports to Codecov
59
+ uses: codecov/codecov-action@v5
60
+ with:
61
+ token: ${{ secrets.CODECOV_TOKEN }}
62
+ slug: phun-ky/wrapture
63
+ notify:
64
+ name: Notify failed check
65
+ needs: check
66
+ if: failure()
67
+ runs-on: ubuntu-latest
68
+ steps:
69
+ - uses: jayqi/failed-build-issue-action@v1.2
70
+ with:
71
+ github-token: ${{ secrets.GH_TOKEN }}
72
+ label-name: 'problems: build failed'
@@ -0,0 +1,16 @@
1
+ name: 'Pull Request Labeler'
2
+ on:
3
+ - pull_request_target
4
+
5
+ jobs:
6
+ labeler:
7
+ permissions:
8
+ contents: read
9
+ pull-requests: write
10
+ issues: write
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - id: label-the-PR
14
+ uses: actions/labeler@v5
15
+ with:
16
+ sync-labels: true
@@ -0,0 +1,66 @@
1
+ # This is a basic workflow to help you get started with Actions
2
+
3
+ name: Publish
4
+
5
+ # Controls when the workflow will run
6
+ on:
7
+ pull_request:
8
+ types: [closed]
9
+ branches: [ "main" ]
10
+ paths:
11
+ - '.github/**'
12
+ - 'src/**'
13
+ - 'api/**'
14
+ - 'public/**'
15
+ - 'package.json'
16
+ - 'package-lock.json'
17
+ - 'rollup.config.js'
18
+ - 'tsconfig.json'
19
+ - '.npmrc'
20
+ - '.release-it.json'
21
+ - 'README.md'
22
+ - 'CONTRIBUTING.md'
23
+ - 'CODE_OF_CONDUCT.md'
24
+ - 'SECURITY.md'
25
+ - '.postcssrc.cjs'
26
+ - '.browserlistrc'
27
+ workflow_dispatch:
28
+ jobs:
29
+ publish:
30
+ if: github.event.pull_request.merged == true
31
+ runs-on: ubuntu-latest
32
+
33
+ # Steps represent a sequence of tasks that will be executed as part of the job
34
+ steps:
35
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
36
+ - name: Checkout
37
+ uses: actions/checkout@v4
38
+ with:
39
+ fetch-depth: 0 # Checkout all branches and tags
40
+ token: ${{ secrets.GH_TOKEN }}
41
+ - name: Setup Node.js environment
42
+ uses: actions/setup-node@v4
43
+ with:
44
+ node-version: '>=22.8.0'
45
+ - name: Install dependencies
46
+ run: | # Install and link dependencies
47
+ npm i
48
+ - name: "Release" # Interesting step
49
+ run: |
50
+ git config user.name "${{ github.actor }}"
51
+ git config user.email "${{ github.actor}}@users.noreply.github.com"
52
+ npm run release
53
+ env:
54
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
55
+ GH_TOKEN: ${{ secrets.GH_TOKEN }}
56
+ notify:
57
+ name: Notify failed build
58
+ needs: publish
59
+ if: failure()
60
+ runs-on: ubuntu-latest
61
+ steps:
62
+ - uses: jayqi/failed-build-issue-action@v1.2
63
+ with:
64
+ github-token: ${{ secrets.GH_TOKEN }}
65
+ label-name: "problems: build failed"
66
+
@@ -0,0 +1,18 @@
1
+ name: Add triage label
2
+ on:
3
+ issues:
4
+ types:
5
+ - reopened
6
+ - opened
7
+ jobs:
8
+ label_issues:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ issues: write
12
+ steps:
13
+ - run: gh issue edit "$NUMBER" --add-label "$LABELS"
14
+ env:
15
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16
+ GH_REPO: ${{ github.repository }}
17
+ NUMBER: ${{ github.event.issue.number }}
18
+ LABELS: 🚑 triage
@@ -0,0 +1,7 @@
1
+ {
2
+ "MD013": {"code_blocks": false},
3
+ "MD033": false,
4
+ "MD036": false,
5
+ "MD040": false,
6
+ "MD046": {"style": "fenced"}
7
+ }
package/.prettierrc ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "none",
4
+ "tabWidth": 2,
5
+ "proseWrap": "always",
6
+ "printWidth": 80
7
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "git": {
3
+ "commitMessage": "chore: 🤖 release v${version}"
4
+ },
5
+ "github": {
6
+ "release": true,
7
+ "tokenRef": "GH_TOKEN"
8
+ },
9
+ "npm": {
10
+ "publish": true,
11
+ "skipChecks": true
12
+ },
13
+ "hooks": {
14
+ "after:bump": "npm run build && npm run docs:gen",
15
+ "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
16
+ },
17
+ "plugins": {
18
+ "@release-it/conventional-changelog": {
19
+ "header": "# Changelog",
20
+ "preset": {
21
+ "name": "conventionalcommits",
22
+ "types": [
23
+ {
24
+ "type": "chore",
25
+ "section": "Tasks"
26
+ },
27
+ {
28
+ "type": "docs",
29
+ "section": "Documentation"
30
+ },
31
+ {
32
+ "type": "feat",
33
+ "section": "Feature"
34
+ },
35
+ {
36
+ "type": "fix",
37
+ "section": "Bug"
38
+ },
39
+ {
40
+ "type": "perf",
41
+ "section": "Performance change"
42
+ },
43
+ {
44
+ "type": "refactor",
45
+ "section": "Refactoring"
46
+ },
47
+ {
48
+ "type": "release",
49
+ "section": "Create a release commit",
50
+ "hidden": true
51
+ },
52
+ {
53
+ "type": "style",
54
+ "section": "Markup, white-space, formatting, missing semi-colons...",
55
+ "hidden": true
56
+ },
57
+ {
58
+ "type": "test",
59
+ "section": "Adding missing tests",
60
+ "hidden": true
61
+ }
62
+ ]
63
+ },
64
+ "infile": "CHANGELOG.md"
65
+ }
66
+ }
67
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # Changelog
2
+
3
+ ## 0.0.1 (2025-05-14)
4
+
5
+ ### Tasks
6
+
7
+ * 🤖 bump putout from 40.1.8 to 40.1.9 in the minor-and-patch group ([259b0f2](https://github.com/phun-ky/wrapture/commit/259b0f28011274b097c7c534ec491437d51bf806))
8
+ * 🤖 First code release ([63a78ae](https://github.com/phun-ky/wrapture/commit/63a78aefc3260e9d30918b90c1c460db53279310))
@@ -0,0 +1,128 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behaviour that contributes to a positive environment for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behaviour include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behaviour and will take appropriate and fair corrective action in
43
+ response to any behaviour that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behaviour may be
62
+ reported to the community leaders responsible for enforcement at
63
+ <code-of-conduct@phun-ky.net>. All complaints will be reviewed and investigated
64
+ promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behaviour deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behaviour was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behaviour. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behaviour.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behaviour, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ <https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ <https://www.contributor-covenant.org/faq>. Translations are available at
128
+ <https://www.contributor-covenant.org/translations>.