8
8
![ GitHub Repo stars] ( https://img.shields.io/github/stars/creativecommons/chooser?style=social )
9
9
![ GitHub forks] ( https://img.shields.io/github/forks/creativecommons/chooser?style=social )
10
10
11
-
12
11
# Chooser
13
12
14
13
The Creative Commons License Chooser is meant to help people learn about CC licenses, and select the license that best fits their needs. The new version in this repo places greater importance on usability, and an educational experience of the six CC licenses.
15
14
16
-
17
15
## About
18
16
19
17
Repository containing the source code for the new Creative Commons License Chooser. The new chooser is still in beta, and a beta deployment can be found [ here] ( https://chooser-beta.creativecommons.org/ ) .
20
18
21
19
This site is built using [ Vue.js] ( https://vuejs.org/ ) (and vue-cli).
22
20
23
-
24
21
### Roadmap
25
22
26
23
Tasks, issues, and discussion related to the release of the new chooser are tracked with the [ ` Launch Milestone ` ] ( https://github.com/creativecommons/chooser/milestone/1 ) .
27
24
28
-
29
25
## Code of conduct
30
26
31
27
[ ` CODE_OF_CONDUCT.md ` ] [ org-coc ] :
28
+
32
29
> The Creative Commons team is committed to fostering a welcoming community.
33
30
> This project and all other Creative Commons open source projects are governed
34
31
> by our [ Code of Conduct] [ code_of_conduct ] . Please report unacceptable
@@ -39,115 +36,112 @@ Tasks, issues, and discussion related to the release of the new chooser are trac
39
36
[ code_of_conduct ] : https://opensource.creativecommons.org/community/code-of-conduct/
40
37
[ reporting_guide ] : https://opensource.creativecommons.org/community/code-of-conduct/enforcement/
41
38
42
-
43
39
## Contributing
44
40
45
41
See [ ` CONTRIBUTING.md ` ] [ org-contrib ] .
46
42
47
43
[ org-contrib ] : https://github.com/creativecommons/.github/blob/main/CONTRIBUTING.md
48
44
49
-
50
45
## Using Docker
51
46
52
-
53
47
### Containers
54
48
55
49
The [ ` docker-compose.yml ` ] ( docker-compose.yml ) file defines the following
56
50
containers:
51
+
57
52
1 . ** chooser-web** - simple NGINX container serving [ ` docs/ ` ] ( docs )
58
53
- [ localhost:8888] ( http://localhost:8888/ )
59
54
2 . ** chooser-node** - Node14 container
60
55
- [ localhost:8080] ( http://localhost:8080/ )
61
56
- (requires ** Run Node development server** , below)
62
57
63
-
64
58
### Docker desktop required
65
59
66
60
Before proceeding, ensure you have Docker installed on your local machine. If
67
61
not, download and install Docker Desktop by visiting [ Docker's official
68
62
website] ( https://www.docker.com/products/docker-desktop ) and follow the
69
63
installation instructions.
70
64
71
-
72
65
### Startup containers
73
66
74
67
The containers can be started with:
68
+
75
69
``` shell
76
70
docker compose up
77
71
```
72
+
78
73
(See [ Docker Compose overview | Docker Docs] ( https://docs.docker.com/compose/ )
79
74
for more information on managing containes with ` docker compose ` .)
80
75
81
-
82
76
### Initial setup
83
77
84
78
Before the chooser-node container can be used effectively, a clean install of
85
79
NPM packages from ` package-lock.json ` is required:
80
+
86
81
``` shell
87
82
docker compose exec chooser-node npm ci
88
83
```
89
- ** This step generally only needs to be done once.**
90
84
85
+ ** This step generally only needs to be done once.**
91
86
92
87
### Run Node development server
93
88
94
89
1 . Startup containers (see above)
95
90
2 . Complete initial setup (see above)
96
91
3 . Run Node development server
97
- ``` shell
98
- docker compose exec chooser-node npm run serve
99
- ```
92
+ ``` shell
93
+ docker compose exec chooser-node npm run serve
94
+ ```
100
95
- [ localhost:8080] ( http://localhost:8080/ )
101
96
102
-
103
97
### Create production (standalone) build
104
98
105
99
1 . Startup containers (see above)
106
100
2 . Complete initial setup (see above)
107
101
3 . Run Node development server
108
- ` ` ` shell
109
- docker compose exec chooser-node npm run build
110
- ` ` `
111
- - (this automatically copies the generated files from [` dist/` ](dist) to
112
- [` docs/` ](docs))
102
+ ``` shell
103
+ docker compose exec chooser-node npm run build
104
+ ```
105
+ - (this automatically copies the generated files from [ ` dist/ ` ] ( dist ) to
106
+ [ ` docs/ ` ] ( docs ) )
113
107
114
108
The chooser is deployed to GitHub Pages. The source files for the beta
115
109
deployment are contained in the ` ./docs/ ` dir, and are live. Any changes to
116
110
this directory's contents will be automatically deployed, so please take care
117
111
when making modifications to this location.
118
112
119
-
120
113
### Create standalone (production) build
121
114
122
115
1 . Startup containers (see above)
123
116
2 . Complete initial setup (see above)
124
117
3 . Run Node development server
125
- ```shell
126
- docker compose exec chooser-node npm run build
127
- ```
128
- - (this automatically copies the generated files from [`dist/`](dist) to
129
- [`docs/`](docs))
118
+ ``` shell
119
+ docker compose exec chooser-node npm run build
120
+ ```
121
+ - (this automatically copies the generated files from [ ` dist/ ` ] ( dist ) to
122
+ [ ` docs/ ` ] ( docs ) )
130
123
131
124
The chooser is deployed to GitHub Pages. The source files for the beta
132
125
deployment are contained in the ` ./docs/ ` dir, and are live. Any changes to
133
126
this directory's contents will be automatically deployed, so please take care
134
127
when making modifications to this location.
135
128
136
129
For an embedded standalone build (no header nor footer), run:
130
+
137
131
``` shell
138
132
docker compose exec chooser-node VUE_APP_CC_OUTPUT=embedded npm run build
139
133
```
140
- ** (please _don' t_ commit embedded builds to `docs/`)**
141
134
135
+ ** (please _ don't_ commit embedded builds to ` docs/ ` )**
142
136
143
137
### Create a web component build
144
138
145
139
1 . Startup containers (see above)
146
140
2 . Complete initial setup (see above)
147
141
3 . Run Node development server
148
- ```shell
149
- docker compose exec chooser-node npm run build-component
150
- ```
142
+ ``` shell
143
+ docker compose exec chooser-node npm run build-component
144
+ ```
151
145
152
146
This will create a file in the [ ` dist/ ` ] ( dist ) folder named
153
147
` license-chooser.min.js ` . It can be used to load the web-component in any JS
@@ -168,41 +162,39 @@ example.
168
162
```
169
163
170
164
For an embedded web component build (no header nor footer), run:
165
+
171
166
``` shell
172
167
docker compose exec chooser-node VUE_APP_CC_OUTPUT=embedded npm run build-component
173
168
```
174
169
175
-
176
170
## Perform unit tests on standalone or embedded build
177
171
178
172
1 . Startup containers (see above)
179
173
2 . Complete initial setup (see above)
180
- 2 . Run unit tests
181
- ` ` ` shell
182
- docker compose exec chooser-node npm run test:unit
183
- ` ` `
174
+ 3 . Run unit tests
175
+ ``` shell
176
+ docker compose exec chooser-node npm run test:unit
177
+ ```
184
178
185
179
## Perform unit tests on web-component build
186
180
187
181
1 . Startup containers (see above)
188
182
2 . Complete initial setup (see above)
189
183
3 . Create a web component build (see above)
190
- 2 . Run unit tests
191
- ` ` ` shell
192
- docker compose exec chooser-node npm run test-component
193
- ` ` `
184
+ 4 . Run unit tests
185
+ ``` shell
186
+ docker compose exec chooser-node npm run test-component
187
+ ```
194
188
- It starts a server with the ` dist/demo.html ` on which tests can be run.
195
189
196
-
197
190
## Perform Cypress tests
198
191
199
192
1 . Startup containers (see above)
200
193
2 . Run Cypress tests
201
- ` ` ` shell
202
- docker run -it -v $PWD :/e2e -w /e2e -e CYPRESS_baseUrl=http://host.docker.internal:8888 cypress/included:latest
203
- ` ` `
204
- - (This will download the cypress/included image when first run)
205
-
194
+ ``` shell
195
+ docker run -it -v $PWD :/e2e -w /e2e -e CYPRESS_baseUrl=http://host.docker.internal:8888 cypress/included:latest
196
+ ```
197
+ - (This will download the cypress/included image when first run)
206
198
207
199
## CSS Build
208
200
@@ -213,7 +205,6 @@ can also be removed. If you find that the built site misses some styles, you
213
205
can manually add the necessary classes or Regex expressions to the ` safelist `
214
206
array in the ` postcss.config.js ` file.
215
207
216
-
217
208
## Embedded screenshot
218
209
219
210
The site can be built in two different modes: ` embedded ` and ` standalone ` .
0 commit comments