Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Feb 16, 2023
0 parents commit 1bb6a05
Show file tree
Hide file tree
Showing 41 changed files with 17,974 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
47 changes: 47 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
"allow": [],
"depConstraints": [
{
"sourceTag": "*",
"onlyDependOnLibsWithTags": ["*"]
}
]
}
]
}
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"rules": {}
},
{
"files": ["*.spec.ts", "*.spec.tsx", "*.spec.js", "*.spec.jsx"],
"env": {
"jest": true
},
"rules": {}
},
{
"files": "*.json",
"parser": "jsonc-eslint-parser",
"rules": {}
}
]
}
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
dist
tmp
/out-tsc

# dependencies
node_modules

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Add files here to ignore them from prettier formatting

/dist
/coverage
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"nrwl.angular-console",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"firsttris.vscode-jest-runner"
]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"eslint.validate": ["json"]
}
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# NxHeroku

<a alt="Nx logo" href="https://nx.dev" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.png" width="45"></a>

**This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)**

## Understand this workspace

Run `nx graph` to see a diagram of the dependencies of the projects.

## Remote caching

Run `npx nx connect-to-nx-cloud` to enable [remote caching](https://nx.app) and make CI faster.

## Further help

Visit the [Nx Documentation](https://nx.dev) to learn more.
15 changes: 15 additions & 0 deletions e2e/nx-heroku-e2e/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-disable */
export default {
displayName: 'nx-heroku-e2e',
preset: '../../jest.preset.js',
globals: {
'ts-jest': {
tsconfig: '<rootDir>/tsconfig.spec.json',
},
},
transform: {
'^.+\\.[tj]s$': 'ts-jest',
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/e2e/nx-heroku-e2e',
};
17 changes: 17 additions & 0 deletions e2e/nx-heroku-e2e/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "nx-heroku-e2e",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "e2e/nx-heroku-e2e/src",
"targets": {
"e2e": {
"executor": "@nrwl/nx-plugin:e2e",
"options": {
"target": "nx-heroku:build",
"jestConfig": "e2e/nx-heroku-e2e/jest.config.ts"
}
}
},
"tags": [],
"implicitDependencies": ["nx-heroku"]
}
58 changes: 58 additions & 0 deletions e2e/nx-heroku-e2e/tests/nx-heroku.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import {
checkFilesExist,
ensureNxProject,
readJson,
runNxCommandAsync,
uniq,
} from '@nrwl/nx-plugin/testing';

describe('nx-heroku e2e', () => {
// Setting up individual workspaces per
// test can cause e2e runs to take a long time.
// For this reason, we recommend each suite only
// consumes 1 workspace. The tests should each operate
// on a unique project in the workspace, such that they
// are not dependant on one another.
beforeAll(() => {
ensureNxProject('@nx-heroku/nx-heroku', 'dist/packages/nx-heroku');
});

afterAll(() => {
// `nx reset` kills the daemon, and performs
// some work which can help clean up e2e leftovers
runNxCommandAsync('reset');
});

it('should create nx-heroku', async () => {
const project = uniq('nx-heroku');
await runNxCommandAsync(
`generate @nx-heroku/nx-heroku:nx-heroku ${project}`
);
const result = await runNxCommandAsync(`build ${project}`);
expect(result.stdout).toContain('Executor ran');
}, 120000);

describe('--directory', () => {
it('should create src in the specified directory', async () => {
const project = uniq('nx-heroku');
await runNxCommandAsync(
`generate @nx-heroku/nx-heroku:nx-heroku ${project} --directory subdir`
);
expect(() =>
checkFilesExist(`libs/subdir/${project}/src/index.ts`)
).not.toThrow();
}, 120000);
});

describe('--tags', () => {
it('should add tags to the project', async () => {
const projectName = uniq('nx-heroku');
ensureNxProject('@nx-heroku/nx-heroku', 'dist/packages/nx-heroku');
await runNxCommandAsync(
`generate @nx-heroku/nx-heroku:nx-heroku ${projectName} --tags e2etag,e2ePackage`
);
const project = readJson(`libs/${projectName}/project.json`);
expect(project.tags).toEqual(['e2etag', 'e2ePackage']);
}, 120000);
});
});
10 changes: 10 additions & 0 deletions e2e/nx-heroku-e2e/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.spec.json"
}
]
}
14 changes: 14 additions & 0 deletions e2e/nx-heroku-e2e/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"include": [
"jest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
5 changes: 5 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { getJestProjects } from '@nrwl/jest';

export default {
projects: getJestProjects(),
};
3 changes: 3 additions & 0 deletions jest.preset.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const nxPreset = require('@nrwl/jest/preset').default;

module.exports = { ...nxPreset };
27 changes: 27 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"npmScope": "nx-heroku",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"]
}
}
},
"targetDefaults": {
"build": {
"dependsOn": ["^build"]
},
"lint": {
"inputs": ["default", "{workspaceRoot}/.eslintrc.json"]
},
"test": {
"inputs": ["default", "^default", "{workspaceRoot}/jest.preset.js"]
}
},
"workspaceLayout": {
"appsDir": "e2e",
"libsDir": "packages"
}
}
Loading

0 comments on commit 1bb6a05

Please sign in to comment.