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.
feat(js): create @nrwl/js package and move @nrwl/workspace:tsc to it (n…
- Loading branch information
1 parent
18f2e70
commit d28f571
Showing
47 changed files
with
515 additions
and
40 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
2 changes: 1 addition & 1 deletion
2
docs/angular/api-workspace/executors/tsc.md → docs/angular/api-js/executors/tsc.md
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# @nrwl/workspace:tsc | ||
# @nrwl/js:tsc | ||
|
||
Build a project using TypeScript. | ||
|
||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
"detox", | ||
"gatsby", | ||
"jest", | ||
"js", | ||
"linter", | ||
"next", | ||
"node", | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"express", | ||
"gatsby", | ||
"jest", | ||
"js", | ||
"linter", | ||
"nest", | ||
"next", | ||
|
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 |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
"node", | ||
"storybook", | ||
"web", | ||
"workspace" | ||
"workspace", | ||
"js" | ||
] |
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
2 changes: 1 addition & 1 deletion
2
docs/node/api-workspace/executors/tsc.md → docs/node/api-js/executors/tsc.md
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# @nrwl/workspace:tsc | ||
# @nrwl/js:tsc | ||
|
||
Build a project using TypeScript. | ||
|
||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
"detox", | ||
"gatsby", | ||
"jest", | ||
"js", | ||
"linter", | ||
"next", | ||
"node", | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"express", | ||
"gatsby", | ||
"jest", | ||
"js", | ||
"linter", | ||
"nest", | ||
"next", | ||
|
2 changes: 1 addition & 1 deletion
2
docs/react/api-workspace/executors/tsc.md → docs/react/api-js/executors/tsc.md
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# @nrwl/workspace:tsc | ||
# @nrwl/js:tsc | ||
|
||
Build a project using TypeScript. | ||
|
||
|
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
"detox", | ||
"gatsby", | ||
"jest", | ||
"js", | ||
"linter", | ||
"next", | ||
"node", | ||
|
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 |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
"express", | ||
"gatsby", | ||
"jest", | ||
"js", | ||
"linter", | ||
"nest", | ||
"next", | ||
|
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,10 @@ | ||
module.exports = { | ||
preset: '../../jest.preset.js', | ||
transform: { | ||
'^.+\\.[tj]sx?$': 'ts-jest', | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], | ||
maxWorkers: 1, | ||
globals: { 'ts-jest': { tsconfig: '<rootDir>/tsconfig.spec.json' } }, | ||
displayName: 'e2e-js', | ||
}; |
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,34 @@ | ||
{ | ||
"root": "e2e/js", | ||
"sourceRoot": "e2e/js", | ||
"projectType": "application", | ||
"targets": { | ||
"e2e": { | ||
"executor": "@nrwl/workspace:run-commands", | ||
"options": { | ||
"commands": [ | ||
{ | ||
"command": "yarn e2e-start-local-registry" | ||
}, | ||
{ | ||
"command": "yarn e2e-build-package-publish" | ||
}, | ||
{ | ||
"command": "nx run-e2e-tests e2e-jest" | ||
} | ||
], | ||
"parallel": false | ||
} | ||
}, | ||
"run-e2e-tests": { | ||
"executor": "@nrwl/jest:jest", | ||
"options": { | ||
"jestConfig": "e2e/js/jest.config.js", | ||
"passWithNoTests": true, | ||
"runInBand": true | ||
}, | ||
"outputs": ["coverage/e2e/js"] | ||
} | ||
}, | ||
"implicitDependencies": ["jest"] | ||
} |
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,42 @@ | ||
import { | ||
checkFilesExist, | ||
ensureNxProject, | ||
readJson, | ||
runNxCommandAsync, | ||
uniq, | ||
} from '@nrwl/nx-plugin/testing'; | ||
describe('js e2e', () => { | ||
it('should create js', async () => { | ||
const plugin = uniq('js'); | ||
ensureNxProject('@nrwl/js', 'dist//js'); | ||
await runNxCommandAsync(`generate @nrwl/js:js ${plugin}`); | ||
|
||
const result = await runNxCommandAsync(`build ${plugin}`); | ||
expect(result.stdout).toContain('Executor ran'); | ||
}, 120000); | ||
|
||
describe('--directory', () => { | ||
it('should create src in the specified directory', async () => { | ||
const plugin = uniq('js'); | ||
ensureNxProject('@nrwl/js', 'dist//js'); | ||
await runNxCommandAsync( | ||
`generate @nrwl/js:js ${plugin} --directory subdir` | ||
); | ||
expect(() => | ||
checkFilesExist(`libs/subdir/${plugin}/src/index.ts`) | ||
).not.toThrow(); | ||
}, 120000); | ||
}); | ||
|
||
describe('--tags', () => { | ||
it('should add tags to the project', async () => { | ||
const plugin = uniq('js'); | ||
ensureNxProject('@nrwl/js', 'dist//js'); | ||
await runNxCommandAsync( | ||
`generate @nrwl/js:js ${plugin} --tags e2etag,e2ePackage` | ||
); | ||
const project = readJson(`libs/${plugin}/project.json`); | ||
expect(project.tags).toEqual(['e2etag', 'e2ePackage']); | ||
}, 120000); | ||
}); | ||
}); |
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,13 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"types": ["node", "jest"] | ||
}, | ||
"include": [], | ||
"files": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
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,16 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/out-tsc", | ||
"module": "commonjs", | ||
"types": ["jest", "node"] | ||
}, | ||
"include": [ | ||
"**/*.test.ts", | ||
"**/*.spec.ts", | ||
"**/*.spec.tsx", | ||
"**/*.spec.js", | ||
"**/*.spec.jsx", | ||
"**/*.d.ts" | ||
] | ||
} |
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,3 @@ | ||
{ | ||
"presets": [["@nrwl/web/babel", { "useBuiltIns": "usage" }]] | ||
} |
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 @@ | ||
{ | ||
"extends": ["../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
} | ||
] | ||
} |
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,7 @@ | ||
# js | ||
|
||
This library was generated with [Nx](https://nx.dev). | ||
|
||
## Running unit tests | ||
|
||
Run `nx test js` to execute the unit tests via [Jest](https://jestjs.io). |
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,17 @@ | ||
{ | ||
"$schema": "http://json-schema.org/schema", | ||
"executors": { | ||
"tsc": { | ||
"implementation": "./src/executors/tsc/tsc.impl", | ||
"schema": "./src/executors/tsc/schema.json", | ||
"description": "Build a project using TypeScript." | ||
} | ||
}, | ||
"builders": { | ||
"tsc": { | ||
"implementation": "./src/executors/tsc/compat", | ||
"schema": "./src/executors/tsc/schema.json", | ||
"description": "Build a project using TypeScript." | ||
} | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"$schema": "http://json-schema.org/schema", | ||
"name": "js", | ||
"version": "0.0.1", | ||
"generators": {} | ||
} |
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,10 @@ | ||
module.exports = { | ||
preset: '../../jest.preset.js', | ||
transform: { | ||
'^.+\\.[tj]sx?$': 'ts-jest', | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'html'], | ||
globals: { 'ts-jest': { tsconfig: '<rootDir>/tsconfig.spec.json' } }, | ||
displayName: 'jest', | ||
testEnvironment: 'node', | ||
}; |
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,4 @@ | ||
{ | ||
"generators": {}, | ||
"packageJsonUpdates": {} | ||
} |
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,12 @@ | ||
import path = require('path'); | ||
import json = require('./migrations.json'); | ||
|
||
describe('JS migrations', () => { | ||
it('should have valid paths', () => { | ||
Object.values(json.generators).forEach((m: any) => { | ||
expect(() => | ||
require.resolve(path.join(__dirname, `${m.factory}.ts`)) | ||
).not.toThrow(); | ||
}); | ||
}); | ||
}); |
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,11 @@ | ||
{ | ||
"name": "@nrwl/js", | ||
"version": "0.0.1", | ||
"main": "src/index.js", | ||
"generators": "./generators.json", | ||
"executors": "./executors.json", | ||
"dependencies": { | ||
"@nrwl/workspace": "*", | ||
"@nrwl/devkit": "*" | ||
} | ||
} |
Oops, something went wrong.