Skip to content

Commit

Permalink
Template release 0.1.0 : minor cleanup and prep for template release
Browse files Browse the repository at this point in the history
  • Loading branch information
daeh committed Sep 11, 2024
1 parent ab70b32 commit d4cfa81
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 92 deletions.
37 changes: 0 additions & 37 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#########
*.lock
*-lock.*
vite.config.mts.timestamp-*.mjs

#########
### editor config ###
Expand Down
Binary file modified .yarn/install-state.gz
Binary file not shown.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ For bundling the website, this project uses

- [Vite](https://vitejs.dev/) (configured in [`vite.config.mts`](vite.config.mts))
- [Tailwind CSS](https://tailwindcss.com/) (configured in [`tailwind.config.ts`](tailwind.config.ts))
<!-- - [PostCSS](https://postcss.org/) (configured in [`vite.config.mts`](hosting/vite.config.mts); uses [PostCSS Preset Env](https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env), which uses [Autoprefixer](https://github.com/postcss/autoprefixer)) -->
- [PostCSS](https://postcss.org/) (configured in [`vite.config.mts`](vite.config.mts); uses [postcss-import](https://github.com/postcss/postcss-import), [Autoprefixer](https://github.com/postcss/autoprefixer))
- [PostCSS](https://postcss.org/) (configured in [`vite.config.mts`](vite.config.mts); uses [Autoprefixer](https://github.com/postcss/autoprefixer))
- [Browserslist](https://github.com/browserslist/browserslist) (via the [browserslist-to-esbuild plugin](https://github.com/marcofugaro/browserslist-to-esbuild); configured in [`package.json`](package.json))
- [jsPsych](https://www.jspsych.org/) - UX (experiment flow, data capture)

Expand Down
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ const typescriptRulesDev = {
'@typescript-eslint/dot-notation': ['off'],
}

/** @type {import("eslint").Linter.Config[]} */
const config = [
{
/* setup parser for all files */
Expand Down Expand Up @@ -266,6 +267,7 @@ const config = [
'build/',
/* generated files */
'.pnp.*',
'vite.config.mts.timestamp-*.mjs',
/* editor config */
/* project specific patterns */
],
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"bugs": {
"url": "https://github.com/daeh/jspsych-template/issues"
},
"templateVersion": "0.1.0",
"source": "./hosting",
"directories": {
"serve": "hosting/dist"
Expand All @@ -47,23 +48,20 @@
"@stylistic/eslint-plugin": "^2.8.0",
"@types/eslint-config-prettier": "^6.11.3",
"@types/node": "^22.5.4",
"@types/postcss-import": "^14.0.3",
"@typescript-eslint/eslint-plugin": "^8.5.0",
"@typescript-eslint/parser": "^8.5.0",
"autoprefixer": "^10.4.20",
"browserslist": "^4.23.3",
"browserslist-to-esbuild": "^2.1.1",
"child_process": "^1.0.2",
"eslint": "<9.0.0",
"eslint": "^8.57.0 <9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-prettier": "^5.2.1",
"firebase-tools": "^13.16.0",
"globals": "^15.9.0",
"postcss": "^8.4.45",
"postcss-import": "^16.1.0",
"postcss-preset-env": "^10.0.3",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.6",
"readline-sync": "^1.4.10",
Expand All @@ -74,4 +72,4 @@
"vite-plugin-html": "^3.2.2"
},
"packageManager": "[email protected]"
}
}
2 changes: 0 additions & 2 deletions prettier.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const config = {
arrowParens: 'always',
proseWrap: 'never',
endOfLine: 'lf',
// plugins: ['prettier-plugin-tailwindcss'],
// plugins: [require.resolve('prettier-plugin-organize-imports')],
plugins: [import('prettier-plugin-tailwindcss')],
tailwindConfig: './tailwind.config.ts',
overrides: [
Expand Down
3 changes: 1 addition & 2 deletions scripts/releaseScript.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ async function attemptRelease(projectPath) {
}
if (incrementVersion.toLowerCase() === 'y') {
newVersion = readlineSync.question('>>> Enter the new version number: ')
if (/^[0-9]+\.[0-9]+\.[0-9]+$/.test(newVersion)) {
if (/^[0-9]+?\.[0-9]+?\.[0-9]+$/.test(newVersion)) {
await updatePackageJsonVersion(newVersion, projectPath)
await updatePackageJsonVersion(newVersion, path.join(projectPath, 'hosting'))
tag = true
console.log(
'\n-------------------------------------------------------------\n' +
Expand Down
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
/* generated files */
"*.lock",
"*-lock.*",
"vite.config.mts.timestamp-*.mjs",
/* editor config */
"**/.vscode/",
"**/.idea/"
Expand Down
21 changes: 2 additions & 19 deletions vite.config.mts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { execSync } from 'child_process'

import postcssImport from 'postcss-import'
import tailwindcss from 'tailwindcss'
import tailwindcssNesting from 'tailwindcss/nesting'

Expand All @@ -9,10 +8,9 @@ import browserslistToEsbuild from 'browserslist-to-esbuild'
import { defineConfig } from 'vite'
import { createHtmlPlugin } from 'vite-plugin-html'

import tailwindConfig from './tailwind.config.ts'
import tailwindConfig from './tailwind.config'

import type { UserConfig } from 'vite'
// import postcssNesting from 'postcss-nesting';

const filesPathToExclude: (string | RegExp)[] = [/[-_]buildignore/]

Expand Down Expand Up @@ -55,28 +53,13 @@ export default defineConfig(({ command, mode }) => {
css: {
postcss: {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
plugins: [postcssImport, tailwindcssNesting, tailwindcss(tailwindConfig), autoprefixer],
// plugins: {
// // 'postcss-import': {},
// 'tailwindcss/nesting': 'postcss-nesting',
// 'tailwindcss': { },
// /* POSTCSS-PRESET-ENV: remove autoprefixer if you had it here, it's part of postcss-preset-env */
// 'postcss-preset-env': {
// /* TAILWINDCSS: Note that if you are using postcss-preset-env in your project, you should make sure to disable nesting and let tailwindcss/nesting handle it for you instead: */
// features: { 'nesting-rules': false },
// },
// },
plugins: [tailwindcssNesting, tailwindcss(tailwindConfig), autoprefixer],
},
},
define: {
'import.meta.env.VITE_APP_TITLE': JSON.stringify(title),
'__COMMIT_HASH__': JSON.stringify(getCurrentCommitHash()),
},
// resolve: {
// alias: {
// '@': srcDir,
// },
// },
} satisfies UserConfig
return config
})
26 changes: 1 addition & 25 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1884,15 +1884,6 @@ __metadata:
languageName: node
linkType: hard

"@types/postcss-import@npm:^14.0.3":
version: 14.0.3
resolution: "@types/postcss-import@npm:14.0.3"
dependencies:
postcss: "npm:^8.0.0"
checksum: 10c0/9d3649bde28f8dfe034820475751080f52f4b3bf56e28d9925582d5dec9fe84ae07a158b7191e8beb981fceadfb7b6b68a9e1818214d530e3f65e11375bf09c8
languageName: node
linkType: hard

"@types/request@npm:^2.48.8":
version: 2.48.12
resolution: "@types/request@npm:2.48.12"
Expand Down Expand Up @@ -6018,7 +6009,6 @@ __metadata:
"@stylistic/eslint-plugin": "npm:^2.8.0"
"@types/eslint-config-prettier": "npm:^6.11.3"
"@types/node": "npm:^22.5.4"
"@types/postcss-import": "npm:^14.0.3"
"@typescript-eslint/eslint-plugin": "npm:^8.5.0"
"@typescript-eslint/parser": "npm:^8.5.0"
autoprefixer: "npm:^10.4.20"
Expand All @@ -6035,7 +6025,6 @@ __metadata:
globals: "npm:^15.9.0"
jspsych: "npm:^8.0.2"
postcss: "npm:^8.4.45"
postcss-import: "npm:^16.1.0"
postcss-preset-env: "npm:^10.0.3"
prettier: "npm:^3.3.3"
prettier-plugin-tailwindcss: "npm:^0.6.6"
Expand Down Expand Up @@ -7577,19 +7566,6 @@ __metadata:
languageName: node
linkType: hard

"postcss-import@npm:^16.1.0":
version: 16.1.0
resolution: "postcss-import@npm:16.1.0"
dependencies:
postcss-value-parser: "npm:^4.0.0"
read-cache: "npm:^1.0.0"
resolve: "npm:^1.1.7"
peerDependencies:
postcss: ^8.0.0
checksum: 10c0/60e6499354079a3f46242b861412a40c54be7ab99f4ad55096a07ffe5e57fcc01c2c626b5d1fbc7a18cd23adc82b320c205059d0c7ab09e91baba8dc45c88e29
languageName: node
linkType: hard

"postcss-js@npm:^4.0.1":
version: 4.0.1
resolution: "postcss-js@npm:4.0.1"
Expand Down Expand Up @@ -7828,7 +7804,7 @@ __metadata:
languageName: node
linkType: hard

"postcss@npm:^8.0.0, postcss@npm:^8.4.23, postcss@npm:^8.4.43, postcss@npm:^8.4.45":
"postcss@npm:^8.4.23, postcss@npm:^8.4.43, postcss@npm:^8.4.45":
version: 8.4.45
resolution: "postcss@npm:8.4.45"
dependencies:
Expand Down

0 comments on commit d4cfa81

Please sign in to comment.