Skip to content

Commit 5d97cf0

Browse files
Setup npm packages (#2)
1 parent 89f401b commit 5d97cf0

File tree

95 files changed

+1530
-530
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1530
-530
lines changed

.darklua-tests.json

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"rules": [
3+
"remove_comments",
4+
"remove_spaces",
5+
{
6+
"rule": "convert_require",
7+
"current": {
8+
"name": "path",
9+
"sources": {
10+
"@pkg": "node_modules/.luau-aliases"
11+
}
12+
},
13+
"target": {
14+
"name": "roblox",
15+
"rojo_sourcemap": "sourcemap.json",
16+
"indexing_style": "wait_for_child"
17+
}
18+
},
19+
{
20+
"rule": "inject_global_value",
21+
"identifier": "LUA_ENV",
22+
"value": "roblox"
23+
},
24+
{
25+
"rule": "inject_global_value",
26+
"identifier": "DEV",
27+
"value": true
28+
},
29+
{
30+
"rule": "inject_global_value",
31+
"identifier": "__DEV__",
32+
"value": true
33+
},
34+
"compute_expression",
35+
"remove_unused_if_branch",
36+
"filter_after_early_return",
37+
"convert_index_to_field",
38+
"remove_unused_while",
39+
"remove_empty_do",
40+
"remove_method_definition"
41+
]
42+
}

.gitattributes

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
* text eol=lf
2+
3+
*.gif binary
4+
*.ico binary
5+
*.jpg binary
6+
*.png binary

.github/pull_request_template.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!-- Write `Closes #issue-number` to automatically close a related issue -->
2+
3+
- [ ] Add entry to changelog

.github/workflows/release.yml

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
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+
release_ref:
11+
description: The branch, tag or SHA to checkout (default to latest)
12+
default: ""
13+
type: string
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
publish-package:
20+
name: Publish package
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Enable corepack
26+
run: corepack enable
27+
28+
- uses: actions/setup-node@v3
29+
with:
30+
node-version: latest
31+
registry-url: https://registry.npmjs.org
32+
cache: yarn
33+
cache-dependency-path: yarn.lock
34+
35+
- name: Install packages
36+
run: yarn install --immutable
37+
38+
- name: Run npmluau
39+
run: yarn run prepare
40+
41+
- name: Authenticate yarn
42+
run: |-
43+
yarn config set npmAlwaysAuth true
44+
yarn config set npmAuthToken $NPM_AUTH_TOKEN
45+
env:
46+
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
47+
48+
- name: Publish to npm
49+
run: |-
50+
yarn workspaces foreach --all --no-private npm publish --access public --tolerate-republish
51+
52+
publish-wally-package:
53+
needs: publish-package
54+
55+
name: Publish wally package
56+
runs-on: ubuntu-latest
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- uses: Roblox/setup-foreman@v1
62+
with:
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
65+
- name: Enable corepack
66+
run: corepack enable
67+
68+
- uses: actions/setup-node@v3
69+
with:
70+
node-version: "latest"
71+
cache: "yarn"
72+
cache-dependency-path: "yarn.lock"
73+
74+
- name: Install packages
75+
run: yarn install --immutable
76+
77+
- name: Run npmluau
78+
run: yarn run prepare
79+
80+
- name: Build artifacts
81+
run: yarn run build
82+
83+
- name: Login to wally
84+
run: wally login --project-path build/wally/otter --token ${{ secrets.WALLY_ACCESS_TOKEN }}
85+
86+
- name: Publish otter to wally
87+
run: wally publish --project-path build/wally/otter
88+
89+
- name: Publish react-otter to wally
90+
run: wally publish --project-path build/wally/react-otter
91+
92+
create-release:
93+
needs: publish-package
94+
name: Create release
95+
runs-on: ubuntu-latest
96+
outputs:
97+
upload_url: ${{ steps.create_release.outputs.upload_url }}
98+
steps:
99+
- uses: actions/checkout@v4
100+
101+
- name: Create tag
102+
run: |
103+
git fetch --tags --no-recurse-submodules
104+
if [ ! $(git tag -l ${{ inputs.release_tag }}) ]; then
105+
git tag ${{ inputs.release_tag }}
106+
git push origin ${{ inputs.release_tag }}
107+
fi
108+
109+
- name: Create release
110+
id: create_release
111+
uses: softprops/action-gh-release@v1
112+
env:
113+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
with:
115+
tag_name: ${{ inputs.release_tag }}
116+
name: ${{ inputs.release_tag }}
117+
draft: false

.github/workflows/test.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
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+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: Roblox/setup-foreman@v1
19+
with:
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Enable corepack
23+
run: corepack enable
24+
25+
- uses: actions/setup-node@v3
26+
with:
27+
node-version: latest
28+
registry-url: https://registry.npmjs.org
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:selene
40+
41+
- name: Verify code style
42+
run: yarn run style-check

.gitignore

+17-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
/Packages/*
2-
!/Packages/.robloxrc
3-
/rotriever.lock
4-
/luacov.*
51
/site
6-
/*.rbxl*
7-
/*.rbxm*
8-
/roblox.toml
9-
/*.log
10-
sourcemap.json
2+
3+
/*.rbxl
4+
/*.rbxlx
5+
/*.rbxl.lock
6+
/*.rbxlx.lock
7+
/*.rbxm
8+
/*.rbxmx
9+
10+
/temp
11+
/node_modules
12+
/build
13+
14+
.yarn
15+
16+
/globalTypes.d.lua
17+
18+
**/sourcemap.json

.lestrc

-8
This file was deleted.

.luau-analyze.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"luau-lsp.require.mode": "relativeToFile",
3+
"luau-lsp.require.directoryAliases": {
4+
"@pkg": "node_modules/.luau-aliases"
5+
}
6+
}

.luaurc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"languageMode": "nonstrict",
3+
"lintErrors": true,
4+
"lint": {
5+
"*": true
6+
},
7+
"aliases": {
8+
"pkg": "./node_modules/.luau-aliases"
9+
}
10+
}

.styluaignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/node_modules
2+
/temp
3+
/build
4+
5+
**/*.d.lua
6+
**/*.d.luau

.vscode/extensions.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"recommendations": [
3+
"johnnymorganz.luau-lsp",
4+
"johnnymorganz.stylua",
5+
"github.vscode-github-actions",
6+
"Kampfkarren.selene-vscode"
7+
]
8+
}

.vscode/settings.json

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
{
2-
"luau-lsp.sourcemap.rojoProjectFile": "default.project.json",
3-
"robloxLuauLSP.cli.extraArgs": [
4-
"--load.place",
5-
"default.project.json",
6-
],
7-
}
1+
{
2+
"luau-lsp.require.directoryAliases": {
3+
"@pkg": "node_modules/.luau-aliases"
4+
},
5+
"luau-lsp.sourcemap.autogenerate": false,
6+
"luau-lsp.require.mode": "relativeToFile",
7+
"luau-lsp.completion.imports.requireStyle": "alwaysRelative",
8+
"luau-lsp.platform.type": "roblox"
9+
}

.yarnrc.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

Packages/.robloxrc

-8
This file was deleted.

default.project.json

-12
This file was deleted.

evaluate.toml

-18
This file was deleted.

foreman.toml

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
[tools]
2-
selene = { source = "Roblox/Kampfkarren-selene", version = "0.24.0" }
3-
stylua = { source = "Roblox/JohnnyMorganz-StyLua", version = "0.16.0" }
4-
rotrieve = { source = "roblox/rotriever", version = "0.5.13-alpha.4" }
5-
lest = { source = "Roblox/lest", version = "3.x.x" }
6-
rojo = { source = "Roblox/rojo-rbx-rojo", version = "7.2.1" }
7-
rbx-aged-cli = { source = "Roblox/rbx-aged-tool", version = "5.x.x" }
8-
evaluate = { source = "Roblox/evaluate", version = "=0.3.1" }
9-
quantqual = { source = "Roblox/quantitative-quality-tools", version = "=0.8.0" }
2+
darklua = { github = "seaofvoices/darklua", version = "=0.13.1"}
3+
luau-lsp = { github = "JohnnyMorganz/luau-lsp", version = "=1.32.4"}
4+
rojo = { github = "rojo-rbx/rojo", version = "=7.4.4"}
5+
run-in-roblox = { github = "rojo-rbx/run-in-roblox", version = "=0.3.0"}
6+
selene = { github = "Kampfkarren/selene", version = "=0.27.1"}
7+
stylua = { github = "JohnnyMorganz/StyLua", version = "=0.20.0"}

0 commit comments

Comments
 (0)