-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add worker library generator (#23)
* feat: create empty library generator * feat: modernize app generation to include the new nx projects format * feat: create cloudflare worker lib generator * docs: update readme to match new implementation * test: adjust test to schema simplification * fix: lint issue * test: create library e2e files * fix: library usage of the plugin * fix: missing config on schema * fix: failing test
- Loading branch information
1 parent
3bd636f
commit 4a4ad71
Showing
12 changed files
with
1,273 additions
and
48 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
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,29 @@ | ||
import { | ||
uniq, | ||
fileExists, | ||
tmpProjPath, | ||
runNxCommand, | ||
} from '@nx/plugin/testing'; | ||
import { newNxProject, installPlugin, cleanup } from '@naxodev/e2e/utils'; | ||
import { join } from 'path'; | ||
|
||
describe('Cloudflare Worker Library', () => { | ||
beforeEach(() => { | ||
newNxProject(); | ||
installPlugin('nx-cloudflare'); | ||
}); | ||
|
||
afterEach(() => cleanup()); | ||
|
||
it('should be able to generate a library', async () => { | ||
const workerlib = uniq('workerlib'); | ||
|
||
runNxCommand( | ||
`generate @naxodev/nx-cloudflare:lib --name=${workerlib} --directory="libs/${workerlib}" --unitTestRunner="none"` | ||
); | ||
|
||
expect( | ||
fileExists(join(tmpProjPath(), `libs/${workerlib}/project.json`)) | ||
).toBeTruthy(); | ||
}, 30_000); | ||
}); |
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
3 changes: 3 additions & 0 deletions
3
packages/plugins/nx-cloudflare/src/generators/application/schema.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
Oops, something went wrong.