Skip to content

Commit c08f5c6

Browse files
author
William Welling
committed
dependency upgrades, server and platform module updates, linting wip
1 parent afc3902 commit c08f5c6

File tree

190 files changed

+6337
-4719
lines changed

Some content is hidden

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

190 files changed

+6337
-4719
lines changed

README.md

+114-83
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,15 @@ To change the default configuration values, create local files that override the
9191
To use the configuration parameters in your component:
9292

9393
```bash
94-
import { GlobalConfig } from "../config";
94+
import { GLOBAL_CONFIG, GlobalConfig } from '../config';
95+
96+
constructor(@Inject(GLOBAL_CONFIG) public config: GlobalConfig) {}
9597
```
9698
9799
Running the app
98100
---------------
99101
100-
After you have installed all dependencies you can now run the app. Run `yarn run watch:dev` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:3000`.
102+
After you have installed all dependencies you can now run the app. Run `yarn run watch` to start a local server which will watch for changes, rebuild the code, and reload the server for you. You can visit it at `http://localhost:3000`.
101103
102104
Running in production mode
103105
--------------------------
@@ -113,7 +115,7 @@ yarn start
113115
If you only want to build for production, without starting, run:
114116
115117
```bash
116-
yarn run build:prod:ngc:json
118+
yarn run build:prod
117119
```
118120
119121
This will build the application and put the result in the `dist` folder
@@ -155,7 +157,7 @@ If you are going to use a remote test enviroment you need to edit the './protrac
155157

156158
The default browser is Google Chrome.
157159

158-
Protractor needs a functional instance of the DSpace interface to run the E2E tests, so you need to run:`yarn run watch:dev`
160+
Protractor needs a functional instance of the DSpace interface to run the E2E tests, so you need to run:`yarn run watch`
159161

160162
or any command that bring up the DSpace interface.
161163

@@ -171,6 +173,17 @@ To run all the tests (e.g.: to run tests with Continuous Integration software) y
171173

172174
Run:`yarn run docs` to produce the documentation that will be available in the 'doc' folder.
173175

176+
Deploy
177+
------
178+
179+
```bash
180+
# deploy production in standalone pm2 container
181+
yarn run deploy
182+
183+
# remove production from standalone pm2 container
184+
yarn run undeploy
185+
```
186+
174187
Other commands
175188
--------------
176189

@@ -201,87 +214,105 @@ See [the guide on the wiki](https://wiki.duraspace.org/display/DSPACE/DSpace+7+-
201214
File Structure
202215
--------------
203216

217+
Descriptions coming soon...
218+
204219
```
205220
dspace-angular
206-
├── README.md * This document
207-
├── app.json * Application manifest file
208-
├── config * Folder for configuration files
209-
│   └── environment.default.js * Default configuration files
210-
├── dist * Folder for e2e test files
211-
├── e2e *
212-
│   ├── app.e2e-spec.ts *
213-
│   ├── app.po.ts *
214-
│   ├── pagenotfound *
215-
│   │   ├── pagenotfound.e2e-spec.ts *
216-
│   │   └── pagenotfound.po.ts *
217-
│   └── tsconfig.json *
218-
├── empty.js *
219-
├── helpers.js *
220-
├── karma.conf.js * Unit Test configuration file
221-
├── nodemon.json * Nodemon (https://nodemon.io/) configuration
222-
├── package.json * This file describes the npm package for this project, its dependencies, scripts, etc.
223-
├── postcss.config.json * PostCSS (http://postcss.org/) configuration file
224-
├── protractor.conf.js * E2E tests configuration file
225-
├── resources * Folder for static resources
226-
│   ├── i18n * Folder for i18n translations
227-
│   │   └── en.json *
228-
│   └── images * Folder for images
229-
│   └── dspace_logo.png *
230-
├── rollup-client.js * Rollup (http://rollupjs.org/) configuration for the client
231-
├── rollup-server.js * Rollup (http://rollupjs.org/) configuration for the server
232-
├── spec-bundle.js *
233-
├── src * The source of the application
234-
│   ├── app * The location of the app module, and root of the application shared by client and server
235-
│   │   ├── app-routing.module.ts *
236-
│   │   ├── app.component.html *
237-
│   │   ├── app.component.scss *
238-
│   │   ├── app.component.spec.ts *
239-
│   │   ├── app.component.ts *
240-
│   │   ├── app.effects.ts *
241-
│   │   ├── app.module.ts *
242-
│   │   ├── app.reducers.ts *
243-
│   │   ├── core *
244-
│   │   ├── header *
245-
│   │   ├── home *
246-
│   │   ├── pagenotfound *
247-
│   │   ├── shared *
248-
│   │   └── store.actions.ts *
249-
│   ├── backend * Folder containing a mock of the REST API, hosted by the express server
250-
│   │   ├── api.ts *
251-
│   │   ├── bitstreams.ts *
252-
│   │   ├── bundles.ts *
253-
│   │   ├── cache.ts *
254-
│   │   ├── collections.ts *
255-
│   │   ├── db.ts *
256-
│   │   ├── items.ts *
257-
│   │   └── metadata.ts *
258-
│   ├── client.aot.ts * The bootstrap file for the client, in production
259-
│   ├── client.ts * The bootstrap file for the client, during development
260-
│   ├── config.ts * File that loads environmental and shareable settings and makes them available to app components
261-
│   ├── index.html * The index.html file
262-
│   ├── platform *
263-
│   │   ├── angular2-meta.ts *
264-
│   │   ├── modules *
265-
│   │   │   ├── browser.module.ts * The root module for the client
266-
│   │   │   └── node.module.ts * The root module for the server
267-
│   │   └── workarounds *
268-
│   │   ├── __workaround.browser.ts *
269-
│   │   └── __workaround.node.ts *
270-
│   ├── server.aot.ts * The express (http://expressjs.com/) config and bootstrap file for the server, in production
271-
│   ├── server.routes.ts * The routes file for the server
272-
│   ├── server.ts * The express (http://expressjs.com/) config and bootstrap file for the server, during development
273-
│   ├── styles * Folder containing global styles.
274-
│   │   ├── main.scss * Global scss file
275-
│   │   └── variables.scss * Global sass variables file
276-
│   └── typings.d.ts * File that allows you to add custom typings for libraries without TypeScript support
277-
├── tsconfig.aot.json * TypeScript config for production builds
278-
├── tsconfig.json * TypeScript config for development build
279-
├── tslint.json * TSLint (https://palantir.github.io/tslint/) configuration
280-
├── typedoc.json * TYPEDOC configuration
281-
├── webpack.config.ts * Webpack (https://webpack.github.io/) config for development builds
282-
├── webpack.prod.config.ts * Webpack (https://webpack.github.io/) config for production builds
283-
├── webpack.test.config.js * Webpack (https://webpack.github.io/) config for testing
284-
└── yarn.lock * Yarn lockfile (https://yarnpkg.com/en/docs/yarn-lock)
221+
.
222+
├── README.md
223+
├── app.yaml
224+
├── config
225+
│   ├── environment.default.js
226+
│   ├── environment.dev.js
227+
│   ├── environment.prod.js
228+
│   └── environment.test.js
229+
├── e2e
230+
│   ├── app.e2e-spec.ts
231+
│   ├── app.po.ts
232+
│   ├── pagenotfound
233+
│   │   ├── pagenotfound.e2e-spec.ts
234+
│   │   └── pagenotfound.po.ts
235+
│   └── tsconfig.json
236+
├── karma.conf.js
237+
├── nodemon.json
238+
├── package.json
239+
├── postcss.config.js
240+
├── protractor.conf.js
241+
├── resources
242+
│   ├── data
243+
│   │   └── en
244+
│   ├── i18n
245+
│   │   └── en.json
246+
│   └── images
247+
│   └── dspace_logo.png
248+
├── rollup.config.js
249+
├── spec-bundle.js
250+
├── src
251+
│   ├── app
252+
│   │   ├── app-routing.module.ts
253+
│   │   ├── app.component.html
254+
│   │   ├── app.component.scss
255+
│   │   ├── app.component.spec.ts
256+
│   │   ├── app.component.ts
257+
│   │   ├── app.effects.ts
258+
│   │   ├── app.module.ts
259+
│   │   ├── app.reducer.ts
260+
│   │   ├── browser-app.module.ts
261+
│   │   ├── collection-page
262+
│   │   ├── community-page
263+
│   │   ├── core
264+
│   │   ├── header
265+
│   │   ├── home
266+
│   │   ├── item-page
267+
│   │   ├── object-list
268+
│   │   ├── pagenotfound
269+
│   │   ├── server-app.module.ts
270+
│   │   ├── shared
271+
│   │   ├── store.actions.ts
272+
│   │   ├── store.effects.ts
273+
│   │   ├── thumbnail
274+
│   │   └── typings.d.ts
275+
│   ├── backend
276+
│   │   ├── api.ts
277+
│   │   ├── cache.ts
278+
│   │   ├── data
279+
│   │   └── db.ts
280+
│   ├── config
281+
│   │   ├── cache-config.interface.ts
282+
│   │   ├── global-config.interface.ts
283+
│   │   └── server-config.interface.ts
284+
│   ├── config.ts
285+
│   ├── index.html
286+
│   ├── main.browser.ts
287+
│   ├── main.server.aot.ts
288+
│   ├── main.server.ts
289+
│   ├── modules
290+
│   │   ├── cookies
291+
│   │   ├── data-loader
292+
│   │   ├── transfer-http
293+
│   │   ├── transfer-state
294+
│   │   ├── transfer-store
295+
│   │   └── translate-universal-loader.ts
296+
│   ├── routes.ts
297+
│   ├── styles
298+
│   │   ├── _mixins.scss
299+
│   │   └── variables.scss
300+
│   ├── tsconfig.browser.json
301+
│   ├── tsconfig.server.aot.json
302+
│   ├── tsconfig.server.json
303+
│   └── tsconfig.test.json
304+
├── tsconfig.json
305+
├── tslint.json
306+
├── typedoc.json
307+
├── webpack
308+
│   ├── helpers.js
309+
│   ├── webpack.client.js
310+
│   ├── webpack.common.js
311+
│   ├── webpack.prod.js
312+
│   ├── webpack.server.js
313+
│   └── webpack.test.js
314+
├── webpack.config.ts
315+
└── yarn.lock
285316
```
286317

287318
3rd Party Library Installation

app.json

-12
This file was deleted.

app.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2015-2016, Google, Inc.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
# [START app_yaml]
15+
runtime: nodejs
16+
env: flex
17+
# [END app_yaml]

config/environment.default.js

+22-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
module.exports = {
2-
// The REST API server settings.
3-
"rest": {
4-
"ssl": false,
5-
"address": "dspace7.4science.it",
6-
"port": 80,
2+
// Angular2 UI server settings.
3+
ui: {
4+
ssl: false,
5+
host: 'localhost',
6+
port: 3000,
77
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
8-
"nameSpace": "/dspace-spring-rest/api"
8+
nameSpace: '/'
99
},
10-
// Angular2 UI server settings.
11-
"ui": {
12-
"ssl": false,
13-
"address": "localhost",
14-
"port": 3000,
10+
// The REST API server settings.
11+
rest: {
12+
ssl: false,
13+
host: 'dspace7.4science.it',
14+
port: 80,
1515
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
16-
"nameSpace": "/"
16+
nameSpace: '/dspace-spring-rest/api'
1717
},
18-
"cache": {
18+
cache: {
1919
// how long should objects be cached for by default
20-
"msToLive": 15 * 60 * 1000, // 15 minute
21-
"control": "max-age=60" // revalidate browser
20+
msToLive: 15 * 60 * 1000, // 15 minute
21+
control: 'max-age=60' // revalidate browser
2222
},
23-
"universal": {
24-
// Angular Universal settings
25-
"preboot": true,
26-
"async": true
27-
}
23+
logDirectory: '.',
24+
// NOTE: rehydrate or replay
25+
// rehydrate will transfer prerender state to browser state, actions do not need to replay
26+
// replay will transfer an array of actions to browser, actions replay automatically
27+
prerenderStrategy: 'replay',
28+
// NOTE: will log all redux actions and transfers in console
29+
debug: true
2830
};

config/environment.test.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
// Angular2 UI server settings.
3+
ui: {
4+
ssl: false,
5+
host: 'localhost',
6+
port: 3000,
7+
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
8+
nameSpace: '/'
9+
},
10+
// The REST API server settings.
11+
rest: {
12+
ssl: false,
13+
host: 'dspace7.4science.it',
14+
port: 80,
15+
// NOTE: Space is capitalized because 'namespace' is a reserved string in TypeScript
16+
nameSpace: '/dspace-spring-rest/api'
17+
},
18+
cache: {
19+
// how long should objects be cached for by default
20+
msToLive: 15 * 60 * 1000, // 15 minute
21+
control: 'max-age=60' // revalidate browser
22+
},
23+
logDirectory: '.',
24+
// NOTE: rehydrate or replay
25+
// rehydrate will transfer prerender state to browser state, actions do not need to replay
26+
// replay will transfer an array of actions to browser, actions replay automatically
27+
prerenderStrategy: 'rehydrate',
28+
// NOTE: will log all redux actions and transfers in console
29+
debug: true
30+
};

e2e/app.e2e-spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ProtractorPage } from './app.po';
22

3-
describe('protractor App', function() {
3+
describe('protractor App', () => {
44
let page: ProtractorPage;
55

66
beforeEach(() => {
@@ -9,11 +9,11 @@ describe('protractor App', function() {
99

1010
it('should display title "DSpace"', () => {
1111
page.navigateTo();
12-
expect(page.getPageTitleText()).toEqual('DSpace');
12+
expect<any>(page.getPageTitleText()).toEqual('DSpace');
1313
});
1414

1515
it('should display header "Welcome to DSpace"', () => {
1616
page.navigateTo();
17-
expect(page.getFirstHeaderText()).toEqual('Welcome to DSpace');
17+
expect<any>(page.getFirstHeaderText()).toEqual('Welcome to DSpace');
1818
});
1919
});
+5-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { ProtractorPage } from './pagenotfound.po';
22

3-
describe('protractor PageNotFound', function() {
3+
describe('protractor PageNotFound', () => {
44
let page: ProtractorPage;
55

66
beforeEach(() => {
77
page = new ProtractorPage();
88
});
99

10-
it('should contain element ds-pagenotfound when navigating to page that doesnt exist"', () => {
10+
it('should contain element ds-pagenotfound when navigating to page that doesnt exist', () => {
1111
page.navigateToNonExistingPage();
12-
expect(page.elementTagExists("ds-pagenotfound")).toEqual(true);
12+
expect<any>(page.elementTagExists('ds-pagenotfound')).toEqual(true);
1313
});
1414

15-
it('should not contain element ds-pagenotfound when navigating to existing page"', () => {
15+
it('should not contain element ds-pagenotfound when navigating to existing page', () => {
1616
page.navigateToExistingPage();
17-
expect(page.elementTagExists("ds-pagenotfound")).toEqual(false);
17+
expect<any>(page.elementTagExists('ds-pagenotfound')).toEqual(false);
1818
});
1919
});

0 commit comments

Comments
 (0)