Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/upgrade greenwood v0.30.0 #125

Merged
merged 5 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.12.1
18.20.2
4 changes: 2 additions & 2 deletions greenwood.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { greenwoodPluginGoogleAnalytics } from '@greenwood/plugin-google-analytics';
import { greenwoodPluginImportCss } from '@greenwood/plugin-import-css';
import { greenwoodPluginImportRaw } from '@greenwood/plugin-import-raw';
import { greenwoodPluginPolyfills } from '@greenwood/plugin-polyfills';
import { greenwoodPluginPostCss } from '@greenwood/plugin-postcss';

Expand All @@ -12,7 +12,7 @@ export default {

plugins: [
greenwoodPluginPostCss(),
greenwoodPluginImportCss(),
greenwoodPluginImportRaw(),
greenwoodPluginPolyfills(),
greenwoodPluginGoogleAnalytics({
analyticsId: 'G-0F85VEMETN'
Expand Down
2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
skip_processing = true

[build.environment]
NODE_VERSION = "18.12.1"
NODE_VERSION = "18.20.2"

[[redirects]]
from = "/api/*"
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"scripts": {
"clean": "rimraf ./public ./reports",
"build": "greenwood build",
"develop": "greenwood develop",
"dev": "greenwood develop",
"lint:js": "eslint \"*.js\" \"./src/**/**/*.js\"",
"lint:css": "stylelint \"./src/**/*.css\"",
"lint": "ls-lint && yarn lint:js && yarn lint:css",
"serve": "yarn build && greenwood serve",
"serve": "yarn clean && yarn build && greenwood serve",
"start": "yarn develop",
"release": "yarn clean && echo \"todo\"",
"test": "wtr",
Expand All @@ -40,11 +40,11 @@
"devDependencies": {
"@babel/core": "^7.14.0",
"@esm-bundle/chai": "^4.3.4",
"@greenwood/cli": "^0.29.0",
"@greenwood/plugin-google-analytics": "^0.29.0",
"@greenwood/plugin-import-css": "^0.29.0",
"@greenwood/plugin-polyfills": "^0.29.0",
"@greenwood/plugin-postcss": "^0.29.0",
"@greenwood/cli": "^0.30.0",
"@greenwood/plugin-google-analytics": "^0.30.0",
"@greenwood/plugin-import-raw": "^0.30.0",
"@greenwood/plugin-polyfills": "^0.30.0",
"@greenwood/plugin-postcss": "^0.30.0",
"@ls-lint/ls-lint": "^1.10.0",
"@web/test-runner": "^0.13.13",
"@web/test-runner-junit-reporter": "^0.4.4",
Expand Down
2 changes: 1 addition & 1 deletion src/components/dropdown/dropdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, LitElement } from 'lit';
import css from './dropdown.css?type=css';
import css from './dropdown.css?type=raw';

class DropdownComponent extends LitElement {
static get properties() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/footer/footer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { html, LitElement } from 'lit';
// import githubLogo from './images/github-logo.png';
// import twitterLogo from './images/twitter-logo.png';
import css from './footer.css?type=css';
import css from './footer.css?type=raw';

class FooterComponent extends LitElement {

Expand Down
2 changes: 1 addition & 1 deletion src/components/header/header.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, LitElement } from 'lit';
import css from './header.css?type=css';
import css from './header.css?type=raw';
// import logo from './logo.png';

class HeaderComponent extends LitElement {
Expand Down
2 changes: 1 addition & 1 deletion src/components/issues-list/issues-list.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { html, LitElement } from 'lit';
import css from './issues-list.css?type=css';
import css from './issues-list.css?type=raw';

class IssuesListComponent extends LitElement {

Expand Down
2 changes: 1 addition & 1 deletion src/routes/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TopologyService } from '../../services/topology-service.js';
import '../../components/dropdown/dropdown.js';
import '../../components/issues-list/issues-list.js';

import css from './home.css?type=css';
import css from './home.css?type=raw';

class HomePageComponent extends LitElement {

Expand Down
10 changes: 5 additions & 5 deletions web-test-runner.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { defaultReporter } from '@web/test-runner';
import fs from 'fs/promises';
import { greenwoodPluginImportCss } from '@greenwood/plugin-import-css/src/index.js';
import { greenwoodPluginImportRaw } from '@greenwood/plugin-import-raw';
import { junitReporter } from '@web/test-runner-junit-reporter';

// create a direct instance of ImportCssResource
const importCssResource = greenwoodPluginImportCss()[0].provider({});
const importRawResource = greenwoodPluginImportRaw()[0].provider({});

export default {
files: './src/**/*.spec.js',
Expand All @@ -23,13 +23,13 @@ export default {
name: 'import-css',
async transform(context) {
const url = new URL(`.${context.request.url}`, import.meta.url);
const request = new Request(url, { headers: new Headers(context.headers) });
const shouldIntercept = await importCssResource.shouldIntercept(url, request);
const request = new Request(url, { headers: new Headers({ 'Sec-Fetch-Dest': 'empty' }) });
const shouldIntercept = await importRawResource.shouldIntercept(url, request);

if (shouldIntercept) {
const contents = await fs.readFile(url);
const initResponse = new Response(contents, { headers: new Headers(context.headers) });
const response = await importCssResource.intercept(url, request, initResponse.clone());
const response = await importRawResource.intercept(url, request, initResponse.clone());

return {
body: await response.text(),
Expand Down
Loading
Loading