Skip to content

Commit 52d8d23

Browse files
authored
add scripts to CI (#215)
* add bootstrap command * update babel env * add prettier command * prettier EVERYTHING * remove per-package prettier settings * add semicolons back * resolvejsonmodule * resolvejsonmodule * resolveJsonModule for codegen package * use node v10 * resolveJsonModule for jsx package * fix storybook test script * remove jest from react-native * remove storybook test command until we have tests so it doesn't error builds * remove react native native test until out of beta * explicit node modules directory to supprt symlinks in jest * remove angular and amp tests until we get proper tests setup * remove more test commands that have no tests written yet * same as prior :D * fix tests * package locks * fix install command * remove shopify tests for now - no clue why the CI can't find a package
1 parent 346b300 commit 52d8d23

File tree

463 files changed

+128443
-129206
lines changed

Some content is hidden

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

463 files changed

+128443
-129206
lines changed

.circleci/config.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ jobs:
55
build-and-test:
66
executor:
77
name: node/default
8+
tag: '10'
89
steps:
910
- checkout
1011
- node/with-cache:
1112
steps:
1213
- run: npm install
14+
- run: npm run prettier -- --check .
1315
- run: npm run _install
16+
- run: npm run bootstrap
1417
- run: npm test
1518
- run: npm run build
1619
workflows:
17-
build-and-test:
18-
jobs:
19-
- build-and-test
20+
build-and-test:
21+
jobs:
22+
- build-and-test

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"printWidth": 100,
33
"trailingComma": "es5",
4-
"singleQuote": true
4+
"singleQuote": true,
5+
"arrowParens": "avoid"
56
}

.travis.yml

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

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Register a component
141141
```tsx
142142
import { Builder } from '@builder.io/react';
143143

144-
const SimpleText = (props) => <h1>{props.text}</h1>;
144+
const SimpleText = props => <h1>{props.text}</h1>;
145145

146146
Builder.registerComponent(SimpleText, {
147147
name: 'Simple Text',
@@ -205,7 +205,7 @@ export default () => (
205205
206206
### Data models, components, SEO, and more
207207
208-
Builder.io gives you a ton more power and control than just page building. Check our guides on
208+
Builder.io gives you a ton more power and control than just page building. Check our guides on
209209
210210
- [Custom models](https://builder.io/c/docs/guides/getting-started-with-models)
211211
- [Custom design systems in Builder.io](https://github.com/BuilderIO/builder/tree/master/examples/react-design-system)
@@ -214,12 +214,14 @@ Builder.io gives you a ton more power and control than just page building. Check
214214
- [Components only mode](https://www.builder.io/c/docs/guides/components-only-mode)
215215
216216
Additional framework support:
217+
217218
- [Gatsby](https://github.com/BuilderIO/builder/tree/master/examples/gatsby)
218219
- [Next.js](https://github.com/BuilderIO/builder/tree/master/examples/next-js)
219220
- [Angular](https://github.com/BuilderIO/builder/tree/master/packages/angular)
220221
- [HTML API (for any framework)](https://builder.io/c/docs/html-api)
221222
222223
As well as some handy power features like:
224+
223225
- [Symbols](https://builder.io/c/docs/guides/symbols)
224226
- [Dynamic data fetching and binding](https://builder.io/c/docs/guides/advanced-data)
225227
- [State handling](https://builder.io/c/docs/guides/state-and-actions)
@@ -245,7 +247,6 @@ if (page) {
245247
246248
✨**Tip:** You can make reusable components for your Builder.io pages using [symbols](https://builder.io/c/docs/guides/symbols)
247249
248-
249250
## How it works
250251
251252
![How it works](https://i.imgur.com/tAnTKeN.png)

examples/angular-universal/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Builder.io Angular Universal example
22

3-
This is an example of using Builder.io for dynamic page building with Angular and Angular Universal for server side rendering.
3+
This is an example of using Builder.io for dynamic page building with Angular and Angular Universal for server side rendering.
44

55
See the full Angular SDK source code and docs over [here](/packages/angular)
66

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// Load zone.js for the server.
22
import 'zone.js/dist/zone-node';
33
import 'reflect-metadata';
4-
import {readFileSync, writeFileSync, existsSync, mkdirSync} from 'fs';
5-
import {join} from 'path';
4+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
5+
import { join } from 'path';
66

7-
import {enableProdMode} from '@angular/core';
7+
import { enableProdMode } from '@angular/core';
88
// Faster server renders w/ Prod mode (dev mode never needed)
99
enableProdMode();
1010

1111
// Import module map for lazy loading
12-
import {provideModuleMap} from '@nguniversal/module-map-ngfactory-loader';
13-
import {renderModuleFactory} from '@angular/platform-server';
14-
import {ROUTES} from './static.paths';
12+
import { provideModuleMap } from '@nguniversal/module-map-ngfactory-loader';
13+
import { renderModuleFactory } from '@angular/platform-server';
14+
import { ROUTES } from './static.paths';
1515

1616
// * NOTE :: leave this as require() since this file is built Dynamically from webpack
17-
const {AppServerModuleNgFactory, LAZY_MODULE_MAP} = require('./server/main');
17+
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./server/main');
1818

1919
const BROWSER_FOLDER = join(process.cwd(), 'browser');
2020

@@ -33,11 +33,13 @@ ROUTES.forEach(route => {
3333
}
3434

3535
// Writes rendered HTML to index.html, replacing the file if it already exists.
36-
previousRender = previousRender.then(_ => renderModuleFactory(AppServerModuleNgFactory, {
37-
document: index,
38-
url: route,
39-
extraProviders: [
40-
provideModuleMap(LAZY_MODULE_MAP)
41-
]
42-
})).then(html => writeFileSync(join(fullPath, 'index.html'), html));
36+
previousRender = previousRender
37+
.then(_ =>
38+
renderModuleFactory(AppServerModuleNgFactory, {
39+
document: index,
40+
url: route,
41+
extraProviders: [provideModuleMap(LAZY_MODULE_MAP)],
42+
})
43+
)
44+
.then(html => writeFileSync(join(fullPath, 'index.html'), html));
4345
});

examples/angular-universal/server.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,13 @@ const DIST_FOLDER = join(process.cwd(), 'dist');
2222
const { AppServerModuleNgFactory, LAZY_MODULE_MAP } = require('./server/main');
2323

2424
// Our Universal express-engine (found @ https://github.com/angular/universal/tree/master/modules/express-engine)
25-
app.engine('html', ngExpressEngine({
26-
bootstrap: AppServerModuleNgFactory,
27-
providers: [
28-
provideModuleMap(LAZY_MODULE_MAP)
29-
]
30-
}));
25+
app.engine(
26+
'html',
27+
ngExpressEngine({
28+
bootstrap: AppServerModuleNgFactory,
29+
providers: [provideModuleMap(LAZY_MODULE_MAP)],
30+
})
31+
);
3132

3233
app.set('view engine', 'html');
3334
app.set('views', join(DIST_FOLDER, 'browser'));
@@ -36,9 +37,12 @@ app.set('views', join(DIST_FOLDER, 'browser'));
3637
// app.get('/api/**', (req, res) => { });
3738

3839
// Server static files from /browser
39-
app.get('*.*', express.static(join(DIST_FOLDER, 'browser'), {
40-
maxAge: '1y'
41-
}));
40+
app.get(
41+
'*.*',
42+
express.static(join(DIST_FOLDER, 'browser'), {
43+
maxAge: '1y',
44+
})
45+
);
4246

4347
// All regular routes use the Universal engine
4448
app.get('*', (req, res) => {

examples/angular-universal/server.tsconfig.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@
88
"emitDecoratorMetadata": true,
99
"experimentalDecorators": true,
1010
"target": "es5",
11-
"typeRoots": [
12-
"node_modules/@types"
13-
],
14-
"lib": [
15-
"es2017",
16-
"dom"
17-
]
11+
"typeRoots": ["node_modules/@types"],
12+
"lib": ["es2017", "dom"]
1813
},
1914
"include": ["server.ts", "prerender.ts"]
2015
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const environment = {
2-
production: true
2+
production: true,
33
};

examples/angular-universal/src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
// The list of which env maps to which file can be found in `.angular.json`.
55

66
export const environment = {
7-
production: false
7+
production: false,
88
};
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<title>NgUniversalDemo</title>
6-
<base href="/">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>NgUniversalDemo</title>
6+
<base href="/" />
77

8-
<meta name="viewport" content="width=device-width, initial-scale=1">
9-
<link rel="icon" type="image/x-icon" href="favicon.ico">
10-
</head>
11-
<body>
12-
<app-root></app-root>
13-
</body>
8+
<meta name="viewport" content="width=device-width, initial-scale=1" />
9+
<link rel="icon" type="image/x-icon" href="favicon.ico" />
10+
</head>
11+
<body>
12+
<app-root></app-root>
13+
</body>
1414
</html>

examples/angular-universal/src/polyfills.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,16 @@
4141
import 'core-js/es6/reflect';
4242
import 'core-js/es7/reflect';
4343

44-
4544
/**
4645
* Required to support Web Animations `@angular/animation`.
4746
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
4847
**/
4948
// import 'web-animations-js'; // Run `npm install web-animations-js`.
5049

51-
52-
5350
/***************************************************************************************************
5451
* Zone JS is required by Angular itself.
5552
*/
56-
import 'zone.js/dist/zone'; // Included with Angular CLI.
57-
58-
53+
import 'zone.js/dist/zone'; // Included with Angular CLI.
5954

6055
/***************************************************************************************************
6156
* APPLICATION IMPORTS

examples/angular-universal/src/tsconfig.app.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44
"outDir": "../out-tsc/app",
55
"baseUrl": "./",
66
"module": "es2015",
7-
"types": [
8-
"node"
9-
]
7+
"types": ["node"]
108
},
11-
"exclude": [
12-
"test.ts",
13-
"**/*.spec.ts"
14-
]
9+
"exclude": ["test.ts", "**/*.spec.ts"]
1510
}

examples/angular-universal/src/tsconfig.server.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,9 @@
55
"baseUrl": "./",
66
// Set the module format to "commonjs":
77
"module": "commonjs",
8-
"types": [
9-
"node"
10-
]
8+
"types": ["node"]
119
},
12-
"exclude": [
13-
"test.ts",
14-
"**/*.spec.ts"
15-
],
10+
"exclude": ["test.ts", "**/*.spec.ts"],
1611
// Add "angularCompilerOptions" with the AppServerModule you wrote
1712
// set as the "entryModule".
1813
"angularCompilerOptions": {
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
export const ROUTES = [
2-
'/',
3-
'/lazy',
4-
'/lazy/nested'
5-
];
1+
export const ROUTES = ['/', '/lazy', '/lazy/nested'];

examples/angular-universal/tsconfig.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99
"experimentalDecorators": true,
1010
"skipLibCheck": true,
1111
"target": "es5",
12-
"typeRoots": [
13-
"node_modules/@types"
14-
],
15-
"lib": [
16-
"es2017",
17-
"dom"
18-
]
12+
"typeRoots": ["node_modules/@types"],
13+
"lib": ["es2017", "dom"]
1914
}
2015
}

0 commit comments

Comments
 (0)