-
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
Showing
99 changed files
with
13,210 additions
and
5,597 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 |
---|---|---|
@@ -1 +1,7 @@ | ||
node_modules | ||
dist | ||
.verdaccio | ||
.nx | ||
.husky | ||
coverage | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,5 @@ testem.log | |
.DS_Store | ||
Thumbs.db | ||
|
||
.nx/cache | ||
.nx/cache | ||
.nx/workspace-data |
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 |
---|---|---|
|
@@ -2,4 +2,5 @@ node_modules | |
tmp | ||
dist | ||
coverage | ||
.nx | ||
.nx | ||
/.nx/workspace-data |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,74 @@ | ||
import { execNx, getTestWorkspaceRoot } from '../helper/functions'; | ||
import { existsSync } from 'fs'; | ||
import { existsSync, rmSync } from 'fs'; | ||
import { join } from 'path'; | ||
|
||
describe('Library', () => { | ||
describe('Library Generator', () => { | ||
const workspaceRoot = getTestWorkspaceRoot(); | ||
|
||
describe.each(['backend', 'frontend', 'shared'])('Library %s', (type) => { | ||
beforeAll(() => { | ||
beforeAll(() => { | ||
['backend', 'frontend', 'shared'].forEach((type) => { | ||
execNx(workspaceRoot, `g @hexancore/nx:lib acme/${type} --type ${type}`); | ||
}); | ||
}); | ||
|
||
describe.each(['backend', 'frontend', 'shared'])('%s', (type) => { | ||
test('should be created', () => { | ||
expect(existsSync(join(workspaceRoot, `libs/acme/${type}`, 'package.json'))).toBeTruthy(); | ||
}); | ||
|
||
test('target test should pass', () => { | ||
execNx(workspaceRoot, `run acme-${type}:test`); | ||
}); | ||
|
||
test('target lint should pass', () => { | ||
execNx(workspaceRoot, `run acme-${type}:lint`); | ||
}); | ||
}); | ||
|
||
describe('backend', () => { | ||
test('target build should pass', () => { | ||
execNx(workspaceRoot, `run acme-${type}:build`); | ||
execNx(workspaceRoot, `run acme-backend:build`); | ||
|
||
expect(existsSync(join(workspaceRoot, `dist/libs/acme/backend/src/index.js`))).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
const expectedIndex = type === 'frontend' ? 'index.mjs' : 'src/index.js'; | ||
describe('shared', () => { | ||
test('target build should pass', () => { | ||
execNx(workspaceRoot, `run acme-shared:build`); | ||
|
||
expect(existsSync(join(workspaceRoot, `dist/libs/acme/${type}/${expectedIndex}`))).toBeTruthy(); | ||
expect(existsSync(join(workspaceRoot, `dist/libs/acme/shared/src/index.js`))).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
|
||
describe('frontend', () => { | ||
test('target build should pass', () => { | ||
execNx(workspaceRoot, `run acme-frontend:build`); | ||
|
||
const distDir = 'dist/libs/acme/frontend'; | ||
const expectedDistFiles = [ | ||
'Asset/Style/variables.css', | ||
'Component/Button/Button.css', | ||
'Component/Button/Button.script.js', | ||
'Component/Button/Button.vue.js' | ||
].map((f) => `${distDir}/${f}`); | ||
|
||
// only when run e2e tests it's appears. | ||
if (existsSync(`${distDir}/ugin-vue_export-helper`)) { | ||
rmSync(`${distDir}/ugin-vue_export-helper`); | ||
} | ||
|
||
expectedDistFiles.forEach((f) => { | ||
expect(existsSync(join(workspaceRoot, f))).toBeTruthy(); | ||
}); | ||
|
||
test('target test should pass', () => { | ||
execNx(workspaceRoot, `run acme-${type}:test`); | ||
}); | ||
|
||
test('target lint should pass', () => { | ||
execNx(workspaceRoot, `run acme-${type}:lint`); | ||
test('target storybook-build should pass', () => { | ||
execNx(workspaceRoot, `run acme-frontend:storybook-build`); | ||
}); | ||
}); | ||
|
||
}); | ||
|
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
import { existsSync } from "fs"; | ||
import { execNx, getTestWorkspaceRoot } from "./functions"; | ||
|
||
export default () => { | ||
if (global.stopLocalRegistry) { | ||
global.stopLocalRegistry(); | ||
} | ||
|
||
const workspaceRoot = getTestWorkspaceRoot(); | ||
if (existsSync(workspaceRoot)) { | ||
execNx(workspaceRoot, 'reset'); | ||
execNx(workspaceRoot, 'reset', 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VITE_CJS_IGNORE_WARNING=true |
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.