Skip to content

Commit

Permalink
[Build] add plugins to root
Browse files Browse the repository at this point in the history
Adding plugins to root directory and updates the generate
plugin integration test to not delete the directory automatically.

It cleans up the directory and leaves the gitignore and the parent
directory. This directory is for chokidar and a start up check
the fails to start if the directory isn't there.

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
  • Loading branch information
kavilla committed Apr 10, 2021
1 parent 9e4400b commit 4751b7d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ target
/test/*/screenshots/visual_regression_gallery.html
/html_docs
.eslintcache
/plugins/
/data
disabledPlugins
webpackstats.json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ const GENERATED_DIR = Path.resolve(REPO_ROOT, `plugins`);
expect.addSnapshotSerializer(createAbsolutePathSerializer());

beforeEach(async () => {
await del(GENERATED_DIR, { force: true });
await del([`${GENERATED_DIR}/**`, `!${GENERATED_DIR}`, `!${GENERATED_DIR}/.gitignore`], {
force: true,
});
});

afterEach(async () => {
await del(GENERATED_DIR, { force: true });
await del([`${GENERATED_DIR}/**`, `!${GENERATED_DIR}`, `!${GENERATED_DIR}/.gitignore`], {
force: true,
});
});

it('generates a plugin', async () => {
Expand All @@ -66,6 +70,7 @@ it('generates a plugin', async () => {

expect(paths.sort((a, b) => a.localeCompare(b))).toMatchInlineSnapshot(`
Array [
<absolute path>/plugins/.gitignore,
<absolute path>/plugins/foo/.eslintrc.js,
<absolute path>/plugins/foo/.gitignore,
<absolute path>/plugins/foo/.i18nrc.json,
Expand Down Expand Up @@ -105,6 +110,7 @@ it('generates a plugin without UI', async () => {

expect(paths.sort((a, b) => a.localeCompare(b))).toMatchInlineSnapshot(`
Array [
<absolute path>/plugins/.gitignore,
<absolute path>/plugins/bar/.eslintrc.js,
<absolute path>/plugins/bar/.gitignore,
<absolute path>/plugins/bar/.i18nrc.json,
Expand Down Expand Up @@ -137,6 +143,7 @@ it('generates a plugin without server plugin', async () => {

expect(paths.sort((a, b) => a.localeCompare(b))).toMatchInlineSnapshot(`
Array [
<absolute path>/plugins/.gitignore,
<absolute path>/plugins/baz/.eslintrc.js,
<absolute path>/plugins/baz/.gitignore,
<absolute path>/plugins/baz/.i18nrc.json,
Expand Down
4 changes: 4 additions & 0 deletions plugins/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

0 comments on commit 4751b7d

Please sign in to comment.