Skip to content

Commit 6c0a98a

Browse files
committed
Merge remote-tracking branch 'origin/main' into validation
2 parents d0980c3 + 2b39fe4 commit 6c0a98a

Some content is hidden

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

67 files changed

+3070
-413
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/prototypes/basic"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: npm
8+
directory: "/lib/importer"
9+
schedule:
10+
interval: "weekly"

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint JS
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
jobs:
8+
lint-importer:
9+
defaults:
10+
run:
11+
working-directory: ./lib/importer
12+
timeout-minutes: 5
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: lts/*
19+
- name: Install dependencies
20+
run: npm i
21+
- name: Run linter
22+
run: npm run lint

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Tests
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: [main]
7+
jobs:
8+
test:
9+
defaults:
10+
run:
11+
working-directory: ./prototypes/basic
12+
timeout-minutes: 60
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: lts/*
19+
- name: Install lib dependencies -- todo, check why
20+
working-directory: ./lib/importer
21+
run: npm i
22+
- name: Install dependencies
23+
run: npm i
24+
- name: Install Playwright Browsers
25+
run: npx playwright install --with-deps
26+
- name: Run Playwright tests
27+
run: npx playwright test
28+
- uses: actions/upload-artifact@v4
29+
if: always()
30+
with:
31+
name: test-results
32+
path: ./prototypes/basic/test-results
33+
retention-days: 30
34+
importer:
35+
defaults:
36+
run:
37+
working-directory: ./lib/importer
38+
timeout-minutes: 60
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version: lts/*
45+
- name: Install lib dependencies
46+
run: npm i
47+
- name: Run tests
48+
run: npm run test

Makefile

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11

2+
update-deps:
3+
@echo "***************************"
4+
@echo "** Updating importer lib **"
5+
@echo "***************************"
6+
@cd lib/importer && npm install
7+
@echo "***********************************"
8+
@echo "** Default development prototype **"
9+
@echo "***********************************"
10+
@cd prototypes/basic && npm install
11+
212

313
.PHONY: prototype
4-
prototype:
514
ifndef NAME
6-
$(error Need a value for NAME, e.g., make prototype NAME=value)
7-
endif
15+
prototype:
16+
$(error Need a value for NAME, e.g., make prototype NAME=value)
17+
else
18+
prototype:
819
@cd lib/importer && npm install
920
@mkdir -p prototypes/${NAME}
1021
@cd prototypes/${NAME} && npx govuk-prototype-kit@latest create && npm install ../../lib/importer
@@ -17,3 +28,5 @@ endif
1728
cd prototypes/${NAME}\n\
1829
npm run dev\n\
1930
"
31+
endif
32+

doc/.gitignore

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
11
selectable_table.css
2+
sheet_selector.css
3+
x-govuk-masthead.css
4+
docs.css
5+
get-started-screenshots.png
26
class_list.js
37
keys.js
48
selectable_polyfills.js
59
selectable_table.js
6-
docs.css
7-
init.js
10+
sheet_selector.js
11+
logo.png
12+
mainpage-screenshots.png
813
govuk-frontend.min.js
14+
init.js
915
auto-store-data.js
1016
kit.js
1117
application.js
1218
application.css
19+
articles.html
20+
component-sheet-selector.html
1321
component-table-view.html
22+
how-it-works.html
1423
index.html
1524
pattern-tabular-data.html
25+
start.html
26+
what-it-is.html
1627
assets.mk
28+
assets.txt

doc/Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ $(error "No hq on the PATH? https://github.com/ludovicianul/hq/releases/tag/hq-1
1010
endif
1111

1212
SOURCES := $(wildcard ../lib/importer/assets/docs/*.html)
13+
IMAGES := $(wildcard ../lib/importer/assets/docs/*.png)
1314
OBJECTS := $(subst ../lib/importer/assets/docs/,./,${SOURCES})
1415

1516
# Create a list of all of the assets the pages need, by looking at the scripts
1617
# and stylesheets they intended to download.
1718
assets.txt: ${SOURCES}
1819
(echo $^ | xargs -n1 | xargs -I INPUT ${HQ} -r '[data-plugin-only]' -f INPUT -a src 'script[src]'; \
19-
echo $^ | xargs -n1 | xargs -I INPUT ${HQ} -r '[data-plugin-only]' -f INPUT -a href 'link[rel=stylesheet]') | \
20+
echo $^ | xargs -n1 | xargs -I INPUT ${HQ} -r '[data-plugin-only]' -f INPUT -a href 'link[rel=stylesheet]'; \
21+
echo ${IMAGES} | xargs -n1 | sed 's_\.\./lib/importer/assets/docs/_./_') | \
2022
sort -u | grep . > $@
2123

2224
# Now build a Makefile dependency include, specifying the correct download
@@ -41,7 +43,7 @@ include assets.mk
4143
# We can generate the .gitignore from all of the things we know we are going to
4244
# end up with in the root dir.
4345
.gitignore: assets.txt
44-
(cat $^; printf '%s\n' ${OBJECTS}; echo assets.mk) | xargs -n1 basename > $@
46+
(cat $^; printf '%s\n' ${OBJECTS}; echo assets.mk; echo assets.txt) | xargs -n1 basename > $@
4547
all: .gitignore
4648

4749
# Download the page and remove any elements marked only for plugin use.
@@ -52,7 +54,7 @@ all: .gitignore
5254
# Download the asset. This is the easiest way to get the real thing, as some of
5355
# them (e.g. application.css) are generated by the Prototype Kit and can't just
5456
# be copied from the disk.
55-
%.css %.js:
57+
%.css %.js %.png:
5658
curl --fail-with-body -o $@ -sL http://localhost:3000${SRC} || cat $@
5759

5860
.PHONY: clean

fixtures/realistic.ods

12 KB
Binary file not shown.

fixtures/small-file.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
A,B
2+
1,2
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.rd-range-selector {
2+
overflow-x: auto;
3+
}

lib/importer/assets/css/selectable_table.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ table.selectable {
88

99
table.selectable caption {
1010
text-align: inherit;
11+
white-space: nowrap;
12+
overflow: hidden;
1113
}
1214

1315
table.selectable col:not(:first-child) {

0 commit comments

Comments
 (0)