forked from nrwl/nx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24f31d1
commit 3bad40e
Showing
65 changed files
with
3,088 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ node_modules | |
/.vscode | ||
dist | ||
/build | ||
/coverage | ||
test | ||
.DS_Store | ||
tmp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# web-build | ||
|
||
Build a web application | ||
|
||
### Properties | ||
|
||
| Name | Description | Type | Default value | | ||
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------- | | ||
| `namedChunks` | Names the produced bundles according to their entry file | boolean | `true` | | ||
| `main` | The name of the main entry-point file. | string | `undefined` | | ||
| `watch` | Enable re-building when files change. | boolean | `false` | | ||
| `baseHref` | Base url for the application being built. | string | `/` | | ||
| `deployUrl` | URL where the application will be deployed. | string | `undefined` | | ||
| `vendorChunk` | Use a separate bundle containing only vendor libraries. | boolean | `true` | | ||
| `commonChunk` | Use a separate bundle containing code used across multiple bundles. | boolean | `true` | | ||
| `sourceMap` | Output sourcemaps. | boolean | `true` | | ||
| `progress` | Log progress to the console while building. | boolean | `false` | | ||
| `index` | HTML File which will be contain the application | string | `undefined` | | ||
| `scripts` | External Scripts which will be included before the main application entry | array | `undefined` | | ||
| `styles` | External Styles which will be included with the application | array | `undefined` | | ||
| `tsConfig` | The name of the Typescript configuration file. | string | `undefined` | | ||
| `outputHashing` | Define the output filename cache-busting hashing mode. | string | `none` | | ||
| `optimization` | Enables optimization of the build output. | boolean | `undefined` | | ||
| `extractCss` | Extract css into a .css file | boolean | `false` | | ||
| `es2015Polyfills` | Conditional polyfills loaded in browsers which do not support ES2015. | string | `undefined` | | ||
| `subresourceIntegrity` | Enables the use of subresource integrity validation. | boolean | `false` | | ||
| `polyfills` | Polyfills to load before application | string | `undefined` | | ||
| `statsJson` | Generates a 'stats.json' file which can be analyzed using tools such as: #webpack-bundle-analyzer' or https://webpack.github.io/analyse. | boolean | `false` | | ||
| `extractLicenses` | Extract all licenses in a separate file, in the case of production builds only. | boolean | `false` | | ||
| `showCircularDependencies` | Show circular dependency warnings on builds. | boolean | `true` | | ||
| `maxWorkers` | Number of workers to use for type checking. (defaults to # of CPUS - 2) | number | `undefined` | | ||
| `webpackConfig` | Path to a function which takes a webpack config, some context and returns the resulting webpack config | string | `undefined` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# web-dev-server | ||
|
||
Serve a web application | ||
|
||
### Properties | ||
|
||
| Name | Description | Type | Default value | | ||
| ------------- | -------------------------------------------------------- | ------- | ------------- | | ||
| `buildTarget` | Target which builds the application | string | `undefined` | | ||
| `port` | Port to listen on. | number | `4200` | | ||
| `host` | Host to listen on. | string | `localhost` | | ||
| `ssl` | Serve using HTTPS. | boolean | `false` | | ||
| `sslKey` | SSL key to use for serving HTTPS. | string | `undefined` | | ||
| `sslCert` | SSL certificate to use for serving HTTPS. | string | `undefined` | | ||
| `watch` | Watches for changes and rebuilds application | boolean | `true` | | ||
| `liveReload` | Whether to reload the page on change, using live-reload. | boolean | `true` | | ||
| `publicHost` | Public URL where the application will be served | string | `undefined` | | ||
| `open` | Open the application in the browser. | boolean | `false` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { | ||
ensureProject, | ||
runCLI, | ||
uniq, | ||
newApp, | ||
newLib, | ||
updateFile, | ||
readFile, | ||
runCLIAsync, | ||
checkFilesExist | ||
} from '../utils'; | ||
|
||
describe('Web Applications', () => { | ||
it('should be able to generate a react application', async () => { | ||
ensureProject(); | ||
const appName = uniq('app'); | ||
const libName = uniq('lib'); | ||
|
||
newApp(`${appName} --framework react`); | ||
newLib(`${libName} --framework none`); | ||
|
||
const mainPath = `apps/${appName}/src/main.tsx`; | ||
updateFile(mainPath, `import '@proj/${libName}';\n` + readFile(mainPath)); | ||
|
||
const lintResults = runCLI(`lint ${appName}`); | ||
expect(lintResults).toContain('All files pass linting.'); | ||
runCLI(`build ${appName}`); | ||
checkFilesExist( | ||
`dist/apps/${appName}/index.html`, | ||
`dist/apps/${appName}/polyfills.js`, | ||
`dist/apps/${appName}/runtime.js`, | ||
`dist/apps/${appName}/vendor.js`, | ||
`dist/apps/${appName}/main.js`, | ||
`dist/apps/${appName}/styles.js` | ||
); | ||
runCLI(`build ${appName} --prod --output-hashing none`); | ||
checkFilesExist( | ||
`dist/apps/${appName}/index.html`, | ||
`dist/apps/${appName}/polyfills.js`, | ||
`dist/apps/${appName}/runtime.js`, | ||
`dist/apps/${appName}/main.js`, | ||
`dist/apps/${appName}/styles.css` | ||
); | ||
const testResults = await runCLIAsync(`test ${appName}`); | ||
expect(testResults.stderr).toContain('Test Suites: 1 passed, 1 total'); | ||
const lintE2eResults = runCLI(`lint ${appName}-e2e`); | ||
expect(lintE2eResults).toContain('All files pass linting.'); | ||
const e2eResults = runCLI(`e2e ${appName}-e2e`); | ||
expect(e2eResults).toContain('All specs passed!'); | ||
}, 30000); | ||
|
||
it('should be able to generate a custom-elements application', async () => { | ||
ensureProject(); | ||
const appName = uniq('app'); | ||
const libName = uniq('lib'); | ||
|
||
newApp(`${appName} --framework custom-elements`); | ||
newLib(`${libName} --framework none`); | ||
|
||
const mainPath = `apps/${appName}/src/main.ts`; | ||
updateFile(mainPath, `import '@proj/${libName}';\n` + readFile(mainPath)); | ||
|
||
const lintResults = runCLI(`lint ${appName}`); | ||
expect(lintResults).toContain('All files pass linting.'); | ||
runCLI(`build ${appName}`); | ||
checkFilesExist( | ||
`dist/apps/${appName}/index.html`, | ||
`dist/apps/${appName}/polyfills.js`, | ||
`dist/apps/${appName}/runtime.js`, | ||
`dist/apps/${appName}/main.js`, | ||
`dist/apps/${appName}/styles.js` | ||
); | ||
runCLI(`build ${appName} --prod --output-hashing none`); | ||
checkFilesExist( | ||
`dist/apps/${appName}/index.html`, | ||
`dist/apps/${appName}/polyfills.js`, | ||
`dist/apps/${appName}/runtime.js`, | ||
`dist/apps/${appName}/main.js`, | ||
`dist/apps/${appName}/styles.css` | ||
); | ||
const testResults = await runCLIAsync(`test ${appName}`); | ||
expect(testResults.stderr).toContain('Test Suites: 1 passed, 1 total'); | ||
const lintE2eResults = runCLI(`lint ${appName}-e2e`); | ||
expect(lintE2eResults).toContain('All files pass linting.'); | ||
const e2eResults = runCLI(`e2e ${appName}-e2e`); | ||
expect(e2eResults).toContain('All specs passed!'); | ||
}, 30000); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.