Skip to content

Commit

Permalink
Merge pull request #124 from HHS/bootstrap-account-admin
Browse files Browse the repository at this point in the history
Move tools directory within src
  • Loading branch information
rahearn authored Jan 20, 2021
2 parents d04bf67 + 8fd1f1b commit 782498a
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 13 deletions.
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"scripts": {
"axe:ci": "axe --exit --load-delay 1000 `cat axe-urls` --dir ./reports/ --chromedriver-path=\"node_modules/chromedriver/bin/chromedriver\"",
"build": "./node_modules/.bin/babel src -d ./build/server && ./node_modules/.bin/babel config -d build/config",
"build": "./node_modules/.bin/babel src -d ./build/server && ./node_modules/.bin/babel config -d build/config",
"deps:local": "yarn install && yarn --cwd frontend install",
"deps": "yarn install --frozen-lockfile && yarn --cwd frontend install --frozen-lockfile",
"start:local": "concurrently \"yarn server\" \"yarn client\"",
Expand All @@ -17,17 +17,18 @@
"server": "nodemon src/index.js --exec babel-node",
"server:debug": "nodemon src/index.js --exec babel-node --inspect",
"client": "yarn --cwd frontend start",
"test": "jest src tools",
"test:ci": "cross-env JEST_JUNIT_OUTPUT_DIR=reports JEST_JUNIT_OUTPUT_NAME=unit.xml POSTGRES_USERNAME=postgres POSTGRES_DB=ttasmarthub CURRENT_USER_ID=5 CI=true jest src tools --coverage --reporters=default --reporters=jest-junit",
"test": "jest src",
"test:ci": "cross-env JEST_JUNIT_OUTPUT_DIR=reports JEST_JUNIT_OUTPUT_NAME=unit.xml POSTGRES_USERNAME=postgres POSTGRES_DB=ttasmarthub CURRENT_USER_ID=5 CI=true jest src --coverage --reporters=default --reporters=jest-junit",
"test:all": "yarn test:ci && yarn --cwd frontend test:ci",
"lint": "eslint src",
"lint:ci": "eslint -f eslint-formatter-multiple src tools",
"lint:ci": "eslint -f eslint-formatter-multiple src",
"lint:all": "yarn lint:ci && yarn --cwd frontend lint:ci",
"clean": "rm -rf coverage reports frontend/coverage frontend/reports frontend/build",
"docs:serve": "npx redoc-cli serve -p 5000 docs/openapi/index.yaml",
"cucumber": "./node_modules/.bin/cucumber-js --publish ./cucumber/features/*.feature -f json:./reports/cucumber_report.json && node ./cucumber/index.js",
"cucumber:ci": "cross-env TTA_SMART_HUB_URI=http://localhost:3000 yarn cucumber",
"db:bootstrap:admin": "./node_modules/.bin/babel-node ./tools/bootstrapAdminCLI.js",
"db:bootstrap:admin:local": "./node_modules/.bin/babel-node ./src/tools/bootstrapAdminCLI.js",
"db:bootstrap:admin": "node ./build/server/tools/bootstrapAdminCLI.js",
"db:migrate": "node_modules/.bin/sequelize db:migrate",
"db:migrate:ci": "cross-env POSTGRES_USERNAME=postgres POSTGRES_DB=ttasmarthub node_modules/.bin/sequelize db:migrate",
"db:migrate:prod": "node_modules/.bin/sequelize db:migrate --options-path .production.sequelizerc",
Expand All @@ -50,7 +51,8 @@
"docker:db:migrate:undo": "docker-compose run --rm backend node_modules/.bin/sequelize db:migrate:undo",
"docker:db:seed": "docker-compose run --rm backend yarn db:seed",
"docker:db:seed:undo": "docker-compose run --rm backend yarn db:seed:undo",
"import:goals": "./node_modules/.bin/babel-node ./tools/importTTAPlanGoals.js"
"import:goals:local": "./node_modules/.bin/babel-node ./src/tools/importTTAPlanGoals.js",
"import:goals": "node ./build/server/tools/importTTAPlanGoals.js"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions tools/bootstrapAdmin.js → src/tools/bootstrapAdmin.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { User, Permission } from '../src/models';
import logger from '../src/logger';
import SCOPES from '../src/middleware/scopeConstants';
import { User, Permission } from '../models';
import logger from '../logger';
import SCOPES from '../middleware/scopeConstants';

const { ADMIN } = SCOPES;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import bootstrapAdmin, { ADMIN_EMAIL } from './bootstrapAdmin';
import db, { User } from '../src/models';
import db, { User } from '../models';

describe('Bootstrap the first Admin user', () => {
afterAll(() => {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tools/importPlanGoals.js → src/tools/importPlanGoals.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { readFileSync } from 'fs';
import parse from 'csv-parse/lib/sync';
import {
Role, Topic, RoleTopic, Goal, TopicGoal, Grant, GrantGoal,
} from '../src/models';
} from '../models';

const hubRoles = [
{ name: 'RPM', fullName: 'Regional Program Manager' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Op } from 'sequelize';
import importGoals from './importPlanGoals';
import { processFiles } from '../src/lib/updateGrantsGrantees';
import { processFiles } from '../lib/updateGrantsGrantees';
import db, {
Role, Topic, RoleTopic, Goal, Grantee, Grant,
} from '../src/models';
} from '../models';

describe('Import TTA plan goals', () => {
afterAll(() => {
Expand Down
File renamed without changes.

0 comments on commit 782498a

Please sign in to comment.