Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

Commit 48dd038

Browse files
committed
Initial commit
0 parents  commit 48dd038

File tree

119 files changed

+11156
-0
lines changed

Some content is hidden

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

119 files changed

+11156
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.eslintrc

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 2018,
6+
"sourceType": "module",
7+
"project": "./tsconfig.json"
8+
},
9+
"ignorePatterns": ["**/*"],
10+
"plugins": ["@typescript-eslint", "@nrwl/nx"],
11+
"extends": [
12+
"eslint:recommended",
13+
"plugin:@typescript-eslint/eslint-recommended",
14+
"plugin:@typescript-eslint/recommended",
15+
"prettier",
16+
"prettier/@typescript-eslint"
17+
],
18+
"rules": {
19+
"@typescript-eslint/explicit-member-accessibility": "off",
20+
"@typescript-eslint/explicit-function-return-type": "off",
21+
"@typescript-eslint/no-parameter-properties": "off",
22+
"@nrwl/nx/enforce-module-boundaries": [
23+
"error",
24+
{
25+
"enforceBuildableLibDependency": true,
26+
"allow": [],
27+
"depConstraints": [
28+
{ "sourceTag": "*", "onlyDependOnLibsWithTags": ["*"] }
29+
]
30+
}
31+
]
32+
},
33+
"overrides": [
34+
{
35+
"files": ["*.tsx"],
36+
"rules": {
37+
"@typescript-eslint/no-unused-vars": "off"
38+
}
39+
}
40+
]
41+
}

.gitignore

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
8+
# dependencies
9+
/node_modules
10+
11+
# IDEs and editors
12+
/.idea
13+
.project
14+
.classpath
15+
.c9/
16+
*.launch
17+
.settings/
18+
*.sublime-workspace
19+
20+
# IDE - VSCode
21+
.vscode/*
22+
!.vscode/settings.json
23+
!.vscode/tasks.json
24+
!.vscode/launch.json
25+
!.vscode/extensions.json
26+
27+
# misc
28+
/.sass-cache
29+
/connect.lock
30+
/coverage
31+
/libpeerconnection.log
32+
npm-debug.log
33+
yarn-error.log
34+
testem.log
35+
/typings
36+
37+
# System Files
38+
.DS_Store
39+
Thumbs.db

.prettierignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add files here to ignore them from prettier formatting
2+
3+
/dist
4+
/coverage

.prettierrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

README.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Nxext
2+
3+
This project was generated using [Nx](https://nx.dev).
4+
5+
<p align="center"><img src="https://raw.githubusercontent.com/nrwl/nx/master/nx-logo.png" width="450"></p>
6+
7+
🔎 **Nx is a set of Extensible Dev Tools for Monorepos.**
8+
9+
## Adding capabilities to your workspace
10+
11+
Nx supports many plugins which add capabilities for developing different types of applications and different tools.
12+
13+
These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well.
14+
15+
Below are some plugins which you can add to your workspace:
16+
17+
- [React](https://reactjs.org)
18+
- `npm install --save-dev @nrwl/react`
19+
- Web (no framework frontends)
20+
- `npm install --save-dev @nrwl/web`
21+
- [Angular](https://angular.io)
22+
- `npm install --save-dev @nrwl/angular`
23+
- [Nest](https://nestjs.com)
24+
- `npm install --save-dev @nrwl/nest`
25+
- [Express](https://expressjs.com)
26+
- `npm install --save-dev @nrwl/express`
27+
- [Node](https://nodejs.org)
28+
- `npm install --save-dev @nrwl/node`
29+
30+
## Generate an application
31+
32+
Run `nx g @nrwl/react:app my-app` to generate an application.
33+
34+
> You can use any of the plugins above to generate applications as well.
35+
36+
When using Nx, you can create multiple applications and libraries in the same workspace.
37+
38+
## Generate a library
39+
40+
Run `nx g @nrwl/react:lib my-lib` to generate a library.
41+
42+
> You can also use any of the plugins above to generate libraries as well.
43+
44+
Libraries are sharable across libraries and applications. They can be imported from `@nxext/mylib`.
45+
46+
## Development server
47+
48+
Run `nx serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
49+
50+
## Code scaffolding
51+
52+
Run `nx g @nrwl/react:component my-component --project=my-app` to generate a new component.
53+
54+
## Build
55+
56+
Run `nx build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build.
57+
58+
## Running unit tests
59+
60+
Run `nx test my-app` to execute the unit tests via [Jest](https://jestjs.io).
61+
62+
Run `nx affected:test` to execute the unit tests affected by a change.
63+
64+
## Running end-to-end tests
65+
66+
Run `ng e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io).
67+
68+
Run `nx affected:e2e` to execute the end-to-end tests affected by a change.
69+
70+
## Understand your workspace
71+
72+
Run `nx dep-graph` to see a diagram of the dependencies of your projects.
73+
74+
## Further help
75+
76+
Visit the [Nx Documentation](https://nx.dev) to learn more.

apps/.gitkeep

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

apps/stencil-e2e/jest.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
name: 'stencil-e2e',
3+
preset: '../../jest.config.js',
4+
coverageDirectory: '../../coverage/apps/stencil-e2e',
5+
testTimeout: 300000,
6+
runner: './serial-jest-runner.js',
7+
};
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const DefaultJestRunner = require('jest-runner');
2+
3+
class SerialJestRunner extends DefaultJestRunner {
4+
constructor(...args) {
5+
super(...args);
6+
this.isSerial = true;
7+
}
8+
}
9+
10+
module.exports = SerialJestRunner;
+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import { ProjectType } from '@nrwl/workspace';
2+
import {
3+
checkFilesExist,
4+
ensureNxProject,
5+
readJson,
6+
runNxCommandAsync,
7+
uniq,
8+
} from '@nrwl/nx-plugin/testing';
9+
import { SUPPORTED_STYLE_LIBRARIES } from '../../../libs/stencil/src/utils/testing';
10+
import { testProject } from '../utils/testing';
11+
12+
describe('e2e', () => {
13+
describe('generate with style', () => {
14+
describe('stencil app', () => {
15+
for (var style of ['css', 'scss', 'less', 'styl', 'pcss']) {
16+
it(`should create app with ${style}`, async (done) => {
17+
const plugin = uniq('app2');
18+
19+
ensureNxProject('@nxext/stencil', 'dist/libs/stencil');
20+
await runNxCommandAsync(
21+
`generate @nxext/stencil:app ${plugin} --style=${style}`
22+
);
23+
24+
testProject(plugin, style, ProjectType.Application);
25+
26+
done();
27+
});
28+
}
29+
});
30+
31+
describe('--directory', () => {
32+
it('should create src in the specified directory', async (done) => {
33+
const plugin = uniq('app1');
34+
ensureNxProject('@nxext/stencil', 'dist/libs/stencil');
35+
await runNxCommandAsync(
36+
`generate @nxext/stencil:application ${plugin} --directory subdir --style=css`
37+
);
38+
expect(() =>
39+
checkFilesExist(`apps/subdir/${plugin}/stencil.config.ts`)
40+
).not.toThrow();
41+
done();
42+
});
43+
});
44+
45+
describe('--tags', () => {
46+
it('should add tags to nx.json', async (done) => {
47+
const plugin = uniq('app3');
48+
ensureNxProject('@nxext/stencil', 'dist/libs/stencil');
49+
await runNxCommandAsync(
50+
`generate @nxext/stencil:app ${plugin} --tags e2etag,e2ePackage --style=css`
51+
);
52+
const nxJson = readJson('nx.json');
53+
expect(nxJson.projects[plugin].tags).toEqual(['e2etag', 'e2ePackage']);
54+
done();
55+
});
56+
});
57+
58+
describe('stencil app builder', () => {
59+
SUPPORTED_STYLE_LIBRARIES.forEach(style => {
60+
it(`should build app with ${style}`, async (done) => {
61+
const plugin = uniq('app2');
62+
ensureNxProject('@nxext/stencil', 'dist/libs/stencil');
63+
await runNxCommandAsync(
64+
`generate @nxext/stencil:app ${plugin} --style=css`
65+
);
66+
67+
const result = await runNxCommandAsync(`build ${plugin}`);
68+
expect(result.stdout).toContain('build finished');
69+
70+
done();
71+
});
72+
});
73+
});
74+
});
75+
});
+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import { ProjectType } from '@nrwl/workspace';
2+
import {
3+
checkFilesExist,
4+
ensureNxProject,
5+
runNxCommandAsync,
6+
uniq,
7+
} from '@nrwl/nx-plugin/testing';
8+
import { SUPPORTED_STYLE_LIBRARIES } from '../../../libs/stencil/src/utils/testing';
9+
import { testProject } from '../utils/testing';
10+
11+
describe('e2e-pwa', () => {
12+
describe('stencil pwa', () => {
13+
for (var style of ['css', 'scss', 'less', 'styl', 'pcss']) {
14+
it(`should create pwa with ${style}`, async (done) => {
15+
const plugin = uniq('pwa');
16+
17+
ensureNxProject('@nxext/stencil', 'dist/libs/stencil');
18+
await runNxCommandAsync(
19+
`generate @nxext/stencil:pwa ${plugin} --style=${style}`
20+
);
21+
22+
testProject(plugin, style, ProjectType.Application);
23+
24+
done();
25+
});
26+
}
27+
28+
describe('--directory', () => {
29+
it('should create src in the specified directory', async (done) => {
30+
const plugin = uniq('pwa');
31+
ensureNxProject('@nxext/stencil', 'dist/libs/stencil');
32+
await runNxCommandAsync(
33+
`generate @nxext/stencil:pwa ${plugin} --directory subdir --style=css`
34+
);
35+
expect(() =>
36+
checkFilesExist(`apps/subdir/${plugin}/stencil.config.ts`)
37+
).not.toThrow();
38+
done();
39+
});
40+
});
41+
42+
describe('--tags', () => {
43+
it('should add tags to nx.json', async (done) => {
44+
const plugin = uniq('pwa');
45+
ensureNxProject('@nxext/stencil', 'dist/libs/stencil');
46+
await runNxCommandAsync(
47+
`generate @nxext/stencil:pwa ${plugin} --tags e2etag,e2ePackage --style=css`
48+
);
49+
50+
done();
51+
});
52+
});
53+
54+
describe('stencil app builder', () => {
55+
SUPPORTED_STYLE_LIBRARIES.forEach(style => {
56+
it(`should bould pwa app with ${style}`, async (done) => {
57+
const plugin = uniq('pwa');
58+
ensureNxProject('@nxext/stencil', 'dist/libs/stencil');
59+
await runNxCommandAsync(
60+
`generate @nxext/stencil:pwa ${plugin} --style=css`
61+
);
62+
63+
const result = await runNxCommandAsync(`build ${plugin}`);
64+
expect(result.stdout).toContain('build finished');
65+
66+
done();
67+
});
68+
});
69+
});
70+
});
71+
});

0 commit comments

Comments
 (0)