You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
14
15
16
+
15
17
## About
16
18
17
19
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/).
18
20
19
21
This site is built using [Vue.js](https://vuejs.org/) (and vue-cli).
20
22
23
+
21
24
### Roadmap
22
25
23
26
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).
24
27
28
+
25
29
## Code of conduct
26
30
27
31
[`CODE_OF_CONDUCT.md`][org-coc]:
@@ -35,45 +39,66 @@ Tasks, issues, and discussion related to the release of the new chooser are trac
Before proceeding, ensure you have Docker installed on your local machine. If not, download and install Docker Desktop by visiting [Docker's official website](https://www.docker.com/products/docker-desktop) and follow the installation instructions.
55
+
Before proceeding, ensure you have Docker installed on your local machine. If
56
+
not, download and install Docker Desktop by visiting [Docker's official
57
+
website](https://www.docker.com/products/docker-desktop) and follow the
58
+
installation instructions.
59
+
60
+
To deploy the Creative Commons Chooser application using Docker, follow these
61
+
steps:
43
62
44
-
To deploy the Creative Commons Chooser application using Docker, follow these steps:
45
63
46
64
### Step 1: Install Docker Desktop
47
65
48
-
First, ensure you have Docker Desktop installed on your local machine. Open Docker Desktop app on your local machine and follow the installation instructions.
66
+
First, ensure you have Docker Desktop installed on your local machine. Open
67
+
Docker Desktop app on your local machine and follow the installation
68
+
instructions.
69
+
49
70
50
71
### Step 2: Clone the Repository
51
72
52
73
Clone the Creative Commons Chooser repository to your local machine:
In order to have the code up and running on your machine, build the Docker container using docker-compose:
91
+
In order to have the code up and running on your machine, build the Docker
92
+
container using docker-compose:
69
93
70
-
```bash
71
-
docker-compose up
94
+
```shell
95
+
dockercompose up
72
96
```
73
97
74
98
If there is `node_modules` directory, it will perform a clean install from
75
99
`package-lock.json`.
76
100
101
+
77
102
### Step 5: Access the Application
78
103
79
104
Once the container is running, you can access the Creative Commons Chooser application by navigating to the following URL in your web browser:
@@ -82,33 +107,24 @@ Once the container is running, you can access the Creative Commons Chooser appli
82
107
http://localhost:8080
83
108
```
84
109
85
-
## Manual Setup
86
-
87
-
### Prerequisite
88
-
[nodeJS](https://nodejs.org/en/blog/release/v14.17.3) version 14 or below, as the version above 14 may give error.
89
110
90
-
### Commands
91
-
Run the following commands in order to have the code up and running on your machine:
111
+
### Building as web component
92
112
93
-
Clean install dependencies from package-lock.json:
94
-
```bash
95
-
npm ci
113
+
To build the project as a web component, run:
114
+
```shell
115
+
docker compose exec web npm run build-component
96
116
```
97
117
98
-
Build and serve assets with hot-reload
99
-
```bash
100
-
npm run serve
101
-
```
102
-
103
-
You should now have the application running and accessible at <http://localhost:8080> (note: will run on a different port if 8080 is occupied, most common alternative port is 8081).
104
-
105
-
## Building as web component
118
+
This will create a file in the `dist` folder named `license-chooser.min.js`. It
119
+
can be used to load the web-component in any JS project. There is also a sample
120
+
`demo.html` created.
106
121
107
-
To build the project as a web component, run the command `npm run build-component`. This will create a file in the `dist` folder named `license-chooser.min.js`. It can be used to load the web-component in any JS project. There is also a sample `demo.html` created.
122
+
To be able to use the file it should either be rendered statically from the
123
+
integrater's web-app or be published on a CDN. Following code can be used to
124
+
integrate this in other apps.
108
125
109
-
To be able to use the file it should either be rendered statically from the integrater's web-app or be published on a CDN. Following code can be used to integrate this in other apps.
110
-
111
-
Note: the Chooser component depends on Vue 2.x, as can be seen in the following example.
126
+
Note: the Chooser component depends on Vue 2.x, as can be seen in the following
@@ -117,48 +133,61 @@ Note: the Chooser component depends on Vue 2.x, as can be seen in the following
117
133
<license-chooser></license-chooser>
118
134
```
119
135
120
-
If the web component is intended to be built without header and footer, run `VUE_APP_CC_OUTPUT=embedded npm run build-component`
121
-
122
-
## Contributing
123
-
124
-
For information on contributing, please see [Creative Commons' Contribution Guidelines](https://opensource.creativecommons.org/contributing-code/)
125
-
126
-
If you create a PR for your work, but you are not finished yet, please include `WIP:` in the beginning of your PR title. When your work on your PR is completed, and you are ready for a final review, please remove the `WIP:` prefix from the title to indicate that your work is done.
127
-
128
-
Here's a [handy link](https://github.com/creativecommons/chooser/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22+-label%3A%22in+progress%22) that will show you all open issues in this repo that have the `help wanted` tag, but do not have the `in progress` tag.
129
-
All issues in this list are up for grabs!
130
-
If it says "No results matched your search", then there are no issues currently up for grabs.
131
-
132
-
*If no progress has been made on an issue for seven days after assignment, the assignment will be removed to allow others to contribute.*
136
+
If the web component is intended to be built without header and footer, run
137
+
```shell
138
+
docker compose exec web VUE_APP_CC_OUTPUT=embedded npm run build-component
For running tests on a web-component build, run `npm run test-component`. It starts a server with the `dist/demo.html` on which tests can be run.
153
+
154
+
It starts a server with the `dist/demo.html` on which tests can be run.
146
155
147
156
148
157
## CSS Build
149
158
150
-
The Chooser uses PostCSS plugin for PurgeCSS to make CSS bundle size smaller. It automatically removes unused CSS based on the classes found in the final built bundle. Some styles for dynamic components or dynamically-imported files can also be removed. If you find that the built site misses some styles, you can manually add the necessary classes or Regex expressions to the `safelist` array in the `postcss.config.js` file.
159
+
The Chooser uses PostCSS plugin for PurgeCSS to make CSS bundle size smaller.
160
+
It automatically removes unused CSS based on the classes found in the final
161
+
built bundle. Some styles for dynamic components or dynamically-imported files
162
+
can also be removed. If you find that the built site misses some styles, you
163
+
can manually add the necessary classes or Regex expressions to the `safelist`
164
+
array in the `postcss.config.js` file.
165
+
151
166
152
167
## Deployment
153
168
154
-
The chooser is deployed to GitHub Pages. The source files for the beta deployment are contained in the `./docs/` dir, and are live. Any changes to this directory's contents will be automatically deployed, so please take care when making modifications to this location.
169
+
The chooser is deployed to GitHub Pages. The source files for the beta
170
+
deployment are contained in the `./docs/` dir, and are live. Any changes to
171
+
this directory's contents will be automatically deployed, so please take care
172
+
when making modifications to this location.
173
+
174
+
To update the dist bundle, run:
175
+
```shell
176
+
docker compose exec npm run build
177
+
```
178
+
This will also automatically copy the generated files from `./dist/` to
179
+
`./docs/`.
155
180
156
-
To update the dist bundle, run ```$ npm run build```. This will also automatically copy the generated files from `./dist/` to `./docs/`.
157
181
158
182
## Output Modes
159
183
160
-
The site can be built in two different modes: `embedded` and `standalone`. `Embedded` mode removes the header and footer from the application, resulting in the following appearance:
184
+
The site can be built in two different modes: `embedded` and `standalone`.
185
+
`Embedded` mode removes the header and footer from the application, resulting
186
+
in the following appearance:
161
187
162
188
<imgsrc="static/embedded-screenshot.png"alt="Application built in embedded mode">
163
189
164
-
To build into embedded mode, set the environment variable `VUE_APP_CC_OUTPUT=embedded` on your server before building. If `VUE_APP_CC_OUTPUT` is unset or set to a different value, the app will build in the default `standalone` mode, with its own header and footer.
190
+
To build into embedded mode, set the environment variable
191
+
`VUE_APP_CC_OUTPUT=embedded` on your server before building. If
192
+
`VUE_APP_CC_OUTPUT` is unset or set to a different value, the app will build in
193
+
the default `standalone` mode, with its own header and footer.
0 commit comments