Skip to content

Commit

Permalink
feat: build *.dev.js files from everything
Browse files Browse the repository at this point in the history
  • Loading branch information
Westbrook committed May 19, 2022
1 parent 96c9a31 commit 1beca2d
Show file tree
Hide file tree
Showing 329 changed files with 2,726 additions and 683 deletions.
1 change: 1 addition & 0 deletions .storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"emitDeclarationOnly": false,
"noImplicitAny": false,
"noUnusedLocals": false,
"declaration": false
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"packages/*/src/spectrum-vars.json": true,
"**/*.js.map": true,
"**/*.js": { "when": "$(basename).ts" },
"**/*.dev.js": { "when": "$(basename).js" },
"**/*.d.ts": { "when": "$(basename).ts" },
"**/*.test-vrt.ts": true
}
Expand Down
1 change: 0 additions & 1 deletion global.d.ts

This file was deleted.

15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@
"scripts": {
"analyze": "lit-analyzer \"packages/*/src/**/!(*.css).ts\"",
"analyze:quick": "lit-analyzer \"packages/*/src/!(*.css).ts\"",
"build": "node test/visual/create.js && yarn build:css && yarn build:ts",
"build": "node test/visual/create.js && yarn build:css && run-p esbuild:ts build:ts",
"build:clean": "yarn build:ts:clean && yarn build",
"build:clear-cache": "rimraf packages/*/tsconfig.tsbuildinfo && rimraf tools/*/tsconfig.tsbuildinfo",
"build:compare": "tsc --build projects/vrt-compare/tsconfig.json",
"build:component-inventory": "node ./tasks/build-component-inventory.js",
"build:confirm": "lerna exec --ignore \"{@spectrum-web-components/{base,bundle,close-button,clear-button,icons-ui,icons-workflow,iconset,modal,shared,styles},documentation,example-project-rollup,example-project-webpack,swc-templates}\" -- test -f src/index.js",
"build:css": "node ./tasks/build-css.js && pretty-quick --fix --pattern \"packages/**/*.css\"",
"build:decorator": "tsc --build projects/story-decorator/tsconfig.json",
"build:tests": "tsc --build test/tsconfig.json && tsc --build test/tsconfig-node.json",
"build:ts": "yarn tsc --build tsconfig-all.json",
"build:ts:clean": "yarn build:ts --clean",
"build:watch": "yarn build:ts --watch",
"build:watch": "yarn esbuild:watch",
"custom-element-json": "lerna exec --ignore \"{@spectrum-web-components/{base,bundle,modal,iconset,shared,styles},documentation,example-project-rollup,example-project-webpack,swc-templates}\" -- cem analyze --config ../../custom-elements-manifest.config.js",
"docs:analyze": "cem analyze --globs \"packages/**/*.ts\" --exclude \"**/*.d.ts\" --exclude \"**/stories/**\" --exclude \"**/icons/**\" --exclude \"**/elements/**\" --outdir projects/documentation --litelement",
"docs:build": "yarn workspace documentation build",
Expand All @@ -32,6 +30,8 @@
"docs:review": "alex packages/**/*.md",
"docs:start": "yarn docs:analyze && run-p watch:css build:watch docs:watch",
"docs:watch": "yarn workspace documentation watch",
"esbuild:ts": "node ./tasks/esbuild-packages.js",
"esbuild:watch": "node ./tasks/watch-packages.js",
"find": "test -f custom-elements.json",
"get-ready": "yarn build:clear-cache && run-p process-icons process-spectrum && yarn build:clean",
"icons": "node ./scripts/process-icons.js && pretty-quick --pattern \"packages/**/*.svg.ts\" && eslint -f pretty --fix \"packages/**/*.svg.ts\"",
Expand Down Expand Up @@ -62,12 +62,12 @@
"process-spectrum": "run-s spectrum-vars spectrum-css",
"spectrum-css": "node ./scripts/process-spectrum-css.js",
"spectrum-vars": "node ./scripts/spectrum-vars.js",
"storybook": "yarn build:ts && yarn build:css && run-p storybook:start watch:css build:watch",
"storybook": "yarn build:css && run-p storybook:start watch:css build:watch",
"storybook:build": "build-storybook -o projects/documentation/dist/storybook",
"storybook:start": "web-dev-server --config wds-storybook.config.js",
"test": "yarn test:focus unit",
"test:bench": "node test/benchmark/cli.cjs",
"test:build": "tsc --build test/tsconfig-plugins.json && tsc --build test/tsconfig-test.json",
"test:build": "yarn esbuild:ts",
"test:changed": "node ./tasks/test-changes.js",
"test:ci": "yarn test:start",
"test:focus": "yarn build && yarn test:ci --coverage --group",
Expand All @@ -78,7 +78,7 @@
"test:visual:clean:baseline": "rimraf test/visual/screenshots-baseline",
"test:visual:clean:current": "rimraf test/visual/screenshots-current",
"test:watch": "yarn test:watch:focus unit",
"test:watch:focus": "yarn test:build && run-p watch:css \"test:build -w\" \"test:start --watch --group {1}\" --",
"test:watch:focus": "yarn test:build && run-p watch:css build:watch \"test:start --watch --group {1}\" --",
"update:spectrum-css": "node ./scripts/update-spectrum-css.js || yarn update:spectrum-css:cleanup",
"update:spectrum-css:cleanup": "yarn lint:packagejson && yarn --ignore-scripts && yarn process-spectrum",
"vrt:quick-link": "yarn netlify deploy --alias=vrt --dir=projects/vrt-quick-link",
Expand Down Expand Up @@ -129,6 +129,7 @@
"custom-elements-manifest": "^1.0.0",
"debounce": "^1.2.1",
"deepmerge": "^4.2.2",
"esbuild": "^0.14.25",
"eslint": "^8.2.0",
"eslint-config-prettier": "^8.3.0",
"eslint-formatter-pretty": "^4.1.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/accordion/exports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
".": "./src/index.js",
"./src/*.js": "./src/*.js",
"./package.json": "./package.json",
"./sp-accordion.js": "./sp-accordion.js",
"./sp-accordion-item.js": "./sp-accordion-item.js"
}
32 changes: 26 additions & 6 deletions packages/accordion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,33 @@
"module": "./src/index.js",
"type": "module",
"exports": {
".": "./src/index.js",
"./src/*": "./src/*",
".": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./package.json": "./package.json",
"./sp-accordion": "./sp-accordion.js",
"./sp-accordion.js": "./sp-accordion.js",
"./sp-accordion-item": "./sp-accordion-item.js",
"./sp-accordion-item.js": "./sp-accordion-item.js"
"./src/Accordion.js": {
"development": "./src/Accordion.dev.js",
"default": "./src/Accordion.js"
},
"./src/AccordionItem.js": {
"development": "./src/AccordionItem.dev.js",
"default": "./src/AccordionItem.js"
},
"./src/accordion-item.css.js": "./src/accordion-item.css.js",
"./src/accordion.css.js": "./src/accordion.css.js",
"./src/index.js": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./sp-accordion.js": {
"development": "./sp-accordion.dev.js",
"default": "./sp-accordion.js"
},
"./sp-accordion-item.js": {
"development": "./sp-accordion-item.dev.js",
"default": "./sp-accordion-item.js"
}
},
"scripts": {
"test": "karma start --coverage"
Expand Down
4 changes: 2 additions & 2 deletions packages/accordion/stories/accordion.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ governing permissions and limitations under the License.

import { html, TemplateResult } from '@spectrum-web-components/base';

import '../sp-accordion.js';
import '../sp-accordion-item.js';
import '@spectrum-web-components/accordion/sp-accordion.js';
import '@spectrum-web-components/accordion/sp-accordion-item.js';
import '@spectrum-web-components/link/sp-link.js';

export default {
Expand Down
4 changes: 2 additions & 2 deletions packages/accordion/test/accordion-item.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ governing permissions and limitations under the License.
import { elementUpdated, expect, fixture, html } from '@open-wc/testing';
import { spy } from 'sinon';

import '../sp-accordion-item.js';
import { AccordionItem } from '../src/AccordionItem';
import '@spectrum-web-components/accordion/sp-accordion-item.js';
import { AccordionItem } from '@spectrum-web-components/accordion/src/AccordionItem.js';
import { sendKeys } from '@web/test-runner-commands';

describe('Accordion Item', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/accordion/test/accordion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ governing permissions and limitations under the License.

import { elementUpdated, expect, fixture, html } from '@open-wc/testing';

import '../sp-accordion.js';
import '@spectrum-web-components/accordion/sp-accordion.js';
import { Default } from '../stories/accordion.stories.js';
import { Accordion, AccordionItem } from '@spectrum-web-components/accordion';
import { sendKeys } from '@web/test-runner-commands';
Expand Down
4 changes: 4 additions & 0 deletions packages/action-bar/exports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"./src/*": "./src/*",
"./sp-action-bar.js": "./sp-action-bar.js"
}
21 changes: 17 additions & 4 deletions packages/action-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,24 @@
"module": "src/index.js",
"type": "module",
"exports": {
".": "./src/index.js",
"./src/*": "./src/*",
".": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./package.json": "./package.json",
"./sp-action-bar": "./sp-action-bar.js",
"./sp-action-bar.js": "./sp-action-bar.js"
"./src/ActionBar.js": {
"development": "./src/ActionBar.dev.js",
"default": "./src/ActionBar.js"
},
"./src/action-bar.css.js": "./src/action-bar.css.js",
"./src/index.js": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./sp-action-bar.js": {
"development": "./sp-action-bar.dev.js",
"default": "./sp-action-bar.js"
}
},
"scripts": {
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
Expand Down
2 changes: 1 addition & 1 deletion packages/action-bar/stories/action-bar.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ governing permissions and limitations under the License.

import { html, TemplateResult } from '@spectrum-web-components/base';

import '../sp-action-bar.js';
import '@spectrum-web-components/action-bar/sp-action-bar.js';
import '@spectrum-web-components/checkbox/sp-checkbox.js';
import '@spectrum-web-components/action-button/sp-action-button.js';
import '@spectrum-web-components/action-group/sp-action-group.js';
Expand Down
4 changes: 2 additions & 2 deletions packages/action-bar/test/action-bar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ governing permissions and limitations under the License.

import { elementUpdated, expect, fixture, html } from '@open-wc/testing';

import '../sp-action-bar.js';
import { ActionBar } from '..';
import '@spectrum-web-components/action-bar/sp-action-bar.js';
import { ActionBar } from '@spectrum-web-components/action-bar';
import { Default } from '../stories/action-bar.stories.js';

describe('ActionBar', () => {
Expand Down
4 changes: 4 additions & 0 deletions packages/action-button/exports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"./src/*": "./src/*",
"./sp-action-button.js": "./sp-action-button.js"
}
21 changes: 17 additions & 4 deletions packages/action-button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,24 @@
"module": "src/index.js",
"type": "module",
"exports": {
".": "./src/index.js",
"./src/*": "./src/*",
".": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./package.json": "./package.json",
"./sp-action-button": "./sp-action-button.js",
"./sp-action-button.js": "./sp-action-button.js"
"./src/ActionButton.js": {
"development": "./src/ActionButton.dev.js",
"default": "./src/ActionButton.js"
},
"./src/action-button.css.js": "./src/action-button.css.js",
"./src/index.js": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./sp-action-button.js": {
"development": "./sp-action-button.dev.js",
"default": "./sp-action-button.js"
}
},
"scripts": {
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
Expand Down
3 changes: 1 addition & 2 deletions packages/action-button/stories/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import '@spectrum-web-components/action-group/sp-action-group.js';
import '@spectrum-web-components/icon/sp-icon.js';
import '@spectrum-web-components/icons-workflow/icons/sp-icon-edit.js';

import '../src';
import '../sp-action-button.js';
import '@spectrum-web-components/action-button/sp-action-button.js';

export interface Properties {
active?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions packages/action-button/test/action-button.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

import '../sp-action-button.js';
import { ActionButton } from '../';
import '@spectrum-web-components/action-button/sp-action-button.js';
import { ActionButton } from '@spectrum-web-components/action-button';
import {
elementUpdated,
expect,
Expand Down
4 changes: 4 additions & 0 deletions packages/action-group/exports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"./src/*": "./src/*",
"./sp-action-group.js": "./sp-action-group.js"
}
21 changes: 17 additions & 4 deletions packages/action-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,24 @@
"module": "./src/index.js",
"type": "module",
"exports": {
".": "./src/index.js",
"./src/*": "./src/*",
".": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./package.json": "./package.json",
"./sp-action-group": "./sp-action-group.js",
"./sp-action-group.js": "./sp-action-group.js"
"./src/ActionGroup.js": {
"development": "./src/ActionGroup.dev.js",
"default": "./src/ActionGroup.js"
},
"./src/action-group.css.js": "./src/action-group.css.js",
"./src/index.js": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./sp-action-group.js": {
"development": "./sp-action-group.dev.js",
"default": "./sp-action-group.js"
}
},
"scripts": {
"test": "karma start --coverage"
Expand Down
4 changes: 2 additions & 2 deletions packages/action-group/stories/action-group-tooltip.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ governing permissions and limitations under the License.
import { html, TemplateResult } from '@spectrum-web-components/base';
import { spreadProps } from '../../../test/lit-helpers.js';

import '../sp-action-group.js';
import '@spectrum-web-components/action-group/sp-action-group.js';
import '@spectrum-web-components/action-button/sp-action-button.js';
import '@spectrum-web-components/overlay/overlay-trigger.js';
import '@spectrum-web-components/tooltip/sp-tooltip.js';
import '@spectrum-web-components/icons-workflow/icons/sp-icon-properties.js';
import '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js';
import '@spectrum-web-components/icons-workflow/icons/sp-icon-view-all-tags.js';
import { ActionGroup } from '../src/ActionGroup.js';
import { ActionGroup } from '@spectrum-web-components/action-group/src/ActionGroup.js';

export default {
title: 'Action Group/Tooltips',
Expand Down
4 changes: 2 additions & 2 deletions packages/action-group/stories/action-group.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ governing permissions and limitations under the License.
import { html, TemplateResult } from '@spectrum-web-components/base';
import { spreadProps } from '../../../test/lit-helpers.js';

import '../sp-action-group.js';
import '@spectrum-web-components/action-group/sp-action-group.js';
import '@spectrum-web-components/action-button/sp-action-button.js';
import '@spectrum-web-components/overlay/overlay-trigger.js';
import '@spectrum-web-components/tooltip/sp-tooltip.js';
import '@spectrum-web-components/icons-workflow/icons/sp-icon-properties.js';
import '@spectrum-web-components/icons-workflow/icons/sp-icon-info.js';
import '@spectrum-web-components/icons-workflow/icons/sp-icon-view-all-tags.js';
import { ActionGroup } from '../src/ActionGroup.js';
import { ActionGroup } from '@spectrum-web-components/action-group/src/ActionGroup.js';

export default {
title: 'Action Group',
Expand Down
4 changes: 2 additions & 2 deletions packages/action-group/test/action-group.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import '@spectrum-web-components/action-button/sp-action-button.js';
import { LitElement, TemplateResult } from '@spectrum-web-components/base';
import '@spectrum-web-components/overlay/overlay-trigger.js';
import '@spectrum-web-components/tooltip/sp-tooltip.js';
import { ActionGroup } from '..';
import { ActionGroup } from '@spectrum-web-components/action-group';
import {
arrowDownEvent,
arrowLeftEvent,
Expand All @@ -33,7 +33,7 @@ import {
homeEvent,
} from '../../../test/testing-helpers';
import { sendKeys } from '@web/test-runner-commands';
import '../sp-action-group.js';
import '@spectrum-web-components/action-group/sp-action-group.js';

class QuietActionGroup extends LitElement {
protected render(): TemplateResult {
Expand Down
5 changes: 5 additions & 0 deletions packages/action-menu/exports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"./src/*": "./src/*",
"./sp-action-menu.js": "./sp-action-menu.js",
"./sync/sp-action-menu.js": "./sync/sp-action-menu.js"
}
27 changes: 21 additions & 6 deletions packages/action-menu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,28 @@
"module": "./src/index.js",
"type": "module",
"exports": {
".": "./src/index.js",
"./src/*": "./src/*",
".": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./package.json": "./package.json",
"./sp-action-menu": "./sp-action-menu.js",
"./sp-action-menu.js": "./sp-action-menu.js",
"./sync/sp-action-menu": "./sync/sp-action-menu.js",
"./sync/sp-action-menu.js": "./sync/sp-action-menu.js"
"./src/ActionMenu.js": {
"development": "./src/ActionMenu.dev.js",
"default": "./src/ActionMenu.js"
},
"./src/action-menu.css.js": "./src/action-menu.css.js",
"./src/index.js": {
"development": "./src/index.dev.js",
"default": "./src/index.js"
},
"./sp-action-menu.js": {
"development": "./sp-action-menu.dev.js",
"default": "./sp-action-menu.js"
},
"./sync/sp-action-menu.js": {
"development": "./sync/sp-action-menu.dev.js",
"default": "./sync/sp-action-menu.js"
}
},
"scripts": {
"test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
Expand Down
Loading

0 comments on commit 1beca2d

Please sign in to comment.