Skip to content

Commit

Permalink
chore(build): change imports and build/declaration. build github acti…
Browse files Browse the repository at this point in the history
…on added
  • Loading branch information
miguelramos committed Dec 29, 2023
1 parent b73ef72 commit f7ce2ba
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 28 deletions.
7 changes: 5 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,11 @@
"error",
"never",
{
"js": "always",
"json": "always"
"ignorePackages": true,
"pattern": {
"json": "always",
"js": "ignorePackages"
}
}
],
"import/no-unresolved": [
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build

on: pull_request

env:
CI: true
PNPM_CACHE_FOLDER: .pnpm-store

jobs:
build:
name: Build Packages
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install pnpm package manager
run: npm i pnpm@latest -g

- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc

- name: Setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER

- name: Install dependencies
run: pnpm install

- name: Build
run: pnpm build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint Test
name: Lint

on: pull_request

Expand All @@ -8,7 +8,7 @@ env:

jobs:
build:
name: Lint Test
name: Lint Packages
runs-on: ubuntu-latest
steps:
- name: Checkout code repository
Expand Down
26 changes: 15 additions & 11 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@
"types": "./dist/utilities/directives.d.ts",
"default": "./dist/utilities/directives.js"
},
"./event-controller.js": {
"types": "./dist/utilities/event-controller.d.ts",
"default": "./dist/utilities/event-controller.js"
},
"./helpers.js": {
"types": "./dist/utilities/helpers.d.ts",
"default": "./dist/utilities/helpers.js"
Expand All @@ -69,17 +65,25 @@
"types": "./dist/utilities/html.d.ts",
"default": "./dist/utilities/html.js"
},
"./web-component.js": {
"types": "./dist/utilities/web-component.d.ts",
"default": "./dist/utilities/web-component.js"
"./event-controller.js": {
"types": "./dist/lib/controllers/event-controller.d.ts",
"default": "./dist/lib/controllers/event-controller.js"
},
"./inspect-controller.js": {
"types": "./dist/utilities/inspect-controller.d.ts",
"default": "./dist/utilities/inspect-controller.js"
"types": "./dist/lib/controllers/inspect-controller.d.ts",
"default": "./dist/lib/controllers/inspect-controller.js"
},
"./web-component.js": {
"types": "./dist/lib/web-component.d.ts",
"default": "./dist/lib/web-component.js"
},
"./storage.js": {
"types": "./dist/utilities/storage.d.ts",
"default": "./dist/utilities/storage.js"
"types": "./dist/lib/storage.d.ts",
"default": "./dist/lib/storage.js"
},
"./inspector.js": {
"types": "./dist/lib/ui/inspector.d.ts",
"default": "./dist/lib/ui/inspector.js"
}
},
"publishConfig": {
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ export type {
ComponentMixinInterface,
ControllerHost,
WebComponentOptions
} from './types/component.js';
} from './types/component';

export type { ValueOf, Constructor } from './types/general.js';
export type { ValueOf, Constructor } from './types/general';

export type {
DirectiveParent,
Expand All @@ -41,4 +41,4 @@ export type {
CompiledTemplate,
CompiledTemplateResult,
ValueSanitizer
} from './types/lit.js';
} from './types/lit';
2 changes: 1 addition & 1 deletion packages/core/src/lib/controllers/inspect-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import { ReactiveController } from 'lit';

import { ControllerHost } from '../../types/component';
import type { ControllerHost } from '../../types/component';
import { storage } from '../storage';

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/lib/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
|
*/

import { isStringified } from '../utilities/helpers.js';
import { isStringified } from '../utilities/helpers';

/**
* Wrapper api for local and session storage.
Expand Down
8 changes: 4 additions & 4 deletions packages/core/src/lib/web-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

import { LitElement, PropertyValues, ReactiveElement } from 'lit';

import type { ComponentMetadata, ComponentMixinInterface, WebComponentOptions } from '../types/component.js';
import type { Constructor } from '../types/general.js';
import { property } from '../utilities/decorators.js';
import type { ComponentMetadata, ComponentMixinInterface, WebComponentOptions } from '../types/component';
import type { Constructor } from '../types/general';
import { property } from '../utilities/decorators';

import { InspectController } from './controllers/inspect-controller.js';
import { InspectController } from './controllers/inspect-controller';

const id = Symbol.for('VITA');

Expand Down
1 change: 1 addition & 0 deletions packages/core/src/utilities/decorators.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/extensions */
/**
|--------------------------------------------------------------------------
| Copyright Websublime All Rights Reserved.
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/utilities/directives.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable import/extensions */
/**
|--------------------------------------------------------------------------
| Copyright Websublime All Rights Reserved.
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/utilities/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
*/

export { html, svg } from 'lit/html.js';
export type { noChange, nothing, render } from 'lit/html.js';
export { noChange, nothing, render } from 'lit/html.js';
2 changes: 1 addition & 1 deletion packages/core/tsconfig.declaration.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"dom.iterable"
],
"module": "esNext",
"moduleResolution": "nodenext",
"moduleResolution": "bundler",
"noImplicitReturns": true,
"noUnusedParameters": true,
"noUnusedLocals": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { extname, relative } from 'node:path';
import { fileURLToPath } from 'node:url';

import replace from '@rollup/plugin-replace';
//import replace from '@rollup/plugin-replace';
import { glob } from 'glob';
import { defineConfig } from 'vite';

Expand All @@ -27,7 +27,7 @@ export default defineConfig({
minify: true,
outDir: 'dist',
rollupOptions: {
external: ['lit'],
external: ['lit', /^lit\/.*/],
output: {
assetFileNames: 'assets/[name][extname]',
chunkFileNames: 'chunks/[name].js',
Expand Down

0 comments on commit f7ce2ba

Please sign in to comment.