diff --git a/.gitignore b/.gitignore index 7fa4bf8..876fc40 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,7 @@ /tests/e2e/videos/ /tests/e2e/screenshots/ + +.DS_Store +lerna-debug.log +node_modules diff --git a/.travis.yml b/.travis.yml index 4c7245a..fb3719b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,8 +16,10 @@ cache: # we also need to cache folder with Cypress binary - ~/.cache install: - - yarn install + - npm install -g lerna + - yarn run setup script: + - yarn run build - yarn run ci:unit - yarn run ci:e2e diff --git a/deploy b/deploy deleted file mode 160000 index 2788457..0000000 --- a/deploy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2788457bab547373059a01a38f743147cd737120 diff --git a/lerna.json b/lerna.json new file mode 100644 index 0000000..02962cf --- /dev/null +++ b/lerna.json @@ -0,0 +1,7 @@ +{ + "packages": [ + "packages/*" + ], + "version": "0.0.0", + "npmClient": "yarn" +} diff --git a/package.json b/package.json index b84cbb1..010c992 100644 --- a/package.json +++ b/package.json @@ -1,92 +1,12 @@ { - "name": "i-just-crashed-my-plane", - "version": "0.1.0", + "name": "root", "private": true, "scripts": { - "serve": "vue-cli-service serve", - "build": "vue-cli-service build", - "test:unit": "vue-cli-service test:unit", - "test:e2e": "vue-cli-service test:e2e", - "lint": "vue-cli-service lint", - "docs:generate": "npx typedoc --out docs src", - "ci:e2e:start-server": "yarn serve", - "ci:e2e:run": "cypress run --record --key 4985f51e-046b-4590-b6e3-f124c50cc39c", - "ci:e2e": "npx start-server-and-test ci:e2e:start-server 8080 ci:e2e:run", - "ci:unit": "yarn run test:unit" - }, - "dependencies": { - "@bugsnag/js": "^7.1.0", - "@bugsnag/plugin-vue": "^7.1.0", - "cldr-data": "^36.0.0", - "cldrjs": "^0.5.1", - "core-js": "^3.6.5", - "lodash-es": "^4.17.15", - "normalize.css": "^8.0.1", - "vue": "^2.6.11", - "vue-class-component": "^7.2.3", - "vue-i18n": "^8.17.7", - "vue-property-decorator": "^8.4.2", - "vuex": "^3.4.0", - "vuex-class": "^0.3.2" + "setup": "lerna bootstrap", + "build": "lerna run build", + "serve": "lerna run serve --parallel" }, "devDependencies": { - "@cypress/webpack-preprocessor": "^5.4.1", - "@types/chai": "^4.2.11", - "@types/chai-as-promised": "^7.1.2", - "@types/cldrjs": "^0.4.22", - "@types/lodash-es": "^4.17.3", - "@types/mocha": "^7.0.2", - "@typescript-eslint/eslint-plugin": "^3.0.1", - "@typescript-eslint/parser": "^3.0.1", - "@vue/cli-plugin-babel": "~4.3.1", - "@vue/cli-plugin-e2e-cypress": "~4.3.1", - "@vue/cli-plugin-eslint": "~4.3.1", - "@vue/cli-plugin-router": "~4.3.1", - "@vue/cli-plugin-typescript": "^4.3.1", - "@vue/cli-plugin-unit-mocha": "~4.3.1", - "@vue/cli-plugin-vuex": "~4.3.1", - "@vue/cli-service": "~4.3.1", - "@vue/eslint-config-airbnb": "^5.0.2", - "@vue/eslint-config-typescript": "^5.0.2", - "@vue/test-utils": "1.0.3", - "chai": "^4.1.2", - "chai-as-promised": "^7.1.1", - "chai-each": "^0.0.1", - "eslint": "^7.1.0", - "eslint-plugin-chai-expect": "^2.1.0", - "eslint-plugin-chai-friendly": "^0.6.0", - "eslint-plugin-cypress": "^2.10.3", - "eslint-plugin-import": "^2.20.2", - "eslint-plugin-mocha": "^7.0.0", - "eslint-plugin-vue": "^6.2.2", - "lint-staged": "^10.2.6", - "null-loader": "^4.0.0", - "sass": "^1.26.5", - "sass-loader": "^8.0.2", - "start-server-and-test": "^1.11.0", - "stylelint": "^13.5.0", - "stylelint-config-sass-guidelines": "^7.0.0", - "stylelint-config-standard": "^20.0.0", - "stylelint-processor-html": "^1.0.0", - "typedoc": "^0.17.7", - "typescript": "~3.9.3", - "vue-template-compiler": "^2.6.11" - }, - "gitHooks": { - "pre-commit": "lint-staged" - }, - "lint-staged": { - "*.{js,jsx,vue,ts,tsx}": [ - "vue-cli-service lint --fix" - ], - "*.{css,vue}": [ - "npx stylelint --fix" - ], - "*.scss": [ - "npx stylelint --fix --syntax scss" - ], - "*.sass": [ - "npx stylelint --fix --syntax sass" - ] + "lerna": "^3.22.0" } } diff --git a/packages/survey/.gitignore b/packages/survey/.gitignore new file mode 100644 index 0000000..7773828 --- /dev/null +++ b/packages/survey/.gitignore @@ -0,0 +1 @@ +dist/ \ No newline at end of file diff --git a/packages/survey/package.json b/packages/survey/package.json new file mode 100644 index 0000000..0423608 --- /dev/null +++ b/packages/survey/package.json @@ -0,0 +1,36 @@ +{ + "name": "i-just-crashed-my-plane-survey", + "version": "0.1.0", + "main": "dist/index.js", + "license": "MIT", + "private": true, + "scripts": { + "build": "tsc", + "serve": "tsc -w" + }, + "dependencies": { + "lodash-es": "^4.17.15" + }, + "devDependencies": { + "@types/lodash-es": "^4.17.3", + "typedoc": "^0.17.7", + "typescript": "~3.9.3" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.{js,jsx,vue,ts,tsx}": [ + "vue-cli-service lint --fix" + ], + "*.{css,vue}": [ + "npx stylelint --fix" + ], + "*.scss": [ + "npx stylelint --fix --syntax scss" + ], + "*.sass": [ + "npx stylelint --fix --syntax sass" + ] + } +} diff --git a/src/data/surveyOrder.ts b/packages/survey/src/data/surveyOrder.ts similarity index 60% rename from src/data/surveyOrder.ts rename to packages/survey/src/data/surveyOrder.ts index 2af9d18..b24ffff 100644 --- a/src/data/surveyOrder.ts +++ b/packages/survey/src/data/surveyOrder.ts @@ -1,5 +1,5 @@ -import profileSurvey from '@/data/surveys/profile' -import incidentSurvey from '@/data/surveys/incident' +import profileSurvey from './surveys/profile' +import incidentSurvey from './surveys/incident' /** The order to present {@link Survey}s to the user. */ diff --git a/src/data/surveys.ts b/packages/survey/src/data/surveys.ts similarity index 57% rename from src/data/surveys.ts rename to packages/survey/src/data/surveys.ts index 0150eb8..00c4c34 100644 --- a/src/data/surveys.ts +++ b/packages/survey/src/data/surveys.ts @@ -1,6 +1,6 @@ -import Survey from '@/models/survey' -import profileSurvey from '@/data/surveys/profile' -import incidentSurvey from '@/data/surveys/incident' +import Survey from '../models/survey' +import profileSurvey from './surveys/profile' +import incidentSurvey from './surveys/incident' /** A dictionary of all {@link Survey}s, keyed by their identifier. */ diff --git a/src/data/surveys/incident.ts b/packages/survey/src/data/surveys/incident.ts similarity index 99% rename from src/data/surveys/incident.ts rename to packages/survey/src/data/surveys/incident.ts index bf42257..0931b1d 100644 --- a/src/data/surveys/incident.ts +++ b/packages/survey/src/data/surveys/incident.ts @@ -3,10 +3,10 @@ import { noMeansAccidentYesMeansIncident, noMeansSeriousIncidentYesMeansIncident, yesAskQuestion, yesMeansIncident, yesMeansAccidentNoMeansIncident, yesMeansSeriousIncidentNoMeansIncident, classifyAsIncident -} from '@/data/surveys/incidentSurveyShorthand' +} from './incidentSurveyShorthand' import Survey, { Flag, Option, Question, QuestionAction -} from '@/models/survey' +} from '../../models/survey' const incidentSurvey = new Survey('incident', new Question('root', [ diff --git a/src/data/surveys/incidentSurveyShorthand.ts b/packages/survey/src/data/surveys/incidentSurveyShorthand.ts similarity index 98% rename from src/data/surveys/incidentSurveyShorthand.ts rename to packages/survey/src/data/surveys/incidentSurveyShorthand.ts index d0e57cb..e5a8785 100644 --- a/src/data/surveys/incidentSurveyShorthand.ts +++ b/packages/survey/src/data/surveys/incidentSurveyShorthand.ts @@ -1,6 +1,6 @@ import { IncidentLevel, LevelAction, Option, Question, QuestionAction -} from '@/models/survey' +} from '../../models/survey' export const classifyAsAccident = new LevelAction(IncidentLevel.ACCIDENT) export const classifyAsSeriousIncident = new LevelAction(IncidentLevel.SERIOUS_INCIDENT) diff --git a/src/data/surveys/profile.ts b/packages/survey/src/data/surveys/profile.ts similarity index 92% rename from src/data/surveys/profile.ts rename to packages/survey/src/data/surveys/profile.ts index 4095b4a..d48293e 100644 --- a/src/data/surveys/profile.ts +++ b/packages/survey/src/data/surveys/profile.ts @@ -1,6 +1,6 @@ import Survey, { Flag, FlagAction, Option, Question -} from '@/models/survey' +} from '../../models/survey' const profileSurvey = new Survey('profile', new Question('root', [ diff --git a/packages/survey/src/index.ts b/packages/survey/src/index.ts new file mode 100644 index 0000000..c70e5ba --- /dev/null +++ b/packages/survey/src/index.ts @@ -0,0 +1,13 @@ +export * from "./models/survey/index"; +export * from "./models/survey/stackTraverser"; +export * from "./models/survey/traverser"; +export * from "./data/surveys/incidentSurveyShorthand"; + +export { default as Survey } from "./models/survey/index"; +export { default as SurveyStackTraverser } from "./models/survey/stackTraverser"; +export { default as SurveyTraverser } from "./models/survey/traverser"; +export { default as surveys } from "./data/surveys"; +export { default as surveyOrder } from "./data/surveyOrder"; +export { default as incidentSurvey } from "./data/surveys/incident"; +export { default as profileSurvey } from "./data/surveys/profile"; + diff --git a/src/models/survey/index.ts b/packages/survey/src/models/survey/index.ts similarity index 100% rename from src/models/survey/index.ts rename to packages/survey/src/models/survey/index.ts diff --git a/src/models/survey/stackTraverser.ts b/packages/survey/src/models/survey/stackTraverser.ts similarity index 93% rename from src/models/survey/stackTraverser.ts rename to packages/survey/src/models/survey/stackTraverser.ts index 2355d88..ace07dc 100644 --- a/src/models/survey/stackTraverser.ts +++ b/packages/survey/src/models/survey/stackTraverser.ts @@ -1,7 +1,7 @@ /* eslint-disable import/no-cycle */ -import Survey, { SurveyNode } from '@/models/survey/index' -import SurveyTraverser from '@/models/survey/traverser' +import Survey, { SurveyNode } from './index' +import SurveyTraverser from './traverser' /** * Interface for the callback receiver, used when traversing a {@link Survey} with a diff --git a/src/models/survey/traverser.ts b/packages/survey/src/models/survey/traverser.ts similarity index 99% rename from src/models/survey/traverser.ts rename to packages/survey/src/models/survey/traverser.ts index 2dfc2cb..b3b7f18 100644 --- a/src/models/survey/traverser.ts +++ b/packages/survey/src/models/survey/traverser.ts @@ -6,7 +6,7 @@ import Survey, { Option, Question, QuestionAction -} from '@/models/survey/index' +} from './index' /** * Interface for the callback receiver, used when traversing a {@link Survey} with a diff --git a/packages/survey/tsconfig.json b/packages/survey/tsconfig.json new file mode 100644 index 0000000..c750537 --- /dev/null +++ b/packages/survey/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "target": "esnext", + "module": "esnext", + "strict": true, + "jsx": "preserve", + "importHelpers": true, + "moduleResolution": "node", + "resolveJsonModule": true, + "experimentalDecorators": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "sourceMap": true, + "baseUrl": ".", + "outDir": "dist/", + "lib": [ + "esnext", + "dom", + "dom.iterable", + "scripthost" + ], + "declaration": true, + }, + "include": [ + "src/**/*.ts", + "tests/unit/**/*.ts", + ], + "exclude": [ + "node_modules" + ] +} diff --git a/packages/survey/typedoc.json b/packages/survey/typedoc.json new file mode 100644 index 0000000..b8f3931 --- /dev/null +++ b/packages/survey/typedoc.json @@ -0,0 +1,11 @@ +{ + "inputFiles": ["./src"], + "mode": "modules", + "out": "./docs", + "excludeExternals": true, + "excludePrivate": true, + "readme": "README.md", + "exclude": ["./src/data"], + "name": "I Just Crashed My Plane Survey", + "excludeNotDocumented": true +} diff --git a/packages/survey/yarn.lock b/packages/survey/yarn.lock new file mode 100644 index 0000000..68c6459 --- /dev/null +++ b/packages/survey/yarn.lock @@ -0,0 +1,248 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@types/lodash-es@^4.17.3": + version "4.17.3" + resolved "https://registry.yarnpkg.com/@types/lodash-es/-/lodash-es-4.17.3.tgz#87eb0b3673b076b8ee655f1890260a136af09a2d" + integrity sha512-iHI0i7ZAL1qepz1Y7f3EKg/zUMDwDfTzitx+AlHhJJvXwenP682ZyGbgPSc5Ej3eEAKVbNWKFuwOadCj5vBbYQ== + dependencies: + "@types/lodash" "*" + +"@types/lodash@*": + version "4.14.155" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.155.tgz#e2b4514f46a261fd11542e47519c20ebce7bc23a" + integrity sha512-vEcX7S7aPhsBCivxMwAANQburHBtfN9RdyXFk84IJmu2Z4Hkg1tOFgaslRiEqqvoLtbCBi6ika1EMspE+NZ9Lg== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +commander@~2.20.3: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +glob@^7.0.0: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.6, graceful-fs@^4.2.0: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +handlebars@^4.7.6: + version "4.7.6" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.6.tgz#d4c05c1baf90e9945f77aa68a7a219aa4a7df74e" + integrity sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA== + dependencies: + minimist "^1.2.5" + neo-async "^2.6.0" + source-map "^0.6.1" + wordwrap "^1.0.0" + optionalDependencies: + uglify-js "^3.1.4" + +highlight.js@^10.0.0: + version "10.0.3" + resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.0.3.tgz#5effcc58420f113f279a0badb8ac50c4be06e63b" + integrity sha512-9FG7SSzv9yOY5CGGxfI6NDm7xLYtMOjKtPBxw7Zff3t5UcRcUNTGEeS8lNjhceL34KeetLMoGMFTGoaa83HwyQ== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +interpret@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" + integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== + +jsonfile@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss= + optionalDependencies: + graceful-fs "^4.1.6" + +lodash-es@^4.17.15: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash-es/-/lodash-es-4.17.15.tgz#21bd96839354412f23d7a10340e5eac6ee455d78" + integrity sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ== + +lodash@^4.17.15: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + +lunr@^2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.8.tgz#a8b89c31f30b5a044b97d2d28e2da191b6ba2072" + integrity sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg== + +marked@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-1.0.0.tgz#d35784245a04871e5988a491e28867362e941693" + integrity sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng== + +minimatch@^3.0.0, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +neo-async@^2.6.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" + integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-parse@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" + integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== + +progress@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q= + dependencies: + resolve "^1.1.6" + +resolve@^1.1.6: + version "1.17.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== + dependencies: + path-parse "^1.0.6" + +shelljs@^0.8.4: + version "0.8.4" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2" + integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +typedoc-default-themes@^0.10.1: + version "0.10.1" + resolved "https://registry.yarnpkg.com/typedoc-default-themes/-/typedoc-default-themes-0.10.1.tgz#eb27b7d689457c7ec843e47ec0d3e500581296a7" + integrity sha512-SuqAQI0CkwhqSJ2kaVTgl37cWs733uy9UGUqwtcds8pkFK8oRF4rZmCq+FXTGIb9hIUOu40rf5Kojg0Ha6akeg== + dependencies: + lunr "^2.3.8" + +typedoc@^0.17.7: + version "0.17.7" + resolved "https://registry.yarnpkg.com/typedoc/-/typedoc-0.17.7.tgz#70797401140403a5f91589ed3f4f24c03841bf7a" + integrity sha512-PEnzjwQAGjb0O8a6VDE0lxyLAadqNujN5LltsTUhZETolRMiIJv6Ox+Toa8h0XhKHqAOh8MOmB0eBVcWz6nuAw== + dependencies: + fs-extra "^8.1.0" + handlebars "^4.7.6" + highlight.js "^10.0.0" + lodash "^4.17.15" + lunr "^2.3.8" + marked "1.0.0" + minimatch "^3.0.0" + progress "^2.0.3" + shelljs "^0.8.4" + typedoc-default-themes "^0.10.1" + +typescript@~3.9.3: + version "3.9.5" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36" + integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ== + +uglify-js@^3.1.4: + version "3.9.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.9.4.tgz#867402377e043c1fc7b102253a22b64e5862401b" + integrity sha512-8RZBJq5smLOa7KslsNsVcSH+KOXf1uDU8yqLeNuVKwmT0T3FA0ZoXlinQfRad7SDcbZZRZE4ov+2v71EnxNyCA== + dependencies: + commander "~2.20.3" + +universalify@^0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== + +wordwrap@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= diff --git a/Assets.sketch b/packages/web/Assets.sketch similarity index 100% rename from Assets.sketch rename to packages/web/Assets.sketch diff --git a/README.md b/packages/web/README.md similarity index 100% rename from README.md rename to packages/web/README.md diff --git a/babel.config.js b/packages/web/babel.config.js similarity index 100% rename from babel.config.js rename to packages/web/babel.config.js diff --git a/cypress.json b/packages/web/cypress.json similarity index 100% rename from cypress.json rename to packages/web/cypress.json diff --git a/deploy.sh b/packages/web/deploy.sh similarity index 100% rename from deploy.sh rename to packages/web/deploy.sh diff --git a/packages/web/package.json b/packages/web/package.json new file mode 100644 index 0000000..f5a234a --- /dev/null +++ b/packages/web/package.json @@ -0,0 +1,94 @@ +{ + "name": "i-just-crashed-my-plane", + "version": "0.1.0", + "license": "MIT", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "test:unit": "vue-cli-service test:unit", + "test:e2e": "vue-cli-service test:e2e", + "lint": "vue-cli-service lint", + "docs:generate": "npx typedoc --out docs src", + "ci:e2e:start-server": "yarn serve", + "ci:e2e:run": "cypress run --record --key 4985f51e-046b-4590-b6e3-f124c50cc39c", + "ci:e2e": "npx start-server-and-test ci:e2e:start-server 8080 ci:e2e:run", + "ci:unit": "yarn run test:unit" + }, + "dependencies": { + "@bugsnag/js": "^7.1.0", + "@bugsnag/plugin-vue": "^7.1.0", + "cldr-data": "^36.0.0", + "cldrjs": "^0.5.1", + "core-js": "^3.6.5", + "i-just-crashed-my-plane-survey": "^0.1.0", + "lodash-es": "^4.17.15", + "normalize.css": "^8.0.1", + "vue": "^2.6.11", + "vue-class-component": "^7.2.3", + "vue-i18n": "^8.17.7", + "vue-property-decorator": "^8.4.2", + "vuex": "^3.4.0", + "vuex-class": "^0.3.2" + }, + "devDependencies": { + "@cypress/webpack-preprocessor": "^5.4.1", + "@types/chai": "^4.2.11", + "@types/chai-as-promised": "^7.1.2", + "@types/cldrjs": "^0.4.22", + "@types/lodash-es": "^4.17.3", + "@types/mocha": "^7.0.2", + "@typescript-eslint/eslint-plugin": "^3.0.1", + "@typescript-eslint/parser": "^3.0.1", + "@vue/cli-plugin-babel": "~4.3.1", + "@vue/cli-plugin-e2e-cypress": "~4.3.1", + "@vue/cli-plugin-eslint": "~4.3.1", + "@vue/cli-plugin-router": "~4.3.1", + "@vue/cli-plugin-typescript": "^4.3.1", + "@vue/cli-plugin-unit-mocha": "~4.3.1", + "@vue/cli-plugin-vuex": "~4.3.1", + "@vue/cli-service": "~4.3.1", + "@vue/eslint-config-airbnb": "^5.0.2", + "@vue/eslint-config-typescript": "^5.0.2", + "@vue/test-utils": "1.0.3", + "chai": "^4.1.2", + "chai-as-promised": "^7.1.1", + "chai-each": "^0.0.1", + "eslint": "^7.1.0", + "eslint-plugin-chai-expect": "^2.1.0", + "eslint-plugin-chai-friendly": "^0.6.0", + "eslint-plugin-cypress": "^2.10.3", + "eslint-plugin-import": "^2.20.2", + "eslint-plugin-mocha": "^7.0.0", + "eslint-plugin-vue": "^6.2.2", + "lint-staged": "^10.2.6", + "null-loader": "^4.0.0", + "sass": "^1.26.5", + "sass-loader": "^8.0.2", + "start-server-and-test": "^1.11.0", + "stylelint": "^13.5.0", + "stylelint-config-sass-guidelines": "^7.0.0", + "stylelint-config-standard": "^20.0.0", + "stylelint-processor-html": "^1.0.0", + "typedoc": "^0.17.7", + "typescript": "~3.9.3", + "vue-template-compiler": "^2.6.11" + }, + "gitHooks": { + "pre-commit": "lint-staged" + }, + "lint-staged": { + "*.{js,jsx,vue,ts,tsx}": [ + "vue-cli-service lint --fix" + ], + "*.{css,vue}": [ + "npx stylelint --fix" + ], + "*.scss": [ + "npx stylelint --fix --syntax scss" + ], + "*.sass": [ + "npx stylelint --fix --syntax sass" + ] + } +} diff --git a/public/CNAME b/packages/web/public/CNAME similarity index 100% rename from public/CNAME rename to packages/web/public/CNAME diff --git a/public/apple-touch-icon.png b/packages/web/public/apple-touch-icon.png similarity index 100% rename from public/apple-touch-icon.png rename to packages/web/public/apple-touch-icon.png diff --git a/public/favicon.ico b/packages/web/public/favicon.ico similarity index 100% rename from public/favicon.ico rename to packages/web/public/favicon.ico diff --git a/public/icon-pinned-tab.svg b/packages/web/public/icon-pinned-tab.svg similarity index 100% rename from public/icon-pinned-tab.svg rename to packages/web/public/icon-pinned-tab.svg diff --git a/public/index.html b/packages/web/public/index.html similarity index 100% rename from public/index.html rename to packages/web/public/index.html diff --git a/public/robots.txt b/packages/web/public/robots.txt similarity index 100% rename from public/robots.txt rename to packages/web/public/robots.txt diff --git a/src/App.vue b/packages/web/src/App.vue similarity index 100% rename from src/App.vue rename to packages/web/src/App.vue diff --git a/src/assets/fonts/Quicksand-VariableFont_wght.ttf b/packages/web/src/assets/fonts/Quicksand-VariableFont_wght.ttf similarity index 100% rename from src/assets/fonts/Quicksand-VariableFont_wght.ttf rename to packages/web/src/assets/fonts/Quicksand-VariableFont_wght.ttf diff --git a/src/assets/styles/_colors.scss b/packages/web/src/assets/styles/_colors.scss similarity index 100% rename from src/assets/styles/_colors.scss rename to packages/web/src/assets/styles/_colors.scss diff --git a/src/assets/styles/_controls.scss b/packages/web/src/assets/styles/_controls.scss similarity index 100% rename from src/assets/styles/_controls.scss rename to packages/web/src/assets/styles/_controls.scss diff --git a/src/assets/styles/_fonts.scss b/packages/web/src/assets/styles/_fonts.scss similarity index 100% rename from src/assets/styles/_fonts.scss rename to packages/web/src/assets/styles/_fonts.scss diff --git a/src/assets/styles/_responsive.scss b/packages/web/src/assets/styles/_responsive.scss similarity index 100% rename from src/assets/styles/_responsive.scss rename to packages/web/src/assets/styles/_responsive.scss diff --git a/src/assets/styles/font-faces.scss b/packages/web/src/assets/styles/font-faces.scss similarity index 100% rename from src/assets/styles/font-faces.scss rename to packages/web/src/assets/styles/font-faces.scss diff --git a/src/assets/styles/global.scss b/packages/web/src/assets/styles/global.scss similarity index 100% rename from src/assets/styles/global.scss rename to packages/web/src/assets/styles/global.scss diff --git a/src/assets/styles/transitions.scss b/packages/web/src/assets/styles/transitions.scss similarity index 100% rename from src/assets/styles/transitions.scss rename to packages/web/src/assets/styles/transitions.scss diff --git a/src/bus/ErrorBus.ts b/packages/web/src/bus/ErrorBus.ts similarity index 100% rename from src/bus/ErrorBus.ts rename to packages/web/src/bus/ErrorBus.ts diff --git a/src/components/Question/AbstractOption.ts b/packages/web/src/components/Question/AbstractOption.ts similarity index 93% rename from src/components/Question/AbstractOption.ts rename to packages/web/src/components/Question/AbstractOption.ts index 4f55519..cbc704b 100644 --- a/src/components/Question/AbstractOption.ts +++ b/packages/web/src/components/Question/AbstractOption.ts @@ -2,7 +2,7 @@ import Vue from 'vue' import Component from 'vue-class-component' import { Prop } from 'vue-property-decorator' import { TranslateResult } from 'vue-i18n' -import * as Survey from '@/models/survey' +import * as Survey from 'i-just-crashed-my-plane-survey' /** * @abstract diff --git a/src/components/Question/AbstractQuestion.ts b/packages/web/src/components/Question/AbstractQuestion.ts similarity index 96% rename from src/components/Question/AbstractQuestion.ts rename to packages/web/src/components/Question/AbstractQuestion.ts index 68f6e76..5c6d544 100644 --- a/src/components/Question/AbstractQuestion.ts +++ b/packages/web/src/components/Question/AbstractQuestion.ts @@ -4,7 +4,7 @@ import { Prop, Watch } from 'vue-property-decorator' import { Action } from 'vuex-class' import { TranslateResult } from 'vue-i18n' import Prompt from '@/models/response/prompt' -import { Question } from '@/models/survey' +import { Question } from 'i-just-crashed-my-plane-survey' /** * @abstract diff --git a/src/components/Question/Question.vue b/packages/web/src/components/Question/Question.vue similarity index 98% rename from src/components/Question/Question.vue rename to packages/web/src/components/Question/Question.vue index 6ac340a..bb4abb9 100644 --- a/src/components/Question/Question.vue +++ b/packages/web/src/components/Question/Question.vue @@ -45,7 +45,7 @@ import MultiQuestion from './multi/MultiQuestion.vue' import Error from '@/views/Error.vue' import ErrorBus from '@/bus/ErrorBus' - import * as Survey from '@/models/survey' + import * as Survey from 'i-just-crashed-my-plane-survey' /** * Container view that displays either a {@link SingleQuestion} or a {@link MultiQuestion} diff --git a/src/components/Question/multi/Checkmark.vue b/packages/web/src/components/Question/multi/Checkmark.vue similarity index 100% rename from src/components/Question/multi/Checkmark.vue rename to packages/web/src/components/Question/multi/Checkmark.vue diff --git a/src/components/Question/multi/MultiOption.vue b/packages/web/src/components/Question/multi/MultiOption.vue similarity index 100% rename from src/components/Question/multi/MultiOption.vue rename to packages/web/src/components/Question/multi/MultiOption.vue diff --git a/src/components/Question/multi/MultiQuestion.vue b/packages/web/src/components/Question/multi/MultiQuestion.vue similarity index 98% rename from src/components/Question/multi/MultiQuestion.vue rename to packages/web/src/components/Question/multi/MultiQuestion.vue index 3b590f2..9c7fdee 100644 --- a/src/components/Question/multi/MultiQuestion.vue +++ b/packages/web/src/components/Question/multi/MultiQuestion.vue @@ -38,7 +38,7 @@ import MultiOption from '@/components/Question/multi/MultiOption.vue' import AbstractQuestion from '@/components/Question/AbstractQuestion' import ErrorBus from '@/bus/ErrorBus' - import { Flag, Option } from '@/models/survey' + import { Flag, Option } from 'i-just-crashed-my-plane-survey' import OptionCategory from '@/components/Question/multi/OptionCategory.vue' /** diff --git a/src/components/Question/multi/OptionCategory.vue b/packages/web/src/components/Question/multi/OptionCategory.vue similarity index 98% rename from src/components/Question/multi/OptionCategory.vue rename to packages/web/src/components/Question/multi/OptionCategory.vue index 1e28b7b..beed221 100644 --- a/src/components/Question/multi/OptionCategory.vue +++ b/packages/web/src/components/Question/multi/OptionCategory.vue @@ -21,7 +21,7 @@ import { TranslateResult } from 'vue-i18n' import { isNil } from 'lodash-es' import MultiOption from './MultiOption.vue' - import { Option } from '@/models/survey' + import { Option } from 'i-just-crashed-my-plane-survey' /** * A category of {@link Option}s to display as part of a {@link MultiQuestion}. Categories can diff --git a/src/components/Question/single/SingleOption.vue b/packages/web/src/components/Question/single/SingleOption.vue similarity index 100% rename from src/components/Question/single/SingleOption.vue rename to packages/web/src/components/Question/single/SingleOption.vue diff --git a/src/components/Question/single/SingleQuestion.vue b/packages/web/src/components/Question/single/SingleQuestion.vue similarity index 100% rename from src/components/Question/single/SingleQuestion.vue rename to packages/web/src/components/Question/single/SingleQuestion.vue diff --git a/src/config/bugsnag.ts b/packages/web/src/config/bugsnag.ts similarity index 100% rename from src/config/bugsnag.ts rename to packages/web/src/config/bugsnag.ts diff --git a/src/i18n/functions.ts b/packages/web/src/i18n/functions.ts similarity index 100% rename from src/i18n/functions.ts rename to packages/web/src/i18n/functions.ts diff --git a/src/i18n/index.ts b/packages/web/src/i18n/index.ts similarity index 100% rename from src/i18n/index.ts rename to packages/web/src/i18n/index.ts diff --git a/src/i18n/strings/en/index.ts b/packages/web/src/i18n/strings/en/index.ts similarity index 100% rename from src/i18n/strings/en/index.ts rename to packages/web/src/i18n/strings/en/index.ts diff --git a/src/i18n/strings/en/survey/incident/categories.ts b/packages/web/src/i18n/strings/en/survey/incident/categories.ts similarity index 100% rename from src/i18n/strings/en/survey/incident/categories.ts rename to packages/web/src/i18n/strings/en/survey/incident/categories.ts diff --git a/src/i18n/strings/en/survey/incident/index.ts b/packages/web/src/i18n/strings/en/survey/incident/index.ts similarity index 100% rename from src/i18n/strings/en/survey/incident/index.ts rename to packages/web/src/i18n/strings/en/survey/incident/index.ts diff --git a/src/i18n/strings/en/survey/incident/notes.ts b/packages/web/src/i18n/strings/en/survey/incident/notes.ts similarity index 100% rename from src/i18n/strings/en/survey/incident/notes.ts rename to packages/web/src/i18n/strings/en/survey/incident/notes.ts diff --git a/src/i18n/strings/en/survey/incident/options.ts b/packages/web/src/i18n/strings/en/survey/incident/options.ts similarity index 100% rename from src/i18n/strings/en/survey/incident/options.ts rename to packages/web/src/i18n/strings/en/survey/incident/options.ts diff --git a/src/i18n/strings/en/survey/incident/questions.ts b/packages/web/src/i18n/strings/en/survey/incident/questions.ts similarity index 100% rename from src/i18n/strings/en/survey/incident/questions.ts rename to packages/web/src/i18n/strings/en/survey/incident/questions.ts diff --git a/src/i18n/strings/en/survey/incident/subtitles.ts b/packages/web/src/i18n/strings/en/survey/incident/subtitles.ts similarity index 100% rename from src/i18n/strings/en/survey/incident/subtitles.ts rename to packages/web/src/i18n/strings/en/survey/incident/subtitles.ts diff --git a/src/i18n/strings/en/survey/index.ts b/packages/web/src/i18n/strings/en/survey/index.ts similarity index 100% rename from src/i18n/strings/en/survey/index.ts rename to packages/web/src/i18n/strings/en/survey/index.ts diff --git a/src/i18n/strings/en/survey/profile/index.ts b/packages/web/src/i18n/strings/en/survey/profile/index.ts similarity index 100% rename from src/i18n/strings/en/survey/profile/index.ts rename to packages/web/src/i18n/strings/en/survey/profile/index.ts diff --git a/src/main.ts b/packages/web/src/main.ts similarity index 100% rename from src/main.ts rename to packages/web/src/main.ts diff --git a/src/models/response/answer.ts b/packages/web/src/models/response/answer.ts similarity index 100% rename from src/models/response/answer.ts rename to packages/web/src/models/response/answer.ts diff --git a/src/models/response/index.ts b/packages/web/src/models/response/index.ts similarity index 98% rename from src/models/response/index.ts rename to packages/web/src/models/response/index.ts index 655b564..5ed7b01 100644 --- a/src/models/response/index.ts +++ b/packages/web/src/models/response/index.ts @@ -3,13 +3,12 @@ import { isArray, isNull, isString, isUndefined, last, nth } from 'lodash-es' -import Survey, { +import { Action, Flag, FlagAction, HIGHEST_INCIDENT_LEVEL, - IncidentLevel, LevelAction, Option, Question, SurveyNode -} from '@/models/survey' -import surveys from '@/data/surveys' + IncidentLevel, LevelAction, Option, Question, Survey, surveys, SurveyNode +} from 'i-just-crashed-my-plane-survey' import { EndNode, endNode, diff --git a/src/models/response/prompt.ts b/packages/web/src/models/response/prompt.ts similarity index 96% rename from src/models/response/prompt.ts rename to packages/web/src/models/response/prompt.ts index 30bdf55..def0d24 100644 --- a/src/models/response/prompt.ts +++ b/packages/web/src/models/response/prompt.ts @@ -1,6 +1,6 @@ import { Option, Question, SurveyNode -} from '@/models/survey' +} from 'i-just-crashed-my-plane-survey' /** * A Question to ask the user, along with the contextual information about that question needed to diff --git a/src/models/response/stackTraverser.ts b/packages/web/src/models/response/stackTraverser.ts similarity index 97% rename from src/models/response/stackTraverser.ts rename to packages/web/src/models/response/stackTraverser.ts index 9a202d0..df63b65 100644 --- a/src/models/response/stackTraverser.ts +++ b/packages/web/src/models/response/stackTraverser.ts @@ -1,6 +1,6 @@ /* eslint-disable import/no-cycle */ -import { SurveyNode } from '@/models/survey' +import { SurveyNode } from 'i-just-crashed-my-plane-survey' import Response from '@/models/response/index' import ResponseTraverser, { CurrentResponseNode } from '@/models/response/traverser' diff --git a/src/models/response/traverser.ts b/packages/web/src/models/response/traverser.ts similarity index 98% rename from src/models/response/traverser.ts rename to packages/web/src/models/response/traverser.ts index 5c3f058..525d684 100644 --- a/src/models/response/traverser.ts +++ b/packages/web/src/models/response/traverser.ts @@ -3,12 +3,11 @@ import { isPlainObject } from 'lodash-es' import Response from '@/models/response/index' import { - Action, Option, Question -} from '@/models/survey' + Action, Option, Question, SurveyTraverser +} from 'i-just-crashed-my-plane-survey' import { ResponseNode, endNode, isActionResponseNode, isQuestionResponseNode } from '@/models/response/answer' -import SurveyTraverser from '@/models/survey/traverser' export type BeyondEndNode = 'beyondEndNode' export const beyondEndNode: BeyondEndNode = 'beyondEndNode' diff --git a/src/shims-tsx.d.ts b/packages/web/src/shims-tsx.d.ts similarity index 100% rename from src/shims-tsx.d.ts rename to packages/web/src/shims-tsx.d.ts diff --git a/src/shims-vue.d.ts b/packages/web/src/shims-vue.d.ts similarity index 100% rename from src/shims-vue.d.ts rename to packages/web/src/shims-vue.d.ts diff --git a/src/store/index.ts b/packages/web/src/store/index.ts similarity index 100% rename from src/store/index.ts rename to packages/web/src/store/index.ts diff --git a/src/store/root.ts b/packages/web/src/store/root.ts similarity index 97% rename from src/store/root.ts rename to packages/web/src/store/root.ts index 31776f3..8089fea 100644 --- a/src/store/root.ts +++ b/packages/web/src/store/root.ts @@ -4,10 +4,9 @@ import { ActionContext, Module } from 'vuex' import { assign, cloneDeep, isNil, max, reduce, values } from 'lodash-es' +import { Flag, IncidentLevel, surveyOrder } from 'i-just-crashed-my-plane-survey' import Response from '@/models/response' -import { Flag, IncidentLevel } from '@/models/survey' import { endNode, QuestionResponseNode, walkResponseTree } from '@/models/response/answer' -import surveyOrder from '@/data/surveyOrder' /** The object type of the root Vuex state. */ diff --git a/src/views/Container.vue b/packages/web/src/views/Container.vue similarity index 97% rename from src/views/Container.vue rename to packages/web/src/views/Container.vue index 247766f..77a06d5 100644 --- a/src/views/Container.vue +++ b/packages/web/src/views/Container.vue @@ -13,8 +13,8 @@ import Component from 'vue-class-component' import { Getter } from 'vuex-class' import { find, isNil } from 'lodash-es' + import { surveyOrder } from 'i-just-crashed-my-plane-survey' import Welcome from '@/views/Welcome.vue' - import surveyOrder from '@/data/surveyOrder' import Response from '@/models/response' import Finished from '@/views/Finished.vue' import Prompt from '@/models/response/prompt' diff --git a/src/views/Error.vue b/packages/web/src/views/Error.vue similarity index 100% rename from src/views/Error.vue rename to packages/web/src/views/Error.vue diff --git a/src/views/Finished.vue b/packages/web/src/views/Finished.vue similarity index 97% rename from src/views/Finished.vue rename to packages/web/src/views/Finished.vue index 64e0c83..7e59990 100644 --- a/src/views/Finished.vue +++ b/packages/web/src/views/Finished.vue @@ -16,7 +16,7 @@ import Vue from 'vue' import Component from 'vue-class-component' import { Getter } from 'vuex-class' - import { IncidentLevel } from '@/models/survey' + import { IncidentLevel } from 'i-just-crashed-my-plane-survey' import Accident from '@/views/Finished/Accident.vue' import SeriousIncident from '@/views/Finished/SeriousIncident.vue' import Incident from '@/views/Finished/Incident.vue' diff --git a/src/views/Finished/Accident.vue b/packages/web/src/views/Finished/Accident.vue similarity index 100% rename from src/views/Finished/Accident.vue rename to packages/web/src/views/Finished/Accident.vue diff --git a/src/views/Finished/Incident.vue b/packages/web/src/views/Finished/Incident.vue similarity index 100% rename from src/views/Finished/Incident.vue rename to packages/web/src/views/Finished/Incident.vue diff --git a/src/views/Finished/SeriousIncident.vue b/packages/web/src/views/Finished/SeriousIncident.vue similarity index 100% rename from src/views/Finished/SeriousIncident.vue rename to packages/web/src/views/Finished/SeriousIncident.vue diff --git a/src/views/Welcome.vue b/packages/web/src/views/Welcome.vue similarity index 100% rename from src/views/Welcome.vue rename to packages/web/src/views/Welcome.vue diff --git a/tests/e2e/.eslintrc.js b/packages/web/tests/e2e/.eslintrc.js similarity index 100% rename from tests/e2e/.eslintrc.js rename to packages/web/tests/e2e/.eslintrc.js diff --git a/tests/e2e/plugins/index.js b/packages/web/tests/e2e/plugins/index.js similarity index 100% rename from tests/e2e/plugins/index.js rename to packages/web/tests/e2e/plugins/index.js diff --git a/tests/e2e/specs/answerFlows.ts b/packages/web/tests/e2e/specs/answerFlows.ts similarity index 100% rename from tests/e2e/specs/answerFlows.ts rename to packages/web/tests/e2e/specs/answerFlows.ts diff --git a/tests/e2e/support/commands.js b/packages/web/tests/e2e/support/commands.js similarity index 100% rename from tests/e2e/support/commands.js rename to packages/web/tests/e2e/support/commands.js diff --git a/tests/e2e/support/index.d.ts b/packages/web/tests/e2e/support/index.d.ts similarity index 100% rename from tests/e2e/support/index.d.ts rename to packages/web/tests/e2e/support/index.d.ts diff --git a/tests/e2e/support/index.js b/packages/web/tests/e2e/support/index.js similarity index 100% rename from tests/e2e/support/index.js rename to packages/web/tests/e2e/support/index.js diff --git a/tests/e2e/support/runResponse.ts b/packages/web/tests/e2e/support/runResponse.ts similarity index 100% rename from tests/e2e/support/runResponse.ts rename to packages/web/tests/e2e/support/runResponse.ts diff --git a/tests/e2e/tsconfig.json b/packages/web/tests/e2e/tsconfig.json similarity index 100% rename from tests/e2e/tsconfig.json rename to packages/web/tests/e2e/tsconfig.json diff --git a/tests/unit/.eslintrc.js b/packages/web/tests/unit/.eslintrc.js similarity index 100% rename from tests/unit/.eslintrc.js rename to packages/web/tests/unit/.eslintrc.js diff --git a/tests/unit/i18n/functions.spec.ts b/packages/web/tests/unit/i18n/functions.spec.ts similarity index 100% rename from tests/unit/i18n/functions.spec.ts rename to packages/web/tests/unit/i18n/functions.spec.ts diff --git a/tests/unit/response/fixtures.ts b/packages/web/tests/unit/response/fixtures.ts similarity index 100% rename from tests/unit/response/fixtures.ts rename to packages/web/tests/unit/response/fixtures.ts diff --git a/tests/unit/response/index.spec.ts b/packages/web/tests/unit/response/index.spec.ts similarity index 98% rename from tests/unit/response/index.spec.ts rename to packages/web/tests/unit/response/index.spec.ts index 8d9604a..f4d2103 100644 --- a/tests/unit/response/index.spec.ts +++ b/packages/web/tests/unit/response/index.spec.ts @@ -8,7 +8,7 @@ import { unfinishedAnswerEndingInSingleQuestion } from './fixtures' import Response from '@/models/response' -import { Flag, IncidentLevel, Question } from '@/models/survey' +import { Flag, IncidentLevel, Question } from 'i-just-crashed-my-plane-survey' import { ResponseNode, endNode, QuestionResponseNode } from '@/models/response/answer' describe('Response', () => { diff --git a/tests/unit/response/node.spec.ts b/packages/web/tests/unit/response/node.spec.ts similarity index 100% rename from tests/unit/response/node.spec.ts rename to packages/web/tests/unit/response/node.spec.ts diff --git a/tests/unit/response/prompt.spec.ts b/packages/web/tests/unit/response/prompt.spec.ts similarity index 85% rename from tests/unit/response/prompt.spec.ts rename to packages/web/tests/unit/response/prompt.spec.ts index ba29ce5..3902e02 100644 --- a/tests/unit/response/prompt.spec.ts +++ b/packages/web/tests/unit/response/prompt.spec.ts @@ -1,6 +1,5 @@ import { expect } from 'chai' -import incidentSurvey from '@/data/surveys/incident' -import { QuestionAction } from '@/models/survey' +import { incidentSurvey, QuestionAction } from 'i-just-crashed-my-plane-survey' import { answerPathFromQuestionPath } from '@/models/response/prompt' describe('answerPathFromQuestionPath', () => { diff --git a/tests/unit/store/index.spec.ts b/packages/web/tests/unit/store/index.spec.ts similarity index 100% rename from tests/unit/store/index.spec.ts rename to packages/web/tests/unit/store/index.spec.ts diff --git a/tests/unit/support.ts b/packages/web/tests/unit/support.ts similarity index 100% rename from tests/unit/support.ts rename to packages/web/tests/unit/support.ts diff --git a/tsconfig.json b/packages/web/tsconfig.json similarity index 100% rename from tsconfig.json rename to packages/web/tsconfig.json diff --git a/typedoc.json b/packages/web/typedoc.json similarity index 100% rename from typedoc.json rename to packages/web/typedoc.json diff --git a/vue.config.js b/packages/web/vue.config.js similarity index 100% rename from vue.config.js rename to packages/web/vue.config.js diff --git a/yarn.lock b/packages/web/yarn.lock similarity index 100% rename from yarn.lock rename to packages/web/yarn.lock