Skip to content

Commit

Permalink
🐛 fix release?
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath committed May 15, 2024
1 parent 95b2bce commit 4eb9c8e
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 21 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ jobs:
node-version: 'lts/*'
- name: Install dependencies
run: yarn install
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
run: npm audit signatures
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
48 changes: 34 additions & 14 deletions custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,51 +138,70 @@
"members": [
{
"kind": "field",
"name": "_stylesGenerate"
"name": "_stylesGenerate",
"description": "Generates a `style` tag with variable component styles",
"privacy": "private"
},
{
"kind": "field",
"name": "_resumeSection"
"name": "_resumeSection",
"description": "Returns a section of a resume",
"parameters": [
{
"description": "name of a JSON Resume section",
"name": "section",
"type": {
"text": "string"
}
},
{
"description": "content for that section only",
"name": "content",
"type": {
"text": "object"
}
}
],
"privacy": "private"
},
{
"kind": "field",
"name": "_resumeGenerate",
"description": "Generate the resume HTML with the <style> element",
"parameters": [
{
"name": "resumejson",
"type": {
"text": "*"
"text": "ResumeJson"
}
}
],
"return": {
"type": {
"text": ""
}
}
"privacy": "private"
},
{
"kind": "field",
"name": "_resumejsonTask",
"default": "new Task(this, {\n task: async ([gist_id, json_url], {signal}) => {\n if (!this.resumejson && !gist_id && !json_url) {\n throw new Error('resumejson property, or a gist_id or json_url attribute are required')\n }\n let resumejson = {};\n if (this.resumejson) {\n resumejson = this.resumejson\n } else {\n resumejson = await getResumeJson(gist_id, json_url)\n }\n if (!resumejson.basics || !resumejson.basics.name) {\n throw new Error('`.basics` property and `basics.name` required to generate resume')\n }\n return this._resumeGenerate(resumejson);\n },\n args: () => [this.gist_id, this.json_url]\n })"
"default": "new Task(this, { task: async ([gist_id, json_url], {signal}) => { if (!this.resumejson && !gist_id && !json_url) { throw new Error('resumejson property, or a gist_id or json_url attribute are required') } let resumejson = {}; if (this.resumejson) { resumejson = this.resumejson } else { resumejson = await getResumeJson(gist_id, json_url) } if (!resumejson.basics || !resumejson.basics.name) { throw new Error('`.basics` property and `basics.name` required to generate resume') } return this._resumeGenerate(resumejson); }, args: () => [this.gist_id, this.json_url] })",
"description": "Task to wrap getting the resume.json file or `ResumeJson` object",
"privacy": "private"
},
{
"kind": "field",
"name": "_sectionOrder",
"privacy": "public",
"privacy": "private",
"type": {
"text": "array"
},
"default": "[\n 'basics',\n 'work',\n 'volunteer',\n 'education',\n 'awards',\n 'certificates',\n 'publications',\n 'skills',\n 'languages',\n 'interests',\n 'references',\n 'projects',\n 'meta'\n ]"
"default": "[ 'basics', 'work', 'volunteer', 'education', 'awards', 'certificates', 'publications', 'skills', 'languages', 'interests', 'references', 'projects', 'meta' ]"
},
{
"kind": "field",
"name": "_sectionTitles",
"privacy": "public",
"privacy": "private",
"type": {
"text": "object"
},
"default": "{\n \"work\": \"Work\",\n \"volunteer\": \"Volunteer\",\n \"education\": \"Education\",\n \"awards\": \"Awards\",\n \"certificates\": \"Certificates\",\n \"publications\": \"Publications\",\n \"skills\": \"Skills\",\n \"languages\": \"Languages\",\n \"interests\": \"Interests\",\n \"references\": \"References\",\n \"projects\": \"Projects\"\n }"
"default": "{ \"work\": \"Work\", \"volunteer\": \"Volunteer\", \"education\": \"Education\", \"awards\": \"Awards\", \"certificates\": \"Certificates\", \"publications\": \"Publications\", \"skills\": \"Skills\", \"languages\": \"Languages\", \"interests\": \"Interests\", \"references\": \"References\", \"projects\": \"Projects\" }"
},
{
"kind": "field",
Expand Down Expand Up @@ -259,7 +278,8 @@
"privacy": "public",
"type": {
"text": "string"
}
},
"description": "Accepts a string containing styles"
}
],
"attributes": [
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"storydocker-utilities": "^0.0.21",
"vite": "5.2.11",
"vite-plugin-static-copy": "^1.0.4",
"wc-storybook-helpers": "^2.0.2",
"yaml": "^2.4.2"
},
"customElements": "custom-elements.json",
Expand Down
32 changes: 28 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import {
import {getResumeJson} from './get-remote-resume.js';
import style from './style.css?inline' assert { type: 'css' };

/** @typedef {import('jsonresume-theme-microdata/schema.d.ts').ResumeSchema} ResumeJson */

/**
* @element json-resume
*
Expand Down Expand Up @@ -112,15 +114,24 @@ export class JsonResume extends LitElement {
type: Object,
attribute: false
},
/**
* Accepts a string containing styles
*/
stylesheet: {
type: String,
attribute: false
},
/**
* @private
*/
_sectionOrder: {
type: Array,
attribute: false,
state: true,
},
/**
* @private
*/
_sectionTitles: {
type: Object,
attribute: false,
Expand Down Expand Up @@ -167,6 +178,10 @@ export class JsonResume extends LitElement {
this.setAttribute('exportparts', parts.join(','));
}

/**
* Generates a `style` tag with variable component styles
* @private
*/
_stylesGenerate = () => {
return `<style>
${this.stylesheet ? this.stylesheet : style}
Expand All @@ -181,6 +196,12 @@ export class JsonResume extends LitElement {
}
}

/**
* Returns a section of a resume
* @param {string} section - name of a JSON Resume section
* @param {object} content - content for that section only
* @private
*/
_resumeSection = (section, content) => {
return html`
${choose(section, [
Expand All @@ -207,9 +228,9 @@ export class JsonResume extends LitElement {
}

/**
*
* @param {*} resumejson
* @returns
* Generate the resume HTML with the <style> element
* @param {ResumeJson} resumejson
* @private
*/
_resumeGenerate = (resumejson) => {
if (this.preordered) {
Expand All @@ -233,7 +254,10 @@ export class JsonResume extends LitElement {
</div>`
}


/**
* Task to wrap getting the resume.json file or `ResumeJson` object
* @private
*/
_resumejsonTask = new Task(this, {
task: async ([gist_id, json_url], {signal}) => {
if (!this.resumejson && !gist_id && !json_url) {
Expand Down
5 changes: 5 additions & 0 deletions src/web-component.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import { microdata } from '@cucumber/microdata';
import { expect } from '@storybook/test';
import { within as shadowWithin } from 'shadow-dom-testing-library';
import stylesEven from 'jsonresume-theme-microdata/style.css?inline';
import { getWcStorybookHelpers } from "wc-storybook-helpers";

import 'profile-components/github-repository';

import resumeLorem from '@/fixtures/lorem.resume.json?raw';
import './index.js';

const { argTypes } = getWcStorybookHelpers("json-resume");

const resumeFixtureLorem = JSON.parse(resumeLorem);
delete resumeFixtureLorem.meta.themeOptions;
const resumeFixtureLoremOpts = JSON.parse(resumeLorem);
Expand All @@ -28,6 +32,7 @@ ${json.basics.summary}`),
export default {
title: 'JsonResume',
component: 'json-resume',
argTypes,
};

export const GistID = {
Expand Down
9 changes: 8 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3430,7 +3430,7 @@
resolved "https://registry.yarnpkg.com/@storybook/node-logger/-/node-logger-8.1.1.tgz#f321300cf3c00b224954603d023883522e05531c"
integrity sha512-l+B8eu3yBZfrHvCR/FVqGyObgA0KSLp+06NkWDMn0p7qu0tCTROquopKdn2gXKitZp8wGwhgJV56OvW5C12XQA==

"@storybook/[email protected]":
"@storybook/[email protected]", "@storybook/preview-api@^7.0.0 || ^8.0.0":
version "8.1.1"
resolved "https://registry.yarnpkg.com/@storybook/preview-api/-/preview-api-8.1.1.tgz#c7b865607c1fafc0592ffed0fd93c46f9a2e79fc"
integrity sha512-5EcByqtJgj7a7ZWICMLif8mK3cRmdIMbdSPEDf4X6aTQ8LZOg6updLrkb/Eh6qfeYv46TK/MP8BXa89wfOxWGQ==
Expand Down Expand Up @@ -14637,6 +14637,13 @@ watchpack@^2.2.0:
glob-to-regexp "^0.4.1"
graceful-fs "^4.1.2"

wc-storybook-helpers@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/wc-storybook-helpers/-/wc-storybook-helpers-2.0.2.tgz#d80806fc72eea559cbaa02f71edaaf192fee7b4a"
integrity sha512-phSSsD3zDonp1uOgwbIqIPGBn1ilKxeeTu/S37M/pPcJ0IYQhUgv1IV2UMX5l5yQHgAVQZX+dwtHuAe0atB9mA==
dependencies:
"@storybook/preview-api" "^7.0.0 || ^8.0.0"

wcwidth@^1.0.0, wcwidth@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz"
Expand Down

0 comments on commit 4eb9c8e

Please sign in to comment.