Skip to content

Commit 55254f9

Browse files
rename types (compressor -> compress, generator -> docs), fix error code 0111 message, updates
1 parent b196a0a commit 55254f9

File tree

12 files changed

+34
-33
lines changed

12 files changed

+34
-33
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,18 @@ concurrency:
1010
group: ${{ github.ref }}-ci
1111

1212
jobs:
13-
compressor:
13+
redirect:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
- run: bash tests/redirect.sh
19+
shell: bash
20+
- name: Generate with _just
21+
uses: ./
22+
with:
23+
path: test
24+
compress:
1425
runs-on: ubuntu-latest
1526
steps:
1627
- name: Checkout
@@ -21,25 +32,14 @@ jobs:
2132
uses: ./
2233
with:
2334
path: test
24-
generator:
35+
docs:
2536
runs-on: ubuntu-latest
2637
steps:
2738
- name: Checkout
2839
uses: actions/checkout@v4
29-
- run: bash tests/generator.sh
40+
- run: bash tests/docs.sh
3041
shell: bash
3142
- name: Generate with _just
3243
uses: ./
3344
with:
34-
path: test
35-
redirect:
36-
runs-on: ubuntu-latest
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v4
40-
- run: bash tests/redirect.sh
41-
shell: bash
42-
- name: Generate with _just
43-
uses: ./
44-
with:
45-
path: test
45+
path: test

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
path: website
2222
commit:
2323
runs-on: ubuntu-latest
24+
needs: build
2425
steps:
2526
- uses: actions/checkout@v4
2627
- uses: actions/setup-node@v4
@@ -30,7 +31,7 @@ jobs:
3031
source-directory: "website"
3132
destination-github-username: js-just
3233
destination-repository-name: test
33-
user-email: "[email protected]"
34-
user-name: "GitHub Actions"
34+
user-email: "[email protected]"
35+
target-branch: main
3536
env:
3637
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}

data/codes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
},
6969
{
7070
"code": "0111",
71-
"message": "Invalid value of property \"type\" in just.config.js. It must be one of: \"postprocessor\", \"redirector\", \"compressor\".",
71+
"message": "Invalid value of property \"type\" in just.config.js. It must be one of: \"postprocessor\", \"redirect\", \"compress\", \"docs\".",
7272
"crashed": true,
7373
"link": ""
7474
},

just.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
type: "generator",
2+
type: "docs",
33
docs_config: {
44
metatitle: "Just an Ultimate Site Tool",
55
domain: "just.is-a.dev",

src/compress.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ findAndCompressFiles(deployDir);
9191
EXAMPLE just.config.js FILE to minify js, css, html files in your static website:
9292
9393
module.exports = {
94-
type: "compressor"
94+
type: "compress"
9595
}
9696
9797
*/

src/run.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ if [ -z "$TYPE" ]; then
8282
echo "$ERROR_MESSAGE" && exit 1
8383
fi
8484

85-
if [[ "$TYPE" != "postprocessor" && "$TYPE" != "redirector" && "$TYPE" != "compressor" && "$TYPE" != "generator" ]]; then
85+
if [[ "$TYPE" != "postprocessor" && "$TYPE" != "redirect" && "$TYPE" != "compress" && "$TYPE" != "docs" ]]; then
8686
ERROR_MESSAGE=$(ErrorMessage "run.sh" "0111")
8787
echo "$ERROR_MESSAGE" && exit 1
8888
fi
8989

9090
_just_d="no" && \
91-
if [[ "$TYPE" != "compressor" && ! ( "$TYPE" == "generator" && "$INPUT_PATH" != "." ) ]]; then
91+
if [[ "$TYPE" != "compress" && ! ( "$TYPE" == "docs" && "$INPUT_PATH" != "." ) ]]; then
9292
if [ -d "deploy" ]; then
9393
ERROR_MESSAGE=$(ErrorMessage "important_dirs" "0106")
9494
echo "$ERROR_MESSAGE" && exit 1
@@ -99,7 +99,7 @@ if [[ "$TYPE" != "compressor" && ! ( "$TYPE" == "generator" && "$INPUT_PATH" !=
9999
fi
100100
mkdir -p deploy
101101
mkdir -p _just_data
102-
elif [ "$TYPE" == "generator" ]; then
102+
elif [ "$TYPE" == "docs" ]; then
103103
JDD=$(echo "$INPUT_PATH/_just_data" | sed 's#//*#/#g')
104104
_just_dir=$(echo "$INPUT_PATH/_just" | sed 's#//*#/#g')
105105
if [ -d "$JDD" ]; then
@@ -135,18 +135,18 @@ if [ "$TYPE" == "postprocessor" ]; then
135135
node $GITHUB_ACTION_PATH/src/compress.js "deploy" && \
136136
bash $GITHUB_ACTION_PATH/src/postprocessor/build_map.sh && \
137137
echo "$msg4"
138-
elif [ "$TYPE" == "redirector" ]; then
138+
elif [ "$TYPE" == "redirect" ]; then
139139
mkdir -p deploy/_just
140140
installNodejs && \
141141
bash $GITHUB_ACTION_PATH/src/redirect/checks.sh && \
142142
node $GITHUB_ACTION_PATH/src/redirect/index.js && \
143143
echo "$msg5"
144-
elif [ "$TYPE" == "compressor" ]; then
144+
elif [ "$TYPE" == "compress" ]; then
145145
mkdir -p deploy && \
146146
installNodejs && \
147147
node $GITHUB_ACTION_PATH/src/compress.js "$INPUT_PATH" && \
148148
echo "$msg6"
149-
elif [ "$TYPE" == "generator" ]; then
149+
elif [ "$TYPE" == "docs" ]; then
150150
HTML=$(cat "$GITHUB_ACTION_PATH/src/documentation/templates/page.html")
151151
CSS=$(cat "$GITHUB_ACTION_PATH/src/documentation/templates/page.css")
152152
JS=$(cat "$GITHUB_ACTION_PATH/src/documentation/templates/page.js")

tests/compress.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
type: "compress"
3+
}

tests/compressor.sh renamed to tests/compress.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#!/bin/bash
2424
mkdir -p test
25-
CONFIG=$(cat "tests/compressor.js")
25+
CONFIG=$(cat "tests/compress.js")
2626
HTML=$(cat "website/index.html")
2727
rm -f "just.config.js"
2828
rm -r "website"

tests/compressor.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/generator.js renamed to tests/docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
2-
type: "generator",
2+
type: "docs",
33
docs_config: {
44
metatitle: "Just an Ultimate Site Tool",
55
domain: "just.is-a.dev"

0 commit comments

Comments
 (0)