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

upgrade to v0.20.0-alpha.0 and node 14 #53

Merged
merged 6 commits into from
Dec 18, 2021
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 .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 2021,
sourceType: 'module'
},
env: {
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ To add this plugin to an _existing_ Greenwood project (where `@greenwood/cli` ha
```
1. Add this plugin and all dependent plugins to your _greenwood.config.js_
```js
const pluginImportCss = require('@greenwood/plugin-import-css');
const pluginThemePresentation = require('greenwood-starter-presentation');
import { greenwoodPluginImportCss } from '@greenwood/plugin-import-css';
import { greenwoodThemeStarterPresentation } from 'greenwood-starter-presentation';

module.exports = {
export default {
.
.

plugins: [
...pluginImportCss(),
...pluginThemePresentation()
...greenwoodPluginImportCss(),
...greenwoodThemeStarterPresentation()
]

};
Expand Down
18 changes: 10 additions & 8 deletions greenwood.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
const greenwoodStarterPresentation = require('./index');
const packageName = require('./package.json').name;
const path = require('path');
const pluginImportCss = require('@greenwood/plugin-import-css');
const { ResourceInterface } = require('@greenwood/cli/src/lib/resource-interface');
import fs from 'fs';
import { greenwoodThemeStarterPresentation } from './index.js';
import { greenwoodPluginImportCss } from '@greenwood/plugin-import-css';
import path from 'path';
import { ResourceInterface } from '@greenwood/cli/src/lib/resource-interface.js';

const packageName = JSON.parse(fs.readFileSync(path.join(process.cwd(), './package.json'), 'utf-8')).name;

class MyThemePackDevelopmentResource extends ResourceInterface {
constructor(compilation, options) {
Expand All @@ -23,12 +25,12 @@ class MyThemePackDevelopmentResource extends ResourceInterface {
}
}

module.exports = {
export default {
title: 'My Presentation',

plugins: [
...pluginImportCss(),
...greenwoodStarterPresentation({
...greenwoodPluginImportCss(),
...greenwoodThemeStarterPresentation({
__isDevelopment: true
}),
{
Expand Down
17 changes: 12 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
const packageJson = require('./package.json');
const path = require('path');
import fs from 'fs';
import path from 'path';
import { fileURLToPath, URL } from 'url';

module.exports = (options = {}) => [{
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf-8'));

const greenwoodThemeStarterPresentation = (options = {}) => [{
type: 'context',
name: `${packageJson.name}:context`,
provider: (compilation) => {
const templateLocation = options.__isDevelopment // eslint-disable-line no-underscore-dangle
? path.join(compilation.context.userWorkspace, 'layouts')
: path.join(__dirname, 'dist/layouts');
: fileURLToPath(new URL('dist/layouts', import.meta.url));

return {
templates: [
templateLocation
]
};
}
}];
}];

export {
greenwoodThemeStarterPresentation
};
9 changes: 9 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build]
publish = "public/"
command = "yarn build"

[build.processing]
skip_processing = true

[build.environment]
NODE_VERSION = "14.17.0"
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.4.2",
"description": "A Greenwood plugin and general purpose starter kit for creating slide decks and presentations from markdown.",
"main": "index.js",
"type": "module",
"files": [
"dist/"
],
Expand Down Expand Up @@ -45,12 +46,12 @@
"lit-element": "^2.4.0"
},
"devDependencies": {
"@greenwood/cli": "~0.18.0",
"@greenwood/plugin-import-css": "~0.18.0",
"eslint": "^7.25.0",
"@greenwood/cli": "~0.20.0",
"@greenwood/plugin-import-css": "~0.20.0",
"eslint": "^8.4.0",
"rimraf": "^3.0.2",
"stylelint": "^13.12.0",
"stylelint-a11y": "^1.2.3",
"stylelint-config-standard": "^20.0.0"
}
}
}
File renamed without changes.
Loading