Skip to content

Commit efd4ab4

Browse files
Setup repository and npm package
1 parent 21ab95f commit efd4ab4

27 files changed

+1407
-59
lines changed

.darklua-bundle-dev.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"bundle": {
3+
"require_mode": {
4+
"name": "path",
5+
"sources": {
6+
"@pkg": "node_modules/.luau-aliases"
7+
}
8+
}
9+
},
10+
"generator": "dense",
11+
"process": [
12+
{
13+
"rule": "inject_global_value",
14+
"identifier": "__DEV__",
15+
"value": true
16+
},
17+
"remove_types",
18+
"remove_comments",
19+
"remove_spaces",
20+
"compute_expression",
21+
"remove_unused_if_branch",
22+
"remove_unused_while",
23+
"filter_after_early_return",
24+
"remove_nil_declaration",
25+
"remove_empty_do"
26+
]
27+
}

.darklua-bundle.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"bundle": {
3+
"require_mode": {
4+
"name": "path",
5+
"sources": {
6+
"@pkg": "node_modules/.luau-aliases"
7+
}
8+
}
9+
},
10+
"generator": "dense",
11+
"process": [
12+
{
13+
"rule": "inject_global_value",
14+
"identifier": "__DEV__",
15+
"value": false
16+
},
17+
"remove_types",
18+
"remove_comments",
19+
"remove_spaces",
20+
"compute_expression",
21+
"remove_unused_if_branch",
22+
"remove_unused_while",
23+
"filter_after_early_return",
24+
"remove_nil_declaration",
25+
"remove_empty_do"
26+
]
27+
}

.darklua-dev.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"process": [
3+
{
4+
"rule": "convert_require",
5+
"current": {
6+
"name": "path",
7+
"sources": {
8+
"@pkg": "node_modules/.luau-aliases"
9+
}
10+
},
11+
"target": {
12+
"name": "roblox",
13+
"indexing_style": "wait_for_child",
14+
"rojo_sourcemap": "sourcemap.json"
15+
}
16+
},
17+
{
18+
"rule": "inject_global_value",
19+
"identifier": "__DEV__",
20+
"value": true
21+
},
22+
"compute_expression",
23+
"remove_unused_if_branch",
24+
"remove_unused_while",
25+
"filter_after_early_return",
26+
"remove_nil_declaration",
27+
"remove_empty_do"
28+
]
29+
}

.darklua-wally.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"process": [
3+
{
4+
"rule": "convert_require",
5+
"current": {
6+
"name": "path",
7+
"sources": {
8+
"@pkg": "."
9+
}
10+
},
11+
"target": {
12+
"name": "roblox",
13+
"indexing_style": "wait_for_child",
14+
"rojo_sourcemap": "./sourcemap.json"
15+
}
16+
},
17+
"compute_expression",
18+
"remove_unused_if_branch",
19+
"remove_unused_while",
20+
"filter_after_early_return",
21+
"remove_nil_declaration",
22+
"remove_empty_do"
23+
]
24+
}

.darklua.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"process": [
3+
{
4+
"rule": "convert_require",
5+
"current": {
6+
"name": "path",
7+
"sources": {
8+
"@pkg": "node_modules/.luau-aliases"
9+
}
10+
},
11+
"target": {
12+
"name": "roblox",
13+
"indexing_style": "wait_for_child",
14+
"rojo_sourcemap": "sourcemap.json"
15+
}
16+
},
17+
{
18+
"rule": "inject_global_value",
19+
"identifier": "__DEV__",
20+
"value": false
21+
},
22+
"compute_expression",
23+
"remove_unused_if_branch",
24+
"remove_unused_while",
25+
"filter_after_early_return",
26+
"remove_nil_declaration",
27+
"remove_empty_do"
28+
]
29+
}

.github/workflows/release.yml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_tag:
7+
description: "The version to release starting with `v`"
8+
required: true
9+
type: string
10+
11+
release_ref:
12+
description: "The branch, tag or SHA to checkout (default to latest)"
13+
default: ""
14+
type: string
15+
16+
permissions:
17+
contents: write
18+
19+
jobs:
20+
publish-package:
21+
name: Publish package
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Enable corepack
28+
run: corepack enable
29+
30+
- uses: actions/setup-node@v3
31+
with:
32+
node-version: "latest"
33+
cache: "yarn"
34+
cache-dependency-path: "yarn.lock"
35+
36+
- name: Install packages
37+
run: yarn install --immutable
38+
39+
- name: Run npmluau
40+
run: yarn run prepare
41+
42+
- name: Authenticate yarn
43+
run: |
44+
yarn config set npmAlwaysAuth true
45+
yarn config set npmScopes.jsdotlua.npmAuthToken $NPM_AUTH_TOKEN
46+
env:
47+
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48+
49+
- run: yarn npm publish --access public
50+
51+
publish-wally-package:
52+
needs: publish-package
53+
54+
name: Publish wally package
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- uses: actions/checkout@v4
59+
60+
- name: Enable corepack
61+
run: corepack enable
62+
63+
- uses: Roblox/setup-foreman@v1
64+
with:
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
67+
- uses: actions/setup-node@v3
68+
with:
69+
node-version: "latest"
70+
cache: "yarn"
71+
cache-dependency-path: "yarn.lock"
72+
73+
- name: Install packages
74+
run: yarn install --immutable
75+
76+
- name: Run npmluau
77+
run: yarn run prepare
78+
79+
- name: Build assets
80+
run: yarn run build-assets
81+
82+
- name: Login to wally
83+
run: wally login --project-path build/wally --token ${{ secrets.WALLY_ACCESS_TOKEN }}
84+
85+
- name: Publish to wally
86+
run: wally publish --project-path build/wally
87+
88+
create-release:
89+
needs: publish-package
90+
91+
name: Create release
92+
runs-on: ubuntu-latest
93+
94+
outputs:
95+
upload_url: ${{ steps.create_release.outputs.upload_url }}
96+
97+
steps:
98+
- uses: actions/checkout@v4
99+
100+
- name: Create tag
101+
run: |
102+
git fetch --tags --no-recurse-submodules
103+
if [ ! $(git tag -l ${{ inputs.release_tag }}) ]; then
104+
git tag ${{ inputs.release_tag }}
105+
git push origin ${{ inputs.release_tag }}
106+
fi
107+
108+
- name: Create release
109+
id: create_release
110+
uses: softprops/action-gh-release@v1
111+
env:
112+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113+
with:
114+
tag_name: ${{ inputs.release_tag }}
115+
name: ${{ inputs.release_tag }}
116+
draft: false
117+
118+
build-assets:
119+
needs: create-release
120+
121+
name: Add assets
122+
runs-on: ubuntu-latest
123+
124+
strategy:
125+
fail-fast: false
126+
matrix:
127+
include:
128+
- artifact-name: dom-testing-library.rbxm
129+
path: build/dom-testing-library.rbxm
130+
asset-type: application/octet-stream
131+
132+
- artifact-name: dom-testing-library-dev.rbxm
133+
path: build/debug/dom-testing-library.rbxm
134+
asset-type: application/octet-stream
135+
136+
steps:
137+
- uses: actions/checkout@v4
138+
139+
- name: Enable corepack
140+
run: corepack enable
141+
142+
- uses: Roblox/setup-foreman@v1
143+
with:
144+
token: ${{ secrets.GITHUB_TOKEN }}
145+
146+
- uses: actions/setup-node@v3
147+
with:
148+
node-version: "latest"
149+
cache: "yarn"
150+
cache-dependency-path: "yarn.lock"
151+
152+
- name: Install packages
153+
run: yarn install --immutable
154+
155+
- name: Run npmluau
156+
run: yarn run prepare
157+
158+
- name: Build assets
159+
run: yarn run build-assets
160+
161+
- name: Upload asset
162+
uses: actions/upload-artifact@v3
163+
with:
164+
name: ${{ matrix.artifact-name }}
165+
path: ${{ matrix.path }}
166+
167+
- name: Add asset to Release
168+
uses: actions/upload-release-asset@v1
169+
env:
170+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
171+
with:
172+
upload_url: ${{ needs.create-release.outputs.upload_url }}
173+
asset_path: ${{ matrix.path }}
174+
asset_name: ${{ matrix.artifact-name }}
175+
asset_content_type: ${{ matrix.asset-type }}

.github/workflows/test.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
test:
13+
name: Run tests
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Enable corepack
20+
run: corepack enable
21+
22+
- uses: Roblox/setup-foreman@v1
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- uses: actions/setup-node@v3
27+
with:
28+
node-version: "latest"
29+
cache: "yarn"
30+
cache-dependency-path: "yarn.lock"
31+
32+
- name: Install packages
33+
run: yarn install --immutable
34+
35+
- name: Run npmluau
36+
run: yarn run prepare
37+
38+
- name: Run linter
39+
run: yarn run lint
40+
41+
- name: Verify code style
42+
run: yarn run style-check
43+
44+
- name: Build assets
45+
run: yarn run build-assets

.gitignore

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@ Packages/*
33

44
rotriever.lock
55
roblox.toml
6-
*.rbxmx
7-
*.rbxm
6+
/*.rbxl
7+
/*.rbxl.lock
8+
/*.rbxlx
9+
/*.rbxlx.lock
10+
/*.rbxm
11+
/*.rbxmx
812

913
.vscode/launch.json
1014
.vscode/settings.json
1115
.vscode/tasks.json
1216
.idea
17+
18+
**/sourcemap.json
19+
**/node_modules
20+
/build
21+
/roblox
22+
.yarn

0 commit comments

Comments
 (0)