@forsakringskassan/docs-generator 2.15.6 → 2.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var require$$0 = require('@vue/compiler-sfc');
4
- require('./vendor-Bxk8vVJ2.js');
4
+ require('./vendor-BeoVq2Sv.js');
5
5
 
6
6
  var __create = Object.create;
7
7
  var __defProp = Object.defineProperty;
@@ -1342,9 +1342,7 @@ var require_wrap_for_optimizing = __commonJS({
1342
1342
  BACKSLASH: "\\",
1343
1343
  BANG: "!",
1344
1344
  BANG_SUFFIX_PATTERN: /!\w+$/,
1345
- IMPORTANT_TOKEN: "!important",
1346
1345
  IMPORTANT_TOKEN_PATTERN: new RegExp("!important$", "i"),
1347
- IMPORTANT_WORD: "important",
1348
1346
  IMPORTANT_WORD_PATTERN: new RegExp("important$", "i"),
1349
1347
  SUFFIX_BANG_PATTERN: /!$/,
1350
1348
  UNDERSCORE: "_",
@@ -5841,11 +5839,8 @@ var require_specificity = __commonJS({
5841
5839
  "../../node_modules/clean-css/lib/optimizer/level-2/specificity.js"(exports, module) {
5842
5840
  var Marker = require_marker();
5843
5841
  var Selector = {
5844
- ADJACENT_SIBLING: "+",
5845
- DESCENDANT: ">",
5846
5842
  DOT: ".",
5847
5843
  HASH: "#",
5848
- NON_ADJACENT_SIBLING: "~",
5849
5844
  PSEUDO: ":"
5850
5845
  };
5851
5846
  var LETTER_PATTERN = /[a-zA-Z]/;
@@ -12748,15 +12743,472 @@ var require_dist = __commonJS({
12748
12743
  module.exports = vuePlugin;
12749
12744
  }
12750
12745
  });
12746
+ var require_vendors = __commonJS({
12747
+ "../../node_modules/is-ci/node_modules/ci-info/vendors.json"(exports, module) {
12748
+ module.exports = [
12749
+ {
12750
+ name: "Agola CI",
12751
+ constant: "AGOLA",
12752
+ env: "AGOLA_GIT_REF",
12753
+ pr: "AGOLA_PULL_REQUEST_ID"
12754
+ },
12755
+ {
12756
+ name: "Appcircle",
12757
+ constant: "APPCIRCLE",
12758
+ env: "AC_APPCIRCLE",
12759
+ pr: {
12760
+ env: "AC_GIT_PR",
12761
+ ne: "false"
12762
+ }
12763
+ },
12764
+ {
12765
+ name: "AppVeyor",
12766
+ constant: "APPVEYOR",
12767
+ env: "APPVEYOR",
12768
+ pr: "APPVEYOR_PULL_REQUEST_NUMBER"
12769
+ },
12770
+ {
12771
+ name: "AWS CodeBuild",
12772
+ constant: "CODEBUILD",
12773
+ env: "CODEBUILD_BUILD_ARN",
12774
+ pr: {
12775
+ env: "CODEBUILD_WEBHOOK_EVENT",
12776
+ any: [
12777
+ "PULL_REQUEST_CREATED",
12778
+ "PULL_REQUEST_UPDATED",
12779
+ "PULL_REQUEST_REOPENED"
12780
+ ]
12781
+ }
12782
+ },
12783
+ {
12784
+ name: "Azure Pipelines",
12785
+ constant: "AZURE_PIPELINES",
12786
+ env: "TF_BUILD",
12787
+ pr: {
12788
+ BUILD_REASON: "PullRequest"
12789
+ }
12790
+ },
12791
+ {
12792
+ name: "Bamboo",
12793
+ constant: "BAMBOO",
12794
+ env: "bamboo_planKey"
12795
+ },
12796
+ {
12797
+ name: "Bitbucket Pipelines",
12798
+ constant: "BITBUCKET",
12799
+ env: "BITBUCKET_COMMIT",
12800
+ pr: "BITBUCKET_PR_ID"
12801
+ },
12802
+ {
12803
+ name: "Bitrise",
12804
+ constant: "BITRISE",
12805
+ env: "BITRISE_IO",
12806
+ pr: "BITRISE_PULL_REQUEST"
12807
+ },
12808
+ {
12809
+ name: "Buddy",
12810
+ constant: "BUDDY",
12811
+ env: "BUDDY_WORKSPACE_ID",
12812
+ pr: "BUDDY_EXECUTION_PULL_REQUEST_ID"
12813
+ },
12814
+ {
12815
+ name: "Buildkite",
12816
+ constant: "BUILDKITE",
12817
+ env: "BUILDKITE",
12818
+ pr: {
12819
+ env: "BUILDKITE_PULL_REQUEST",
12820
+ ne: "false"
12821
+ }
12822
+ },
12823
+ {
12824
+ name: "CircleCI",
12825
+ constant: "CIRCLE",
12826
+ env: "CIRCLECI",
12827
+ pr: "CIRCLE_PULL_REQUEST"
12828
+ },
12829
+ {
12830
+ name: "Cirrus CI",
12831
+ constant: "CIRRUS",
12832
+ env: "CIRRUS_CI",
12833
+ pr: "CIRRUS_PR"
12834
+ },
12835
+ {
12836
+ name: "Codefresh",
12837
+ constant: "CODEFRESH",
12838
+ env: "CF_BUILD_ID",
12839
+ pr: {
12840
+ any: [
12841
+ "CF_PULL_REQUEST_NUMBER",
12842
+ "CF_PULL_REQUEST_ID"
12843
+ ]
12844
+ }
12845
+ },
12846
+ {
12847
+ name: "Codemagic",
12848
+ constant: "CODEMAGIC",
12849
+ env: "CM_BUILD_ID",
12850
+ pr: "CM_PULL_REQUEST"
12851
+ },
12852
+ {
12853
+ name: "Codeship",
12854
+ constant: "CODESHIP",
12855
+ env: {
12856
+ CI_NAME: "codeship"
12857
+ }
12858
+ },
12859
+ {
12860
+ name: "Drone",
12861
+ constant: "DRONE",
12862
+ env: "DRONE",
12863
+ pr: {
12864
+ DRONE_BUILD_EVENT: "pull_request"
12865
+ }
12866
+ },
12867
+ {
12868
+ name: "dsari",
12869
+ constant: "DSARI",
12870
+ env: "DSARI"
12871
+ },
12872
+ {
12873
+ name: "Earthly",
12874
+ constant: "EARTHLY",
12875
+ env: "EARTHLY_CI"
12876
+ },
12877
+ {
12878
+ name: "Expo Application Services",
12879
+ constant: "EAS",
12880
+ env: "EAS_BUILD"
12881
+ },
12882
+ {
12883
+ name: "Gerrit",
12884
+ constant: "GERRIT",
12885
+ env: "GERRIT_PROJECT"
12886
+ },
12887
+ {
12888
+ name: "Gitea Actions",
12889
+ constant: "GITEA_ACTIONS",
12890
+ env: "GITEA_ACTIONS"
12891
+ },
12892
+ {
12893
+ name: "GitHub Actions",
12894
+ constant: "GITHUB_ACTIONS",
12895
+ env: "GITHUB_ACTIONS",
12896
+ pr: {
12897
+ GITHUB_EVENT_NAME: "pull_request"
12898
+ }
12899
+ },
12900
+ {
12901
+ name: "GitLab CI",
12902
+ constant: "GITLAB",
12903
+ env: "GITLAB_CI",
12904
+ pr: "CI_MERGE_REQUEST_ID"
12905
+ },
12906
+ {
12907
+ name: "GoCD",
12908
+ constant: "GOCD",
12909
+ env: "GO_PIPELINE_LABEL"
12910
+ },
12911
+ {
12912
+ name: "Google Cloud Build",
12913
+ constant: "GOOGLE_CLOUD_BUILD",
12914
+ env: "BUILDER_OUTPUT"
12915
+ },
12916
+ {
12917
+ name: "Harness CI",
12918
+ constant: "HARNESS",
12919
+ env: "HARNESS_BUILD_ID"
12920
+ },
12921
+ {
12922
+ name: "Heroku",
12923
+ constant: "HEROKU",
12924
+ env: {
12925
+ env: "NODE",
12926
+ includes: "/app/.heroku/node/bin/node"
12927
+ }
12928
+ },
12929
+ {
12930
+ name: "Hudson",
12931
+ constant: "HUDSON",
12932
+ env: "HUDSON_URL"
12933
+ },
12934
+ {
12935
+ name: "Jenkins",
12936
+ constant: "JENKINS",
12937
+ env: [
12938
+ "JENKINS_URL",
12939
+ "BUILD_ID"
12940
+ ],
12941
+ pr: {
12942
+ any: [
12943
+ "ghprbPullId",
12944
+ "CHANGE_ID"
12945
+ ]
12946
+ }
12947
+ },
12948
+ {
12949
+ name: "LayerCI",
12950
+ constant: "LAYERCI",
12951
+ env: "LAYERCI",
12952
+ pr: "LAYERCI_PULL_REQUEST"
12953
+ },
12954
+ {
12955
+ name: "Magnum CI",
12956
+ constant: "MAGNUM",
12957
+ env: "MAGNUM"
12958
+ },
12959
+ {
12960
+ name: "Netlify CI",
12961
+ constant: "NETLIFY",
12962
+ env: "NETLIFY",
12963
+ pr: {
12964
+ env: "PULL_REQUEST",
12965
+ ne: "false"
12966
+ }
12967
+ },
12968
+ {
12969
+ name: "Nevercode",
12970
+ constant: "NEVERCODE",
12971
+ env: "NEVERCODE",
12972
+ pr: {
12973
+ env: "NEVERCODE_PULL_REQUEST",
12974
+ ne: "false"
12975
+ }
12976
+ },
12977
+ {
12978
+ name: "Prow",
12979
+ constant: "PROW",
12980
+ env: "PROW_JOB_ID"
12981
+ },
12982
+ {
12983
+ name: "ReleaseHub",
12984
+ constant: "RELEASEHUB",
12985
+ env: "RELEASE_BUILD_ID"
12986
+ },
12987
+ {
12988
+ name: "Render",
12989
+ constant: "RENDER",
12990
+ env: "RENDER",
12991
+ pr: {
12992
+ IS_PULL_REQUEST: "true"
12993
+ }
12994
+ },
12995
+ {
12996
+ name: "Sail CI",
12997
+ constant: "SAIL",
12998
+ env: "SAILCI",
12999
+ pr: "SAIL_PULL_REQUEST_NUMBER"
13000
+ },
13001
+ {
13002
+ name: "Screwdriver",
13003
+ constant: "SCREWDRIVER",
13004
+ env: "SCREWDRIVER",
13005
+ pr: {
13006
+ env: "SD_PULL_REQUEST",
13007
+ ne: "false"
13008
+ }
13009
+ },
13010
+ {
13011
+ name: "Semaphore",
13012
+ constant: "SEMAPHORE",
13013
+ env: "SEMAPHORE",
13014
+ pr: "PULL_REQUEST_NUMBER"
13015
+ },
13016
+ {
13017
+ name: "Sourcehut",
13018
+ constant: "SOURCEHUT",
13019
+ env: {
13020
+ CI_NAME: "sourcehut"
13021
+ }
13022
+ },
13023
+ {
13024
+ name: "Strider CD",
13025
+ constant: "STRIDER",
13026
+ env: "STRIDER"
13027
+ },
13028
+ {
13029
+ name: "TaskCluster",
13030
+ constant: "TASKCLUSTER",
13031
+ env: [
13032
+ "TASK_ID",
13033
+ "RUN_ID"
13034
+ ]
13035
+ },
13036
+ {
13037
+ name: "TeamCity",
13038
+ constant: "TEAMCITY",
13039
+ env: "TEAMCITY_VERSION"
13040
+ },
13041
+ {
13042
+ name: "Travis CI",
13043
+ constant: "TRAVIS",
13044
+ env: "TRAVIS",
13045
+ pr: {
13046
+ env: "TRAVIS_PULL_REQUEST",
13047
+ ne: "false"
13048
+ }
13049
+ },
13050
+ {
13051
+ name: "Vela",
13052
+ constant: "VELA",
13053
+ env: "VELA",
13054
+ pr: {
13055
+ VELA_PULL_REQUEST: "1"
13056
+ }
13057
+ },
13058
+ {
13059
+ name: "Vercel",
13060
+ constant: "VERCEL",
13061
+ env: {
13062
+ any: [
13063
+ "NOW_BUILDER",
13064
+ "VERCEL"
13065
+ ]
13066
+ },
13067
+ pr: "VERCEL_GIT_PULL_REQUEST_ID"
13068
+ },
13069
+ {
13070
+ name: "Visual Studio App Center",
13071
+ constant: "APPCENTER",
13072
+ env: "APPCENTER_BUILD_ID"
13073
+ },
13074
+ {
13075
+ name: "Woodpecker",
13076
+ constant: "WOODPECKER",
13077
+ env: {
13078
+ CI: "woodpecker"
13079
+ },
13080
+ pr: {
13081
+ CI_BUILD_EVENT: "pull_request"
13082
+ }
13083
+ },
13084
+ {
13085
+ name: "Xcode Cloud",
13086
+ constant: "XCODE_CLOUD",
13087
+ env: "CI_XCODE_PROJECT",
13088
+ pr: "CI_PULL_REQUEST_NUMBER"
13089
+ },
13090
+ {
13091
+ name: "Xcode Server",
13092
+ constant: "XCODE_SERVER",
13093
+ env: "XCS"
13094
+ }
13095
+ ];
13096
+ }
13097
+ });
13098
+ var require_ci_info = __commonJS({
13099
+ "../../node_modules/is-ci/node_modules/ci-info/index.js"(exports) {
13100
+ var vendors = require_vendors();
13101
+ var env = process.env;
13102
+ Object.defineProperty(exports, "_vendors", {
13103
+ value: vendors.map(function(v) {
13104
+ return v.constant;
13105
+ })
13106
+ });
13107
+ exports.name = null;
13108
+ exports.isPR = null;
13109
+ exports.id = null;
13110
+ vendors.forEach(function(vendor) {
13111
+ const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env];
13112
+ const isCI2 = envs.every(function(obj) {
13113
+ return checkEnv(obj);
13114
+ });
13115
+ exports[vendor.constant] = isCI2;
13116
+ if (!isCI2) {
13117
+ return;
13118
+ }
13119
+ exports.name = vendor.name;
13120
+ exports.isPR = checkPR(vendor);
13121
+ exports.id = vendor.constant;
13122
+ });
13123
+ exports.isCI = !!(env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
13124
+ (env.BUILD_ID || // Jenkins, Cloudbees
13125
+ env.BUILD_NUMBER || // Jenkins, TeamCity
13126
+ env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
13127
+ env.CI_APP_ID || // Appflow
13128
+ env.CI_BUILD_ID || // Appflow
13129
+ env.CI_BUILD_NUMBER || // Appflow
13130
+ env.CI_NAME || // Codeship and others
13131
+ env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
13132
+ env.RUN_ID || // TaskCluster, dsari
13133
+ exports.name || false));
13134
+ function checkEnv(obj) {
13135
+ if (typeof obj === "string") return !!env[obj];
13136
+ if ("env" in obj) {
13137
+ return env[obj.env] && env[obj.env].includes(obj.includes);
13138
+ }
13139
+ if ("any" in obj) {
13140
+ return obj.any.some(function(k) {
13141
+ return !!env[k];
13142
+ });
13143
+ }
13144
+ return Object.keys(obj).every(function(k) {
13145
+ return env[k] === obj[k];
13146
+ });
13147
+ }
13148
+ function checkPR(vendor) {
13149
+ switch (typeof vendor.pr) {
13150
+ case "string":
13151
+ return !!env[vendor.pr];
13152
+ case "object":
13153
+ if ("env" in vendor.pr) {
13154
+ if ("any" in vendor.pr) {
13155
+ return vendor.pr.any.some(function(key) {
13156
+ return env[vendor.pr.env] === key;
13157
+ });
13158
+ } else {
13159
+ return vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne;
13160
+ }
13161
+ } else if ("any" in vendor.pr) {
13162
+ return vendor.pr.any.some(function(key) {
13163
+ return !!env[key];
13164
+ });
13165
+ } else {
13166
+ return checkEnv(vendor.pr);
13167
+ }
13168
+ default:
13169
+ return null;
13170
+ }
13171
+ }
13172
+ }
13173
+ });
13174
+ var require_is_ci = __commonJS({
13175
+ "../../node_modules/is-ci/index.js"(exports, module) {
13176
+ module.exports = require_ci_info().isCI;
13177
+ }
13178
+ });
12751
13179
  var import_esbuild_plugin_vue3 = __toESM(require_dist());
13180
+ var import_is_ci = __toESM(require_is_ci());
13181
+ var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
13182
+ var HTML_REPLACEMENTS = {
13183
+ "&": "&amp;",
13184
+ "<": "&lt;",
13185
+ ">": "&gt;",
13186
+ '"': "&quot;"
13187
+ };
13188
+ function escapeHtml(str) {
13189
+ return str.replace(HTML_ESCAPE_REPLACE_RE, (ch) => HTML_REPLACEMENTS[ch]);
13190
+ }
12752
13191
  function generateCode(options) {
12753
13192
  const { slug, fingerprint, code, filename, setupPath } = options;
12754
13193
  const selector = `#${slug}`;
12755
13194
  const asset = `${slug}-${fingerprint}.js`;
12756
13195
  const { descriptor, errors } = require$$0.parse(code, { filename });
12757
13196
  const scopeId = `data-v-${fingerprint}`;
12758
- if (errors.length) {
12759
- throw new Error(`Errors occured when trying to parse ${filename}.`);
13197
+ if (errors.length > 0) {
13198
+ if (import_is_ci.default) {
13199
+ const first = errors[0].message;
13200
+ throw new Error(
13201
+ `Errors occurred when trying to parse "${filename}": ${first}`
13202
+ );
13203
+ }
13204
+ const lines = errors.map((it) => ` ${it.message}`);
13205
+ const escaped = lines.map(escapeHtml);
13206
+ return {
13207
+ markup: `<strong style="color: red">Vue compiler error</strong>:<br><pre>${escaped.join("\n")}</pre>`,
13208
+ sourcecode: `Vue compiler error:
13209
+ ${lines.join("\n")}`,
13210
+ output: false
13211
+ };
12760
13212
  }
12761
13213
  const hasScoped = descriptor.styles.some((e) => e.scoped);
12762
13214
  const styleContent = descriptor.styles.map((stylePart) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forsakringskassan/docs-generator",
3
- "version": "2.15.6",
3
+ "version": "2.16.0",
4
4
  "description": "Documentation generator",
5
5
  "keywords": [
6
6
  "documentation"
@@ -53,6 +53,7 @@
53
53
  "test": "jest"
54
54
  },
55
55
  "dependencies": {
56
+ "@babel/code-frame": "^7.0.0",
56
57
  "livereload-js": "4.0.2",
57
58
  "nunjucks": "3.2.4",
58
59
  "piscina": "4.8.0",